MPUTHDR(1)
β¨ mPutHdr β bestie, we're swapping a FITS header β¨
okay so real talk, this is mPutHdr from the Montage suite, section 1 of the manual, and it does exactly one thing and does it iconically: it takes a FITS image, rips out its header, and slides in a header you wrote yourself from an ASCII template. glow-up, but for metadata. π
πΈ NAME πΈ
mPutHdr β replace a FITS image's header with one from an ASCII header template.
π¦ SYNOPSIS π¦
mPutHdr [-d level] [-s statusfile] [-h hdu] in.fits out.fits
hdr.template
π DESCRIPTION π
It replaces the header of the input file with one supplied by the user. that's it. that's the whole vibe. your data stays, the header gets a makeover. π
β¨ OPTIONS β¨
-dβ turns on debugging, up to the level you name. and bestie, heads up: this version only supports level"1". so don't get cute with it.-sstatusfileβ sends output and errors tostatusfileinstead of tostdout. quiet girl era.-hhduβ write to the specified FITS extension (HDU).
π ARGUMENTS π
in.fitsβ the input FITS file.out.fitsβ path to the output FITS file (the one that gets the new header).hdr.templateβ the ASCII header template to write intoout.fits.
π RESULT π
[struct stat="OK"]
It creates the FITS file out.fits, which contains the same data as in.fits, but has the contents of template.hdr as its header in the specified extension (default 0, a.k.a. the primary extension). and numlines? that's the number of FITS header lines found in the input header template. slay. π
π MESSAGES π
OKβ[struct stat="OK"]β¨ERRORβCannot open status file: statusfileERRORβHDU value (hdu) must be a non-negative integerERRORβNot enough memory for output data image array.ERRORβInput wcsinit() failed.ERRORβFITS library error
π«Ά EXAMPLES π«Ά
So here's the workflow, bestie: you run mGetHdr to write the contents of a FITS header out to a file, then you edit that file to make corrections (remove extraneous lines, add HISTORY lines, etc). and then, to write a file with the fixed header:
$ mPutHdr acs.fits acs_out.fits acs_fixed.hdr
[struct stat="OK"]
ate. no crumbs. π₯
π BUGS π
The drizzle algorithm has been implemented but has not been tested in this release. so likeβ¦ it's there, it's just unverified. tread lightly. π
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"]. so if your template did a little trip through Windows, that's why it's screaming. π
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). fr fr, don't skip this part. π§
π 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 β go forth and give your FITS files the header they deserve. periodt. πβ¨
π¦ 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