MFITPLANE(1)
π MFITPLANE π
okay so bestie, this is the mFitplane page from the Montage manual, section 1. it fits a plane to your image and honestly it's giving math girlie main character energy. let's get into it π¦
β¨ NAME β¨
mFitplane β use least squares to fit a plane to an image. yeah. that's the whole vibe. π
πΈ SYNOPSIS πΈ
mFitplane [-b border] [-d level] [-s statusfile] in.fits
like. that's it. one input file, a couple of optional flags, iconic behavior π
π§ DESCRIPTION π§
so what it does is it uses least squares to fit a plane to an image β and the glow-up here is that it excludes outlier pixels, so the messy pixels don't get to ruin the whole fit. periodt. π
where does it get used tho? it's meant for the difference images that you get out of mDiff or mDiffExec. that's the whole point. iykyk β¨
π OPTIONS π
-bborder β the number of border pixels to ignore at the edges of the image. edges stay messy, we don't want that energy π«-dlevel β turns on debugging at the level you give it, and that level is 1-3. debug girlies rise π-lβ level only mode!! don't fit a slope, just get a zero level. sometimes u just want the flat vibe, not the whole gradient situation π-sstatusfile β output and errors get written to statusfile instead of stdout. quiet mode, mysterious mode π
π ARGUMENTS π
- in.fits β the input FITS file, and it's a difference file between two other FITS files, the kind you'd generate with
mDiff. yes it has to be that kind. no cap π«Ά
β RESULT β
the plane it fits to the image looks like this, literally:
fit = A*x + B*y + C
and here's the tea on what x and y even are:
xis the "horizontal" pixel offset fromCRPIX1in the FITS headeryis the "vertical" pixel offset fromCRPIX2
and the reason this is such a slay is that every reprojected image uses the same reference pixel, so x and y mean the exact same thing across your whole image set. uniform definition. consistent. we love to see it π
the fitting itself is a simple least squares, with an iterative loop that kicks out any points more than 2 sigma away β where sigma is defined as the rms from the previous loop. so it just keeps refining. little loop, big results π
the rms output is that value we just described. the xmin, ... ymax outputs are the range of x,y values found while fitting. and listen: the rms is for information only, but the xmin, ... ymax are actually used in the background fitting (mBgModel). so they matter. crpix1 and crpix2 are the reference pixels for each axis, as determined from the FITS header. π
π¬ MESSAGES π¬
when it works you get this absolute masterpiece of a struct:
OK [struct stat="OK", a=A, b=B, c=C, crpix1=crpix1, crpix2=crpix2,
xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, xcenter=xcenter,
ycenter=ycenter, npixel=npixel, rms=rms, boxx=boxx, boxy=boxy,
boxwidth=boxwidth, boxheight=boxheight, boxang=boxang]
and when it doesn't, here's the lineup of errors π:
ERROR Argument to -b (string) cannot be interpreted as an integerERROR Cannot open status file: statusfileERROR Image file filename missing or invalid FITSERROR FITS library errorERROR general error
and the warnings, which are more like gentle side-eyes:
WARNING Too few pixels to fitWARNING Too few pixels for bounding boxWARNING Singular Matrix-1WARNING Singular Matrix-2WARNING allocation failure in ivector()
π EXAMPLES π
okay here's the real one, look at this:
$ mFitplane 2mass-atlas-990322n-j0640266.fits
[struct stat="OK", a=-8.9198e-11, b=-2.54173e-10, c=5.24277e-05,
crpix1=808, crpix2=212.5, xmin=-808, xmax=167, ymin=-210.5,
ymax=638.5, xcenter=-320.871, ycenter=213.014, npixel=314299,
rms=0.393003, boxx=-320.92, boxy=212.424, boxwidth=835.421,
boxheight=509.274, boxang=-29.5537]
look at that struct just sitting there. beautiful. no notes π
π BUGS π
okay so real talk, there are some things you need to know, and i'm telling you because i love you:
- the drizzle algorithm has been implemented but has not been tested in this release. so like. it exists. it is not verified. tread carefully bestie π
- if a header template contains carriage returns (aka it was created or modified on a Windows machine), the
cfitsiolibrary will not be able to read it properly, and you'll get this error:[struct stat="ERROR", status=207, msg="illegal character in keyword"]. windows strikes again π - and this one's important for the background correction algorithms: it is best 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. the recommendation is to use an expanded header for the reprojection and background modeling steps, then go back to the originally desired header size for the final coaddition. also, the default background matching assumes there are no non-linear background variations in the individual images (and therefore in the overlap differences). if you have any uncertainty about that, it's safer to turn on the "level only" background matching β that's the
-lflag inmBgModel. safety first, always π«Ά
π COPYRIGHT π
2001-2015 California Institute of Technology, Pasadena, California
and if your research uses Montage, please include this acknowledgement, fr fr:
"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."
also, 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, and you're reading MFITPLANE(1) πβ¨ go fit a plane, you absolute icon ππ¦
π¦ 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