mDiff calculates a simple difference between a single pair of overlapping images. This is meant for use on reprojected images where the pixels already line up exactly. mDiff analyzes an image metadata table to determine a list of overlapping images. Each image is compared with every other image to determine all overlapping image pairs. A pair of images are deemed to overlap if any pixel around the perimeter of one image falls within the boundary of the other image.
mDiff [-d level] [-n(o-areas)] [-s statusfile] in1.fits in2.fits out.fits template.hdr


-d level
Turns on debugging to the specified level (1-4).
No-area-images flag. Creates difference image without requiring pixel area FITS image
-z factor
Scale second image by factor before subtracting.
-s statusfile
Output and errors are sent to statusfile instead of to stdout


First input FITS file. (Also needs area image in1_area.fits, or use -n flag)
Second input FITS file.(Also needs area image in2_area.fits, or use -n flag)
Difference FITS image to be generated.
FITS header template used to generate output image.
FITS image and area image representing the difference in the overlap region.


$ mDiff proj/in1.fits proj/in2.fits output/diff.fits template.hdr
[struct stat="OK"]

Return Codes:

  • [struct stat="OK"]
  • [struct stat="ERROR", msg="Usage: mDiff [-d level] [-n(o-areas)] [-s statusfile] in1.fits in2.fits out.fits hdr.template"]
  • [struct stat="ERROR", msg="Cannot open status file: statusfile"]
  • [struct stat="ERROR", msg="Images don't overlap"]
  • [struct stat="ERROR", msg="All pixels are blank"]
  • [struct stat="ERROR", msg="Template file not found"]
  • [struct stat="ERROR", status=n, msg="FITS library error"]
  • [struct stat="ERROR", msg="general error"]