.TH MBACKGROUND 1 "Dec 2016" "Montage 5" "Montage" .SH NAME mBackground \- Remove a background plane from a FITS image .SH SYNOPSIS mBackground [\-d \fIlevel\fP] [\-n(o-areas)] [\-s \fIstatusfile\fP] in.fits out.fits A B C .PP mBackground [\-t] [\-d level] [\-n(o-areas)] [\-s \fIstatusfile\fP] in.fits out.fits images.tbl corrfile.tbl .SH DESCRIPTION Remove a background plane from a FITS image. The background correction applied to the image is specified as Ax+By+C, where (x,y) is the pixel coordinate using the image center as the origin, and (A,B,C) are the background plane parameters specified as linear coefficients. .SH OPTIONS .TP \-d \fIlevel\fP Turns on debugging to the specified level. .TP \-n Indicates that no area images are present (assumes equal weighting for each data pixel) .TP \-s \fIstatusfile\fP mBackground output and errors will be written to \fIstatusfile\fP instead of stdout. .TP \-t Run in table mode. Starts a group of mBackground runs in parallel, reading off the same pair of tables to determine which files and background corrections to work with. Recommended for running only on grids or parallel processors. .SH ARGUMENTS .TP in.fits Input FITS file .TP out.fits Output FITS file .TP A B C Corrections (as given by mFitplane or mFitExec) .TP images.tbl When run as part of a GRID processing job, mBackground requires the image metadata table to retrieve the filenames of images. .TP corrections.tbl When run as part of a GRID processing job, mBackground requires a table of corrections (from mFitplane and mFitExec) to apply to the corresponding image (from images.tbl). .SH RESULT Output FITS image with background subtraction applied. .SH MESSAGES .TP OK [struct stat = "OK"] .TP ERROR No status file name given .TP ERROR Cannot open status file: \fIstatusfile\fP .TP ERROR No debug level given .TP ERROR Debug level string is invalid: \fIstring\fP .TP ERROR Debug level value cannot be negative .TP ERROR Invalid input file \fIfilename\fP .TP ERROR Invalid output file \fIfilename\fP .TP ERROR A coefficient string is not a number .TP ERROR B coefficient string is not a number .TP ERROR C coefficient string is not a number .TP ERROR Invalid image metadata file: \fIimages.tbl\fP .TP ERROR Image table needs columns cntr and fname .TP ERROR Hit end of image table without finding file name .TP ERROR Need columns: id,a,b,c in corrections file .TP ERROR Hit end of corrections table without finding data .TP ERROR \fIFITS library error message\fP .TP ERROR \fIgeneral error message\fP .SH EXAMPLES .PP The following is sample output from \fBmFitplane\fP for a FITS image, \fBin.fits\fP: [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] .PP We use the plane coefficients calculated by \fBmFitplane\fP to subtract the background from the image: .TP $ mBackground projdir/in.fits bg_removed/in.fits \-0.000144415 \-0.000133642 \-31.8984 [struct stat="OK"] .SH BUGS The drizzle algorithm has been implemented but has not been tested in this release. .PP 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"] .PP 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. .SH COPYRIGHT 2001-2015 California Institute of Technology, Pasadena, California .PP 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." .PP The Montage distribution includes an adaptation of the MOPEX algorithm developed at the Spitzer Science Center.