.TH MBGMODEL 1 "Dec 2016" "Montage 5" "Montage" .SH NAME mBgModel \- Re-project and mosaic your images, with background rectification .SH SYNOPSIS mBgModel [\-i \fIniter\fP] [\-l(evel-only)] [\-d \fIlevel\fP] [\-r \fIrefimg\fP] [\-s \fIstatusfile\fP] images.tbl fits.tbl corrections.tbl .SH DESCRIPTION \fBmBgModel\fP is a modelling/fitting program. It uses the image-to-image difference parameter table created by \fBmFitExec to interactively determine a set of corrections to apply to each image in order to achieve a "best" global fit.\fP .SH OPTIONS .TP \-i \fI\-niter\fP Number of iterations (without switch, defaults to 5000). Can be between 1 and 32767. .TP \-l Calculate level adjustments only (ie, don't attempt to match the slopes) .TP \-d \fIlevel\fP Turns on debugging to the specified level (1\-3). .TP \-r \fIrefimg\fP Turns on additional debugging for the \fIn\fPth image in \fBimages.tbl\fP. .TP \-a Use all the input differences (by default we exclude very small overlap areas). .TP \-s \fIstatusfile\fP \fBmBgModel\fP output and errors are written to \fIstatusfile\fP instead of to stdout. .SH ARGUMENTS .TP images.tbl Image metadata table generated by \fBmImgtbl\fP. .TP fits.tbl Plane fitting table generated by \fBmFitExec\fP. .TP corrections.tbl Output table of background corrections .SH RESULT Output table containing corrections to be applied to each image. .SH MESSAGES .TP OK [struct stat="OK"] .TP ERROR Argument for \-i (\fIstring\fP) cannot be interpreted as an integer .TP ERROR Number of iterations too small (\fIniter\fP). This parameter is normally around 5000. .TP ERROR Argument for \-r (\fIstring\fP) cannot be interpreted as an integer .TP ERROR Cannot open status file: \fIstatusfile\fP .TP ERROR Failed to open output \fIfilename\fP .TP ERROR Invalid image metadata file: \fIfilename\fP .TP ERROR Need columns: cntr nl ns crpix1 crpix2 in image info file .TP ERROR malloc() failed (ImgInfo) .TP ERROR realloc() failed (ImgInfo) .TP ERROR Invalid background fit parameters file: \fIfilename\fP .TP ERROR Need columns: plus minus a b c crpix1 crpix2 xmin xmax ymin ymax xcenter ycenter npixel rms boxx boxy boxwidth boxheight boxang .TP ERROR malloc() failed (FitInfo) .TP ERROR realloc() failed (FitInfo) .TP ERROR malloc() failed (CorrInfo) .TP ERROR realloc() failed (CorrInfo) .TP ERROR Debug reference image out of range (0 \- \fIn\fP) .TP ERROR Invalid fit type .TP ERROR Allocation failure in ivector() .SH EXAMPLES .PP After running \fBmDiffExec\fP to create a set of difference images in \fBdiffdir\fP, we generate an image difference table using \fBmFitExec\fP: sample \fBfits.tbl\fP. .TP $ mBgModel images.tbl fits.tbl corrections.tbl [struct stat="OK"] .PP This results in the creation of \fBcorrections.tbl\fP. .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.