MBACKGROUND(1)
β¨ MBACKGROUND β remove a background plane from a FITS image, bestie β¨
okay so this is mBackground, part of the Montage toolset. She's giving "delete the background plane from your FITS image" and honestly? iconic. π
πΈ SYNOPSIS πΈ
mBackground [-d level] [-n(o-areas)] [-s statusfile] in.fits out.fits A
B C
mBackground [-t] [-d level] [-n(o-areas)] [-s statusfile] in.fits
out.fits images.tbl corrfile.tbl
Two whole moods, pick your fighter. π«Ά
π DESCRIPTION π
So what she does is remove a background plane from a FITS image. Periodt.
The background correction that gets applied to your image is written as Ax+By+C, where (x,y) is the pixel coordinate β and bestie, listen, the image center is the origin, not the corner. And (A,B,C)? Those are the background plane parameters, specified as linear coefficients. That's the whole vibe. π¦
β¨ OPTIONS β¨
-dlevel β turns on debugging up to the specified level. She's chatty, your call how chatty. π₯-nβ says that no area images are present (it assumes equal weighting for each data pixel). Lowkey the chill option.-sstatusfile βmBackground's output and errors get written to statusfile instead ofstdout. Fancy.-tβ run in table mode. This starts a whole group ofmBackgroundruns in parallel, reading off the same pair of tables to figure out which files and background corrections to work with. Recommended for running only on grids or parallel processors, no cap.
π ARGUMENTS π
- in.fits β input FITS file. The one you're fixing.
- out.fits β output FITS file. The glow-up result.
- A B C β corrections (as given by
mFitplaneormFitExec). Just three little numbers, three little numbers. π - images.tbl β when run as part of a
GRIDprocessing job,mBackgroundrequires the image metadata table to retrieve the filenames of images. - corrections.tbl β when run as part of a
GRIDprocessing job,mBackgroundrequires a table of corrections (frommFitplaneandmFitExec) to apply to the corresponding image (fromimages.tbl).
π RESULT π
Output FITS image with background subtraction applied. That's it. That's the prize. π
π MESSAGES π
Here's the whole group chat of things she might say to you. Not me listing every single one, but like... yes actually, every single one:
OKβ[struct stat = "OK"]ERRORβNo status file name givenERRORβCannot open status file: statusfileERRORβNo debug level givenERRORβDebug level string is invalid: stringERRORβDebug level value cannot be negativeERRORβInvalid input file filenameERRORβInvalid output file filenameERRORβA coefficient string is not a numberERRORβB coefficient string is not a numberERRORβC coefficient string is not a numberERRORβInvalid image metadata file: images.tblERRORβImage table needs columns cntr and fnameERRORβHit end of image table without finding file nameERRORβNeed columns: id,a,b,c in corrections fileERRORβHit end of corrections table without finding dataERRORβFITS library error messageERRORβgeneral error message
π EXAMPLES π
The following is sample output from mFitplane for a FITS image, in.fits:
[struct stat="OK", a=-0.000144415, b=-0.000133642, c=-31.8984,
crpix1=758.5, crpix2=-1032, xmin=-758.5, xmax=-349.5, ymin=1032,
ymax=1498, xcenter=-555.007, ycenter=1265.26, rms=0.576727]
Then we use the plane coefficients calculated by mFitplane to subtract the background from the image, like so:
$ mBackground projdir/in.fits bg_removed/in.fits -0.000144415
-0.000133642 -31.8984
[struct stat="OK"]
Obsessed. It just works. π§
π BUGS π
okay bestie, this is the part where we're real with each other:
- The drizzle algorithm has been implemented but has not been tested in this release. So like. It exists. We don't know her yet. π
- If a header template contains carriage returns (i.e., created/modified on a Windows machine), the
cfitsiolibrary will be unable to read it properly, resulting in the error:[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, 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
-lflag inmBgModel).
π 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, babe π this was Montage 5, dated Dec 2016, and it's the mBackground(1) manual β go subtract a plane, you absolute main character πβ¨
π¦ 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