mBgModel

Description:
mBgModel is a modelling/fitting program. It uses the image-to-image difference parameter table created by mFitExec to interactively determine a set of corrections to apply to each image in order to achieve a "best" global fit.
Syntax:
mBgModel [-i niter] [-l(evel-only)] [-d level] [-r refimg] [-s statusfile] images.tbl fits.tbl corrections.tbl

Switches:

-i -niter
Number of iterations (without switch, defaults to 5000). Can be between 1 and 32767.
-l
Calculate level adjustments only (ie, don't attempt to match the slopes)
-d level
Turns on debugging to the specified level (1-3).
-r refimg
Turns on additional debugging for the nth image in images.tbl.
-a
Use all the input differences (by default we exclude very small overlap areas).
-s statusfile
mBgModel output and errors are written to statusfile instead of to stdout.

Arguments:

images.tbl
Image metadata table generated by mImgtbl.
fits.tbl
Plane fitting table generated by mFitExec.
corrections.tbl
Output table of background corrections

Return Codes:

  • [struct stat="OK"]
  • [struct stat="ERROR", msg="Usage: mBgModel [-i niter] [-l(evel-only)] [-d level] [-r refimg] [-s statusfile] images.tbl fits.tbl corrections.tbl"]
  • [struct stat="ERROR", msg="Argument for -i (string) cannot be interpreted as an integer"]
  • [struct stat="ERROR", msg="Number of iterations too small (niter). This parameter is normally around 5000."]
  • [struct stat="ERROR", msg="Argument for -r (string) cannot be interpreted as an integer"]
  • [struct stat="ERROR", msg="Cannot open status file: statusfile"]
  • [struct stat="ERROR", msg="Failed to open output filename"]
  • [struct stat="ERROR", msg="Invalid image metadata file: filename"]
  • [struct stat="ERROR", msg="Need columns: cntr nl ns crpix1 crpix2 in image info file"] (columns missing from image metadata table)
  • [struct stat="ERROR", msg="malloc() failed (ImgInfo)"] (Memory error)
  • [struct stat="ERROR", msg="realloc() failed (ImgInfo)"] (Memory error)
  • [struct stat="ERROR", msg="Invalid background fit parameters file: filename"]
  • [struct stat="ERROR", msg="Need columns: plus minus a b c crpix1 crpix2 xmin xmax ymin ymax xcenter ycenter npixel rms boxx boxy boxwidth boxheight boxang"] (columns missing from background parameter table)
  • [struct stat="ERROR", msg="malloc() failed (FitInfo)"] (Memory error)
  • [struct stat="ERROR", msg="realloc() failed (FitInfo)"] (Memory error)
  • [struct stat="ERROR", msg="malloc() failed (CorrInfo)"] (Memory error)
  • [struct stat="ERROR", msg="realloc() failed (CorrInfo)"] (Memory error)
  • [struct stat="ERROR", msg="Debug reference image out of range (0 - n)"]
  • [struct stat="ERROR", msg="Invalid fit type"]
  • [struct stat="ERROR", msg="Allocation failure in ivector()"] (Memory error)
Results:
Output table containing corrections to be applied to each image.

Examples:

After running mDiffExec to create a set of difference images in diffdir, we generate an image difference table using mFitExec: sample fits.tbl.

$ mBgModel images.tbl fits.tbl corrections.tbl
[struct stat="OK"]

This results in the creation of corrections.tbl.