### ppImage recipe configuration file

# List of tasks to perform
#NONLIN          BOOL    FALSE           # Non-linearity correction; not implemented
#OVERSCAN        BOOL    TRUE            # Overscan subtraction
#BIAS            BOOL    TRUE            # Bias subtraction
#DARK            BOOL    FALSE            # Dark subtraction
#SHUTTER         BOOL    FALSE           # Shutter correction
#FLAT            BOOL    TRUE            # Flat-field normalisation
#MASK            BOOL    FALSE           # Mask bad pixels
#MASK.VALUE      STR     SAT,BAD         # Mask pixels with these attributes
#FRINGE          BOOL    TRUE           # Fringe subtraction
#PHOTOM          BOOL    TRUE           # Source identification and photometry
#ASTROM.CHIP     BOOL    TRUE           # Astrometry per chip?
#ASTROM.MOSAIC   BOOL    FALSE           # Astrometry for mosaic?

# Inherit everything from the top-level recipe file, except for what's below.

PHOTCODE.RULE		STR	{DETECTOR}.{FILTER.ID}

FRINGE.FILTERS  MULTI
FRINGE.FILTERS	STR z
FRINGE.FILTERS	STR y

# apply the following constraints when selecting a detrend image
DETREND.CONSTRAINTS  METADATA
  BIAS METADATA
  END
  DARK METADATA
  END
  SHUTTER METADATA
  END	
  FLAT METADATA
    FILTER  STR FPA.FILTERID
#   VERSION STR RAW
  END
  FRINGE METADATA
    FILTER   STR FPA.FILTERID
#   AIRMASS  STR FPA.AIRMASS
#   TWILIGHT STR TWILIGHT:FPA.TIME
  END
END


# Overscan subtraction only
PPIMAGE_O         METADATA
  BASE.FITS       BOOL    TRUE            # Save base detrended image?
  CHIP.FITS       BOOL    FALSE           # Save chip-mosaic-ed image? 
  OVERSCAN        BOOL    TRUE            # 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
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
END

# Bias subtraction only
PPIMAGE_B         METADATA
  BASE.FITS       BOOL    TRUE            # Save base detrended image?
  CHIP.FITS       BOOL    FALSE           # Save chip-mosaic-ed image? 
  OVERSCAN        BOOL    FALSE           # Overscan subtraction
  BIAS            BOOL    TRUE            # 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
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
END

# Dark subtraction only
PPIMAGE_D         METADATA
  BASE.FITS       BOOL    TRUE            # Save base detrended image?
  CHIP.FITS       BOOL    FALSE           # Save chip-mosaic-ed image? 
  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
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
END

# Shutter correction only
PPIMAGE_S         METADATA
  BASE.FITS       BOOL    TRUE            # Save base detrended image?
  CHIP.FITS       BOOL    FALSE           # Save chip-mosaic-ed image? 
  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
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
END

# Flat-fielding only
PPIMAGE_F         METADATA
  BASE.FITS       BOOL    TRUE            # Save base detrended image?
  CHIP.FITS       BOOL    FALSE           # Save chip-mosaic-ed image? 
  OVERSCAN        BOOL    FALSE           # Overscan subtraction
  BIAS            BOOL    FALSE           # Bias subtraction
  DARK            BOOL    FALSE           # Dark subtraction
  SHUTTER         BOOL    FALSE           # Shutter correction
  FLAT            BOOL    TRUE           # Flat-field normalisation
  MASK            BOOL    FALSE           # Mask bad pixels
  FRINGE          BOOL    FALSE           # Fringe subtraction
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
END

# Fringe correction only
PPIMAGE_R         METADATA
  BASE.FITS       BOOL    TRUE            # Save base detrended image?
  CHIP.FITS       BOOL    FALSE           # Save chip-mosaic-ed image? 
  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    TRUE            # Fringe subtraction
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
END

# Photometry only
PPIMAGE_P         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
  PHOTOM          BOOL    TRUE           # Source identification and photometry
  BASE.FITS       BOOL    FALSE           # Save base detrended image?
  CHIP.FITS       BOOL    TRUE           # Save chip-mosaic-ed image? 
END

# Photometry & Astrometry
PPIMAGE_A         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
  PHOTOM          BOOL    TRUE           # Source identification and photometry
  ASTROM.CHIP     BOOL    TRUE           # Source identification and photometry
  BASE.FITS       BOOL    FALSE           # Save base detrended image?
  CHIP.FITS       BOOL    TRUE           # Save chip-mosaic-ed image? 
END

# Overscan, bias
PPIMAGE_OB        METADATA
  BASE.FITS       BOOL    TRUE            # Save base detrended image?
  CHIP.FITS       BOOL    FALSE           # Save chip-mosaic-ed image? 
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # 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
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
END

# Overscan, bias, dark
PPIMAGE_OBD      METADATA
  BASE.FITS       BOOL    TRUE            # Save base detrended image?
  CHIP.FITS       BOOL    FALSE           # Save chip-mosaic-ed image? 
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # 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
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
END

# Overscan, bias, dark, shutter
PPIMAGE_OBDS      METADATA
  BASE.FITS       BOOL    TRUE            # Save base detrended image?
  CHIP.FITS       BOOL    FALSE           # Save chip-mosaic-ed image? 
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # 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
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
END

# Overscan, bias, dark, shutter, flat-field
PPIMAGE_OBDSF     METADATA
  BASE.FITS       BOOL    TRUE            # Save base detrended image?
  CHIP.FITS       BOOL    FALSE           # Save chip-mosaic-ed image? 
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # Bias subtraction
  DARK            BOOL    FALSE            # Dark subtraction
  SHUTTER         BOOL    FALSE            # Shutter correction
  FLAT            BOOL    TRUE            # Flat-field normalisation
  MASK            BOOL    FALSE            # Mask bad pixels
  FRINGE          BOOL    FALSE           # Fringe subtraction
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
END

# Overscan, bias, dark, shutter, flat-field, fringe
PPIMAGE_OBDSFR    METADATA
  BASE.FITS       BOOL    TRUE            # Save base detrended image?
  CHIP.FITS       BOOL    FALSE           # Save chip-mosaic-ed image? 
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # Bias subtraction
  DARK            BOOL    FALSE            # Dark subtraction
  SHUTTER         BOOL    FALSE            # Shutter correction
  FLAT            BOOL    TRUE            # Flat-field normalisation
  MASK            BOOL    FALSE            # Mask bad pixels
  FRINGE          BOOL    TRUE            # Fringe subtraction
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
END

# Overscan, bias, dark, shutter, flat-field, fringe, photom
PPIMAGE_OBDSFRP   METADATA
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # Bias subtraction
  DARK            BOOL    FALSE            # Dark subtraction
  SHUTTER         BOOL    FALSE            # Shutter correction
  FLAT            BOOL    TRUE            # Flat-field normalisation
  MASK            BOOL    FALSE            # Mask bad pixels
  FRINGE          BOOL    TRUE            # Fringe subtraction
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
  PHOTOM          BOOL    TRUE           # Source identification and photometry
  ASTROM.CHIP     BOOL    FALSE           # Astrometry per chip?
  ASTROM.MOSAIC   BOOL    FALSE           # Astrometry for mosaic?
  BASE.FITS       BOOL    FALSE           # Save base detrended image?
  CHIP.FITS       BOOL    TRUE            # Save chip-mosaic-ed image? 
END

# Overscan, bias, dark, shutter, flat-field, fringe, photom, astrom
PPIMAGE_OBDSFRA   METADATA
  OVERSCAN        BOOL    TRUE            # Overscan subtraction
  BIAS            BOOL    TRUE            # 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    TRUE            # Fringe subtraction
  BIN1.FITS       BOOL    TRUE            # Save 1st binned chip image?
  BIN2.FITS       BOOL    TRUE            # Save 2nd binned chip image?
  PHOTOM          BOOL    TRUE            # Source identification and photometry
  ASTROM.CHIP     BOOL    TRUE           # Astrometry per chip?
  ASTROM.MOSAIC   BOOL    FALSE           # Astrometry for mosaic?
  BASE.FITS       BOOL    FALSE           # Save base detrended image?
  CHIP.FITS       BOOL    TRUE           # Save chip-mosaic-ed image? 
END
