MHDRTBL(1)
π mHdrtbl β bestie's guide to pulling metadata out of header files π
okay so real talk, mHdrtbl lives in the Montage family (manual section 1, if you're keeping score) and she's the header-template cousin of mImgtbl. Same energy, different input. Let's get into it π¦
β¨ SYNOPSIS β¨
mHdrtbl [-rcdb] [-s statusfile] [-t imglist] directory images.tbl
πΈ DESCRIPTION πΈ
So mHdrtbl operates in a fashion similar to mImgtbl, but here's the plot twist: she's used on a set of header template files instead of FITS images. That's it, that's the whole vibe. β¨
π OPTIONS π
-rβ lowkey one of the most useful ones.mHdrtblcan also be used as a standalone program to gather image metadata for other purposes (to populate a database, as a basis for spatial coverage searches, etc.). In this case it is often desirable to collect information on all the files in a directory tree recursively. The-r(recursive) flag instructsmHdrtblto search the given directory and all its subdirectories recursively. fr fr, it goes all the way down π«Ά-cβ the-c(corners) option will cause eight extra columns to be added to the output metadata table containing the RA, Dec coordinates (ra1,dec1, ...ra4,dec4) of the image corners. The output is always Equatorial J2000, even if the input is some other system. This has been done to make the metadata uniform so that it can easily be used for coverage searches, etc. Heads up bestie: the-coption is not needed for normal Montage processing. π-dβ Turn on debugging π-bβ When this switch is set,mHdrtblwill explicitly output each header file it finds that does not appear to be valid, along with information on the error. She's not gonna ghost the bad ones, she'll name them π-sstatusfileβ Output and errors are written to statusfile instead of being written to stdout. Quiet girl behavior π-timglistβmHdrtblwill only process files with names specified in table imglist, ignoring any other files in the directory. Example:example.imglist. Like a guest list but for files, and honestly? iconic.
π ARGUMENTS π
directoryβ Path to directory containing set of input header templates.images.tblβ Path of output metadata table.
β RESULT β
The output table contains metadata information from all readable header templates in the directory specified by directory. count is the number of records in the table, and badhdrs is the number of files for which FITS/WCS metadata could not be extracted. Not me counting the casualties π
π OUTPUT COLUMNS π
cntrβ A unique counter (row number)ra,decβ Image position in decimal degree formatcra,cdecβ Right ascension inHHMMSS.SSformat. Declination inDDMMSS.Sformatnaxis1,naxis2β The size of the image in pixels for dimensions 1 and 2ctype1,ctype2β The coordinate system (the first four characters) and WCS map projection (last three characters) for dimensions 1 and 2crpix1,crpix2β The pixel coordinates of the reference location (can be fractional and can be off the image) for dimensions 1 and 2crval1,crval2β The coordinates of a reference location on the sky (often at the center of the image) for dimensions 1 and 2cdelt1,cdelt2β The pixel scale (in degrees on the sky per pixel) at the reference location for dimensions 1 and 2crota2β The rotation angle from the "up" direction to the celestial poleequinoxβ Precessional year associated with the coordinate systemhduβ Numerical identifier for the FITS extension that the image info is extracted from, for FITS files with multiple HDUs.sizeβ Filesize (in bytes) of the input FITS filefnameβ The path to the input FITS file
π’ MESSAGES π’
the way she talks to you... here's everything she might say π
OK [struct stat="OK", count=count, badfits=badfits]
ERROR Illegal argument: -arg
ERROR Cannot open status file: statusfile
ERROR Cannot open field list file: fieldlistfile
ERROR Cannot open image list file: imgfile
ERROR Image table needs column fname/file
ERROR Illegal field name: string]
ERROR Illegal field type: string]
ERROR Cannot access directory
ERROR directory is not a directory
ERROR Can't open output table.
ERROR Can't open copy table.
ERROR Can't open tmp (in) table.
ERROR Can't open tmp (out) table.
ERROR Can't open final table.
ERROR FITS library error
π EXAMPLES π
The following example runs mHdrtbl on a directory containing header templates stripped from 14 2MASS images:
$ mHdrtbl input/2mass headers.tbl
[struct stat="OK", count=14, badfits=0]
Output: headers.tbl. periodt β¨
π BUGS π
The drizzle algorithm has been implemented but has not been tested in this release. (not me shipping untested code π)
If a header template contains carriage returns (i.e., created/modified on a Windows machine), thecfitsiolibrary will be unable to read it properly, resulting in the error:[struct stat="ERROR", status=207, msg="illegal character in keyword"]β yes Windows line endings will absolutely ruin your day, bestie π
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.
okay that's the whole thing, you're literally a header-metadata expert now π β¨ this was Montage 5, dated Dec 2016, and yeah that's the tea β go slay your coverage searches, bestie π¦π
π¦ 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