MPAD(1)
π¦ MPAD(1) β aka mPad, bestie edition π¦
okay so first things first: this page is from the Montage manual set, and the star of the show is a lil tool called mPad π
(you'll see MPAD(1) floating around too β same girl, different outfit).
β¨ NAME β¨
mPad β and the official one-word description is... None. π
fr fr, that's it. that's the whole NAME section. the mystery is the brand.
β¨ SYNOPSIS β¨
mPad [-nowcs][-d level][-val NaN-value][-bar xmin xmax ymin ymax
histfile] in.fits out.fits left right top bottom
β¨ DESCRIPTION β¨
so every once in a while you want to pad the border of an image β like, give it some breathing room π«Ά. maybe you need space for annotation, maybe you're adding a color bar, maybe you just want it to look cute for the visual effect. whatever the reason, mPad does exactly that. and if a color bar is what you're after, it adds one too β wherever you tell it to, which might be out in the pad or might be sitting right on top of the image. your call, main character π
the pad around the edges gets filled with NULLS (these render the same as the minimum in the color table, except in mJPEG/mViewer π). but you can optionally have those NULLs translated to some other value using the -val argument. slay.
β¨ OPTIONS β¨
-nowcsβ if your image has WCS values chillin' in the header, those need to be adjusted to compensate for the padding. this flag is you telling the software "bestie, there are no WCS keywords in here, don't even try" π-d levelβ set the debugging level (default is none)-val NaN-valueβ the value you want NULL pixels converted to π-bar xmin xmaxβ [see below, the args spill down the page like a group chat]
ymin ymax
histfile
okay so adding a color bar as part of the image? it's a little trickier than it first seems. lowkey deceptive β¨
a color bar is a rectangular region of pixels whose data values are set so it gives the impression of the lookup-table used to render the image. to pull that off, we need the image histogram that mViewer (or whatever renderer you're running) would use when displaying the data.
the easiest way to do this is:
- use
mHistogramto generate the stretchl - use
mPadto add the pixel array (usually in a pad added around the outside of the image(; - use
mViewerwith the same pre-build histogram to render the image
β¨ ARGUMENTS β¨
in.fitsβ the original FITS image πΈout.fitsβ the padded FITS image πleft right top bottomβ how many pixels to pad on each of the four sides of the image. all four, in that order, no skipping π
β¨ RESULT β¨
if everything goes right, you get a brand-new image that's almost identical to the original β just padded around the edges, and possibly carrying an embedded color bar π. and when you send it over to mViewer, that tool can optionally add annotation to the bar. teamwork, periodt.
β¨ MESSAGES β¨
here's every message this thing can throw at you, verbatim, no cap:
ERROR No debug level givenERROR Debug level string is invalid: 'badstring'ERROR Debug level value cannot be negativeERROR Not enough information given to draw color barERROR Bar X min string is invalid: 'badstring'ERROR Bar X max string is invalid: 'badstring'ERROR Bar Y min string is invalid: 'badstring'ERROR Bar Y max string is invalid: 'badstring'ERROR Cannot open histogram file badfileERROR No value given for NaN conversionERROR NaN conversion value string is invalid: 'badstring'ERROR FITS library errorERROR general error message
β¨ EXAMPLES β¨
the moment you've been waiting for, bestie:
(mHistogram -file SDSS_r.fits -2s max gaussian-log -out SDSS_r.hist)
mPad -bar -100 -50 50 -50 SDSS_r.hist SDSS_r.fits sdss.fits 50
250 50 50 [struct stat="OK"]
ate. π₯
β¨ BUGS β¨
π¨ okay bestie, pay attention, this part is not a vibe:
the drizzle algorithm has been implemented but has not been tested in this release. π
if a header template contains carriage returns (i.e., it was created/modified on a Windows machine), the cfitsio library will be unable to read it properly, and you'll get this:
[struct stat="ERROR", status=207, msg="illegal character in keyword"]
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, then return to the originally desired header size for the final coaddition. the default background matching assumes there are no non-linear background variations in the individual images (and therefore in the overlap differences). if there's any uncertainty in this regard, it's safer to turn on the "level only" background matching β that's 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 β go pad something iconic β¨π
π¦ 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