MMAKEHDR(1)

πŸ’– MMAKEHDR β€” bestie edition πŸ’–

okay so real talk: this is the mMakeHdr page from the Montage manual, section 1 of the Unix manual pages, and it's literally the tool that builds your mosaic header. no cap. let's get into it 🫢


✨ NAME ✨

mMakeHdr β€” Create a FITS header template for use in mosaic creation 🌈


✨ SYNOPSIS ✨

MakeHdr [-d level] [-s statusfile] [-p(ixel-scale) cdelt] [-P maxpixel]
[-n] images.tbl template.hdr [system [equinox]]

(yes bestie, the synopsis says MakeHdr and the page is called mMakeHdr, that's just how it is, we don't question it πŸ’…)


✨ DESCRIPTION ✨

So here's the vibe: you hand it a list of images you wanna mosaic together, and mMakeHdr generates the FITS header that best describes the output image. iconic behaviour fr fr.

And if your input metadata describes a properly matched set of data cubes (three or four dimensions), the header will reflect that, and you can use it for cube mosaicking. obsessed. 🧊✨

Now, if the spatial coverage of the data is large enough that a TAN projection header is infeasible, an allsky (AITOFF) header gets created instead. But ⚠️ use that with caution, because it can easily be the result of metadata for images that shouldn't really be combined. it's giving "these are not the same sky, bestie" 😭


✨ OPTIONS ✨

  • -d level β€” turns on debugging to the specified level (1-3). detective mode πŸ”
  • -s statusfile β€” output and errors get written to statusfile instead of to stdout. quiet girl era 🀫
  • -p cdelt β€” specify a pixel scale for the header, if it's different from the input images. (the synopsis calls it -p(ixel-scale), yes really)
  • -P maxpixel β€” sanity check!! forces an upper limit on derived NAXIS1, NAXIS2, just in time. safety first πŸ›Ÿ
  • -n β€” the "North-aligned" flag. by default the FITS header generated represents the best fit to the images, which often results in a slight rotation. if you want north to be straight up in your final mosaic, you should use this flag. β¬†οΈβœ¨

✨ ARGUMENTS ✨

  • images.tbl β€” metadata table (generated by mImgtbl) describing the images to be mosaicked. πŸ“‹
  • template.hdr β€” path to the header template to be generated. this is the baby you're birthing πŸŽ€
  • system (optional) β€” specifies the system for the header (default is Equatorial). possible values are:
EQUJ EQUB ECLJ ECLB GAL SGAL
  • equinox (optional) β€” if a coordinate system is specified, the equinox can also be given in the form YYYY. default is J2000. πŸ“…

✨ RESULT ✨

Creation of output file template.hdr. that's it, that's the result πŸ’–


✨ MESSAGES ✨

the receipts, in order:

  • OK β€” [struct stat = "OK", count=nimages, ncube=ncubes, clon=ra, clat=dec, lonsize=crpix1, latsize=crpix2, posang=ang, lon1=ra1, lat1=dec1, lon2=ra2, lat2=dec2, lon3=ra3, lat3=dec3, lon4=ra4, lat4=dec4]
  • OK β€” messages about projection and number of axes>
  • ERROR β€” Memory allocation failure.
  • ERROR β€” Invalid pixel scale string: cdelt
  • ERROR β€” Cannot open status file: statusfile
  • ERROR β€” Invalid system string. Must be EQUJ|EQUB|ECLJ|ECLB|GAL|SGAL
  • ERROR β€” Equinox string is not a number
  • ERROR β€” Can't open output header file.
  • ERROR β€” Invalid image metadata file: filename
  • ERROR β€” Need columns: ctype1 ctype2 nl ns crval1 crval2 crpix1 crpix2 cdelt1 cdelt2 crota2 (equinox optional). Four corners (equatorial) will be used if they exist or even just a single set of coordinates
  • ERROR β€” Bad WCS for image n
  • ERROR β€” Error computing boundaries.
  • ERROR β€” Output wcsinit() failed.

✨ EXAMPLES ✨

watch her serve:

$ mMakeHdr 2mass-images.tbl orig.hdr
       [struct stat="OK", count=30]

✨ BUGS ✨

girl, read these. they are not decorative. πŸ’€
  • The drizzle algorithm has been implemented but has not been tested in this release. (implemented but not tested, the audacity 😭)
  • If a header template contains carriage returns (i.e., created/modified on a Windows machine), the cfitsio library will be unable to read it properly, resulting in the error: [struct stat="ERROR", status=207, msg="illegal character in keyword"]. windows line endings strike again πŸͺŸπŸ’€
  • 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). 🫢
  • Due to some numerical approximation, the "North Up" bounding box calculated when the -n switch is on can be skewed a fraction of a degree. a lil crooked, as a treat πŸŽ€

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, periodt πŸ’…

this was Montage version 5, dated Dec 2016, page MMAKEHDR(1) β€” go make some gorgeous mosaics, you've got this πŸ¦‹πŸŒΈπŸ’œ