### ppImage recipe configuration file for CTIO MOSAIC2

# List of tasks to perform
SHUTTER         BOOL    FALSE           # Shutter correction
DARK		BOOL	TRUE		# Dark correction

BASE.FITS       BOOL    TRUE            # Save base detrended image?
CHIP.FITS       BOOL    TRUE            # Save base detrended image?
BIN1.FITS	BOOL    TRUE            # Save 1st binned chip image?
BIN2.FITS	BOOL    TRUE		# Save 2nd binned chip image?

# binned output image options
BIN1.XBIN               S32     8
BIN1.YBIN               S32     8
BIN2.XBIN               S32     64
BIN2.YBIN               S32     64

# Overscan subtraction
OVERSCAN.SINGLE		BOOL	FALSE		# Reduce overscan to a single value?
OVERSCAN.FIT		STR	POLYNOMIAL	# NONE | POLYNOMIAL | SPLINE
OVERSCAN.ORDER		S32	3		# Order of polynomial fit
OVERSCAN.STAT		STR	MEAN		# MEAN | MEDIAN

DETREND.CONSTRAINTS  METADATA
  BIAS METADATA
  END
  DARK METADATA
#   EXPTIME STR FPA.EXPOSURE
  END
  FLAT METADATA
    FILTER  STR FPA.FILTERID
#   DETTYPE STR DOMEFLAT.RAW
#   VERSION STR SKYFLAT.RAW
#   VERSION STR DOMEFLAT.CORR.XX
#   VERSION STR SKYFLAT.CORR
  END
  FLAT_CORRECTION METADATA
    FILTER   STR FPA.FILTER
  END
  FRINGE METADATA
    FILTER   STR FPA.FILTER
#   AIRMASS  STR FPA.AIRMASS
#   TWILIGHT STR FPA.TWILIGHT
  END
  SHUTTER METADATA
  END
  MASK METADATA
  END	
END

####################################################################################
# Need the following in order to turn off options from the site-level recipes...
#
#  ESSENCE data does not need a fringe or a shutter correction.
####################################################################################

# Dark subtraction only
PPIMAGE_D         METADATA
  OVERSCAN        BOOL    FALSE           # Overscan subtraction
  BIAS            BOOL    FALSE           # Bias subtraction
  DARK            BOOL    TRUE            # Dark subtraction
  SHUTTER         BOOL    FALSE           # Shutter correction
  FLAT            BOOL    FALSE           # Flat-field normalisation
  MASK            BOOL    FALSE           #  Mask bad pixels
  FRINGE          BOOL    FALSE           # Fringe subtraction
END

# Shutter correction only
PPIMAGE_S         METADATA
  OVERSCAN        BOOL    FALSE           # Overscan subtraction
  BIAS            BOOL    FALSE           # Bias subtraction
  DARK            BOOL    FALSE           # Dark subtraction
  SHUTTER         BOOL    FALSE           # Shutter correction
  FLAT            BOOL    FALSE           # Flat-field normalisation
  MASK            BOOL    FALSE           #  Mask bad pixels
  FRINGE          BOOL    FALSE           # Fringe subtraction
END

# Overscan, bias, dark
PPIMAGE_OBD      METADATA
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # Bias subtraction
  DARK            BOOL    TRUE            # Dark subtraction
  SHUTTER         BOOL    FALSE           # Shutter correction
  FLAT            BOOL    FALSE           # Flat-field normalisation
  MASK            BOOL    FALSE           #  Mask bad pixels
  FRINGE          BOOL    FALSE           # Fringe subtraction
END

# Overscan, bias, dark, shutter
PPIMAGE_OBDS      METADATA
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # Bias subtraction
  DARK            BOOL    TRUE            # Dark subtraction
  SHUTTER         BOOL    FALSE           # Shutter correction
  FLAT            BOOL    FALSE           # Flat-field normalisation
  MASK            BOOL    FALSE           #  Mask bad pixels
  FRINGE          BOOL    FALSE           # Fringe subtraction
END

# Overscan, bias, dark, shutter, flat-field
PPIMAGE_OBDSF     METADATA
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # Bias subtraction
  DARK            BOOL    TRUE            # Dark subtraction
  SHUTTER         BOOL    FALSE           # Shutter correction
  FLAT            BOOL    TRUE            # Flat-field normalisation
  MASK            BOOL    FALSE           #  Mask bad pixels
  FRINGE          BOOL    FALSE           # Fringe subtraction
END

# Overscan, bias, dark, shutter, flat-field, fringe
PPIMAGE_OBDSFR    METADATA
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # Bias subtraction
  DARK            BOOL    TRUE            # Dark subtraction
  SHUTTER         BOOL    FALSE           # Shutter correction
  FLAT            BOOL    TRUE            # Flat-field normalisation
  MASK            BOOL    FALSE           # Mask bad pixels
  FRINGE          BOOL    FALSE           # Fringe subtraction
END


# Overscan, bias, dark, shutter, flat-field, fringe, photometry
PPIMAGE_OBDSFRP   METADATA
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # Bias subtraction
  DARK            BOOL    TRUE            # Dark subtraction
  SHUTTER         BOOL    FALSE           # Shutter correction
  FLAT            BOOL    TRUE            # Flat-field normalisation
  MASK            BOOL    TRUE            # Mask bad pixels
  FRINGE          BOOL    FALSE           # Fringe subtraction
  PHOTOM          BOOL    TRUE            # Source identification and photometry
  ASTROM.CHIP     BOOL    FALSE           # Astrometry per chip?
  ASTROM.MOSAIC   BOOL    FALSE           # Astrometry for mosaic?
END

# Overscan, bias, dark, shutter, flat-field, fringe, photometry & astrometry
PPIMAGE_OBDSFRA   METADATA
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # Bias subtraction
  DARK            BOOL    TRUE            # Dark subtraction
  SHUTTER         BOOL    FALSE           # Shutter correction
  FLAT            BOOL    TRUE            # Flat-field normalisation
  MASK            BOOL    TRUE            # Mask bad pixels
  FRINGE          BOOL    FALSE           # Fringe subtraction
  PHOTOM          BOOL    TRUE            # Source identification and photometry
  ASTROM.CHIP     BOOL    FALSE           # Astrometry per chip?
  ASTROM.MOSAIC   BOOL    TRUE            # Astrometry for mosaic?
END
