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 π¦
-sstatusfileβ output and errors get sent to statusfile instead of tostdout. 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 statusfileERRORβ File filename not found.ERRORβ File (filename) is not a FITS imageERRORβ FITS header lines cannot be greater than 80 charactersERRORβ No BITPIX keyword in FITS headerERRORβ No NAXIS keyword in FITS headerERRORβ No NAXIS1 keyword in FITS headerERRORβ No NAXIS2 keyword in FITS headerERRORβ No CTYPE1 keyword in FITS headerERRORβ No CTYPE2 keyword in FITS headerERRORβ No CRPIX1 keyword in FITS headerERRORβ No CRPIX2 keyword in FITS headerERRORβ No CRVAL1 keyword in FITS headerERRORβ No CRVAL2 keyword in FITS headerERRORβ No CDELT1 keyword (or incomplete CD matrix) in FITS headerERRORβ No CDELT2 keyword (or incomplete CD matrix) in FITS headerERRORβ BITPIX keyword in FITS header not an integerERRORβ Invalid BITPIX in FITS header (must be 8,16,32,64,-32 or -64)ERRORβ NAXIS keyword in FITS header not an integerERRORβ NAXIS keyword in FITS header must be >= 2ERRORβ NAXIS1 keyword in FITS header not an integerERRORβ NAXIS1 keyword in FITS header must be > 0ERRORβ NAXIS2 keyword in FITS header not an integerERRORβ NAXIS2 keyword in FITS header must be > 0ERRORβ CRPIX1 keyword in FITS header not a real numberERRORβ CRPIX2 keyword in FITS header not a real numberERRORβ CRVAL1 keyword in FITS header not a real numberERRORβ CRVAL2 keyword in FITS header not a real numberERRORβ CDELT1 keyword in FITS header not a real numberERRORβ CDELT2 keyword in FITS header not a real numberERRORβ CROTA2 keyword in FITS header not a real numberERRORβ CD1_1 keyword in FITS header not a real numberERRORβ CD1_2 keyword in FITS header not a real numberERRORβ CD2_1 keyword in FITS header not a real numberERRORβ CD2_2 keyword in FITS header not a real numberERRORβ EQUINOX keyword in FITS header not a real numberERRORβ No WCS information (or not FITS header)ERRORβ Must have at least two dimensionsERRORβ Invalid projectionERRORβ Invalid NAXIS1ERRORβ Invalid NAXIS2ERRORβ CTYPE1 and CTYPE2 don't matchERRORβ Invalid CTYPE1ERRORβ Invalid CD matrixERRORβ Invalid CDELT1ERRORβ Invalid CDELT2ERRORβ 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).
π COPYRIGHT π
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 π β¨
π¦ where this page comes from
- debian bookworm: montage 6.0+dfsg-7+b8 Β· BSD-3-Clause
- debian trixie: montage 6.1+dfsg-1+b1 Β· BSD-3-Clause
- ubuntu jammy: montage 6.0+dfsg-7build5 Β· BSD-3-Clause
- ubuntu noble: montage 6.0+dfsg-9 Β· BSD-3-Clause
- ubuntu questing: montage 6.1+dfsg-2
- ubuntu resolute: montage 6.1+dfsg-2build2 Β· BSD-3-Clause
- ubuntu stonking: montage 6.1+dfsg-2build2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms