Type a program name to get its usage (or see below)

cubemean       - calculate the robust mean plane of an image stack
dilate         - dilate an object mask by a multiplicative expansion factor
dithercubemean - register dither frames and calculate mean plane
lindarkflat    - do non-linearity correction, dark subtraction and
                 flatfield correction
linflat        - do non-linearity correction and flatfield correction
darkflat       - do dark subtraction and flatfield correction
flat           - do flatfield correction
gainmap        - normalize a flatfield to make a gainmap; set bad pixels to 0
makemask.pl    - create object masks from FITS images
offsets        - use cross correlation to find offsets between images
skyfilter      - do running sky frame subtraction
nlinmap        - compute non-linearity coefficients

----

cubemean - calculate the robust mean plane of an image stack

usage: cubemean listfn outfn outwfn scale|offset mean|median|sigma
                noweight|scalarweight|mapweight short|float [gainfn]

where listfn - contains a list of FITS images to coadd
      outfn  - filename for output coadded FITS image
      outwfn - filename for output coadded FITS weight image
      scale  - image normalize by multiplicative scale or zero offset
      mean   - calculate mean, median, or stddev image plane
      noweig - use no weights, a weight per image plane, or full map weights
      short  - output image type is either short int or floating point
      gainfn - filename of FITS image gainmap (normalized flatfield)

example: cubemean filelist coadd.fits weight.fits offset mean mapweight 
                    short gain.fits

note: gainfn is required for mapweight option, noweight is required for
      median or sigma plane calculation

----

darkflat - do dark subtraction and flatfield correction

usage: darkflat listfn darkfn gainfn

where listfn - list of FITS images to flatten and output names:
               input_FITS_filename output_FITS_filename
      darkfn - filename of FITS dark image
      gainfn - filename of FITS gainmap (normalized flat field)

example: darkflat filelist dark.fits gain.fits

----

dilate - dilate an object mask by a multiplicative expansion factor

usage: dilate objmaskfn [scale] 

where objmaskfn - filename of FITS object mask (SExtractor OBJECTS image)
      scale     - mult. scale factor to expand object regions, the default 
                  is 0.5 (ie, make 50% larger)

example: dilate mask.fits

----

dithercubemean - register dither frames and calculate mean plane

usage: dithercubemean listfn gainfn outfn outwfn

where listfn - contains list of: FITS_filename dither_x_offset dither_y_offset
      gainfn - filename of FITS gainmap (normalized flat field)
      outfn  - filename for output coadded FITS image
      outwfn - filename for output coadded FITS weight image

example: dithercubemean filelist gain.fits coadd.fits weight.fits

----

lindarkflat - do non-linearity, dark and flatfield correction

usage: lindarkflat listfn a1 a2 darkfn gainfn

where listfn    - list of FITS images to flatten and output names:
                  input_FITS_filename output_FITS_filename
      a1        - first non-linearity correction coefficient
      a2        - second non-linearity correction coefficient
      darkfn    - filename of FITS dark image
      gainfn    - filename of FITS gainmap (normalized flat field)

----

flat - do flatfield correction

usage: flat listfn gainfn

where listfn - list of FITS images to flatfield
      gainfn - filename of FITS gainmap (normalized flat field)

example: flat filelist gain.fits

----

gainmap - normalize a flatfield to make a gainmap and set bad pixels to 0

usage: gainmap flatfn gainfn [nsig nxblock nyblock mingain maxgain]

where flatfn  - filename of input flatfield FITS image
      gainfn  - filename of output gainmap FITS image
      nsig    - # of stddev from local bkg to be bad pixel (default 5.0)
      nxblock - local bkg calc. in blocks of nxblock pixels across (def. 16)
      nyblock - local bkg calc. in blocks of nyblock pixels down (def. 16)
      mingain - pixels with gain < mingain are considered bad (def. 0.7)
      maxgain - pixels with gain > maxgain are considered bad (def. 1.3)

example: gainmap flat.fits gain.fits

----

makemask.pl - create object masks from FITS images

usage: makemask.pl detect_minarea detect_thresh *.fits

where minarea - SExtractor DETECT_MINAREA parameter
      thresh  - SExtractor DETECT_THRESH parameter
      *.fits  - FITS data images (sky subtracted)

note: calls SExtractor with -FITS_UNSIGNED Y option

----

offsets - use cross correlation to find translation offsets between images

usage: offsets listfn [search_hwidth_arcsec]

where listfn - list of SExtractor OBJECTS images for images in a dither set
      search - half-width of cross-correlation search box in arcsec (def. 10)

example: offsets filelist 5.0

note: need search hwidth > relative error in the header RA,DEC keywords
      image scale (arcsec/pix) read from SCALE, SECPIX, CDELT, or CDELT1 key
      offsets.c assumes that North is up and East is left

----

skyfilter - do running sky frame subtraction

usage: skyfilter listfn gainfn hwidth mask|nomask row|col|rowcol|colrow|none

where listfn - if object masking is used then each line of listfn contains:
               image_filename objmask_filename dither_x_offset dither_y_offset
               where objmask is the master object mask per dither set and the
               dither offsets are given in pixels.  eg:
               img1set1.fits set1objmask.fits   0.0   0.0
               img2set1.fits set1objmask.fits -24.5  29.4
               img3set1.fits set1objmask.fits -34.0 -19.3
               img1set2.fits set2objmask.fits   0.0   0.0
               img2set2.fits set2objmask.fits  14.0 -29.2
               if masking is not used then each line of listfn should contain:
               image_filename
      gainfn - filename of FITS gainmap (normalized flat field)
      hwidth - half width of sky filter in frames
      mask   - either "mask" for object masking or "nomask"
      row|co - destriping correction with the following possibilities:
               "row" for row offsets, 
               "col" for column offsets,
               "rowcol" for row offsets then column offsets,
               "colrow" for column offsets then row offsets,
               "none" for no correction

example: skyfilter filelist gain.fits 4 mask rowcol

----

nlinmap - compute non-linearity coefficients

usage: nlinmap listfn satlim refexptime outdatfn nlincoeffn
where   listfn - contains list of FITS images 
        satlim - saturation limit in ADU
        refexptime - exptime used as reference
        outdatfn - filename of out data file, contains (fm, feOfm)
        lincoeffn - filename where coeffs will be added

example: nlinmap filelist 40000 4.0 feOfm.c1.dat nlincoeff.dat