MHDRCHECK(1)

✨ mHdrCheck β€” the vibe check for your FITS header ✨

okay so this is a page from Montage (manual section 1), and bestie, it's literally just here to tell you whether your FITS image's header is valid or a whole mess. Let's get into it 🫢


πŸŽ€ NAME πŸŽ€

mHdrCheck β€” check the validity of a FITS image's header. that's it, that's the job πŸ’…


🌸 SYNOPSIS 🌸

mHdrCheck [-s statusfile] img.fits

πŸ’– DESCRIPTION πŸ’–

so mHdrCheck reads the header out of a FITS image (or an ASCII header template file, we love options) and checks whether any of the header lines are invalid. the moment it finds one, it prints a message telling you which keyword is invalid and exits right there before checking the rest of the header. ngl it will not report on multiple invalid values β€” it finds one problem and dips πŸ™ˆ

but if everything checks out? it prints a "Valid FITS/WCS" message and you can go be iconic. periodt ✨


πŸ¦‹ OPTIONS πŸ¦‹

  • -s statusfile β€” output and errors get sent to statusfile instead of to stdout. like, redirect your whole situation, iykyk πŸ’«

πŸ“ ARGUMENTS πŸ“

  • img.fits β€” path of the FITS file to be validated. that's the one getting the vibe check, no cap πŸ”₯

πŸ‘‘ MESSAGES πŸ‘‘

here's every message it can hit you with, and they are exactly these:

  • OK β€” Valid WCS in FITS file. βœ…
  • OK β€” Valid FITS/WCS in header file. βœ…
  • ERROR β€” Cannot open status file statusfile
  • ERROR β€” File filename not found.
  • ERROR β€” File (filename) is not a FITS image
  • ERROR β€” FITS header lines cannot be greater than 80 characters
  • ERROR β€” No BITPIX keyword in FITS header
  • ERROR β€” No NAXIS keyword in FITS header
  • ERROR β€” No NAXIS1 keyword in FITS header
  • ERROR β€” No NAXIS2 keyword in FITS header
  • ERROR β€” No CTYPE1 keyword in FITS header
  • ERROR β€” No CTYPE2 keyword in FITS header
  • ERROR β€” No CRPIX1 keyword in FITS header
  • ERROR β€” No CRPIX2 keyword in FITS header
  • ERROR β€” No CRVAL1 keyword in FITS header
  • ERROR β€” No CRVAL2 keyword in FITS header
  • ERROR β€” No CDELT1 keyword (or incomplete CD matrix) in FITS header
  • ERROR β€” No CDELT2 keyword (or incomplete CD matrix) in FITS header
  • ERROR β€” BITPIX keyword in FITS header not an integer
  • ERROR β€” Invalid BITPIX in FITS header (must be 8,16,32,64,-32 or -64)
  • ERROR β€” NAXIS keyword in FITS header not an integer
  • ERROR β€” NAXIS keyword in FITS header must be >= 2
  • ERROR β€” NAXIS1 keyword in FITS header not an integer
  • ERROR β€” NAXIS1 keyword in FITS header must be > 0
  • ERROR β€” NAXIS2 keyword in FITS header not an integer
  • ERROR β€” NAXIS2 keyword in FITS header must be > 0
  • ERROR β€” CRPIX1 keyword in FITS header not a real number
  • ERROR β€” CRPIX2 keyword in FITS header not a real number
  • ERROR β€” CRVAL1 keyword in FITS header not a real number
  • ERROR β€” CRVAL2 keyword in FITS header not a real number
  • ERROR β€” CDELT1 keyword in FITS header not a real number
  • ERROR β€” CDELT2 keyword in FITS header not a real number
  • ERROR β€” CROTA2 keyword in FITS header not a real number
  • ERROR β€” CD1_1 keyword in FITS header not a real number
  • ERROR β€” CD1_2 keyword in FITS header not a real number
  • ERROR β€” CD2_1 keyword in FITS header not a real number
  • ERROR β€” CD2_2 keyword in FITS header not a real number
  • ERROR β€” EQUINOX keyword in FITS header not a real number
  • ERROR β€” No WCS information (or not FITS header)
  • ERROR β€” Must have at least two dimensions
  • ERROR β€” Invalid projection
  • ERROR β€” Invalid NAXIS1
  • ERROR β€” Invalid NAXIS2
  • ERROR β€” CTYPE1 and CTYPE2 don't match
  • ERROR β€” Invalid CTYPE1
  • ERROR β€” Invalid CD matrix
  • ERROR β€” Invalid CDELT1
  • ERROR β€” Invalid CDELT2
  • ERROR β€” FITS library error

🌈 EXAMPLES 🌈

okay so here's what it actually looks like in the wild, and honestly the drama of a bad header is unmatched:

$ mHdrCheck input/badfits/bad-crota2.fits
       [struct stat="ERROR", msg="CROTA2 keyword in FITS header not a
       real number"]
$ mHdrCheck input/2mass.fits
       [struct stat="OK", msg="Valid FITS/WCS."]
$ mHdrCheck input/badfits/bad-ctype.fits

       [struct stat="ERROR", msg="Invalid projection"]

πŸ’€ BUGS πŸ’€

heads up bestie, these are the real ones, don't shoot the messenger 😭

the drizzle algorithm has been implemented but has not been tested in this release. like, it exists. it is untested. we're being honest about it πŸ™ˆ

if a header template contains carriage returns (i.e., it was created or modified on a Windows machine), the cfitsio library will be unable to read it properly, resulting in this error: [struct stat="ERROR", status=207, msg="illegal character in keyword"]

and this next one is long but it matters: it is best for the background correction algorithms if the area described in the header template completely encloses all of the input images in their entirety. if parts of input images are "chopped off" by the header template, the background correction will be affected. we recommend you use an expanded header for the reprojection and background modeling steps, returning to the originally desired header size for the final coaddition. the default background matching assumes that there are no non-linear background variations in the individual images (and therefore in the overlap differences). if there is any uncertainty in this regard, it is safer to turn on the "level only" background matching (the "-l" flag in mBgModel).


2001-2015 California Institute of Technology, Pasadena, California

if your research uses Montage, please include the following acknowledgement: "This research made use of Montage. It is funded by the National Science Foundation under Grant Number ACI-1440620, and was previously funded by the National Aeronautics and Space Administration's Earth Science Technology Office, Computation Technologies Project, under Cooperative Agreement Number NCC5-626 between NASA and the California Institute of Technology."

the Montage distribution includes an adaptation of the MOPEX algorithm developed at the Spitzer Science Center. 🌟


and that's the whole page, bestie 🫢 this was Montage 5, dated Dec 2016 β€” mHdrCheck, out. slay your headers, stay valid, and remember: no invalid keyword is gonna catch you slipping πŸ’…βœ¨