### Default ppStats recipe

# Options governing statistics
SAMPLE          F32     0.1     # Fraction of cell to sample
MASKVAL         STR     SAT,BAD # Mask value to use for statistics

# Define the outputs as MULTI
HEADER          MULTI
CONCEPT         MULTI
STAT            MULTI
SUMMARY         MULTI

# Add dummy values, to define the MULTI --- due to limitations in the MDC language
HEADER		STR	_UNDEF
CONCEPT		STR	_UNDEF
STAT		STR	_UNDEF
SUMMARY		STR	_UNDEF
ANALYSIS        STR     _UNDEF

# basic stats for output images
CHIPSTATS	METADATA
  STAT          MULTI
  STAT		STR	ROBUST_MEDIAN
  STAT          STR     ROBUST_STDEV   # Background statistics estimators

  HEADER        MULTI
  HEADER        STR     OVER_VAL
  HEADER        STR     FWHM_X # major axis FWHM (in pixels)
  HEADER        STR     FWHM_Y # minor axis FWHM (in pixels)
  HEADER        STR     APMIFIT
  HEADER        STR     DAPMIFIT
  HEADER        STR     CERROR
  HEADER        STR     NSTARS
  HEADER        STR     NASTRO

  ANALYSIS      MULTI   # metadata blocks to search in chip/cell/readout->analysis
  ANALYSIS      STR     PSPHOT.HEADER
  ANALYSIS      STR     PSASTRO.HEADER
END

# basic stats for residual images
RESIDUAL	METADATA
  STAT          MULTI
  STAT		STR	ROBUST_MEDIAN
  STAT          STR     ROBUST_STDEV   # Background statistics estimators
  STAT          STR     SAMPLE_SKEWNESS
  STAT          STR     SAMPLE_KURTOSIS
  HEADER        MULTI
  HEADER        STR     FRNG_00        # fringe amplitude, if measured
  HEADER        STR     FRNG_00D       # fringe error, if measured
  HEADER        STR     FRNG_01        # fringe amplitude, if measured
  HEADER        STR     FRNG_01D       # fringe error, if measured
  HEADER        STR     FRNG_02        # fringe amplitude, if measured
  HEADER        STR     FRNG_02D       # fringe error, if measured
END

### ppStats recipe for Phase 0
INJECT  METADATA
  CONCEPT       MULTI
END

### ppStats recipe for Phase 0
REGISTER  	METADATA
  CONCEPT       MULTI
  STAT          MULTI
  SUMMARY       MULTI

  CONCEPT       STR     FPA.OBJECT      # Object name
  CONCEPT       STR     FPA.OBSTYPE     # Observation type
  CONCEPT       STR     FPA.FILTER      # Filter
  CONCEPT       STR     FPA.RA FPA.DEC  # Telescope pointing
  CONCEPT       STR     FPA.AIRMASS     # Airmass
  CONCEPT       STR     FPA.ALT FPA.AZ  # Telescopy alt/az
  CONCEPT       STR     FPA.POSANGLE    # Rotator angle
  CONCEPT       STR     FPA.TIME        # Time of exposure
  CONCEPT       STR     FPA.TELESCOPE   # Telescope (eg, CFHT)
  CONCEPT       STR     FPA.INSTRUMENT  # Instrument (eg, CFH12K)
  CONCEPT       STR     CHIP.TEMP       # Detector temperature
  CONCEPT       STR     CELL.EXPOSURE   # Exposure time
  STAT          STR     ROBUST_MEDIAN   # Background estimator
  STAT          STR     ROBUST_STDEV    # Background standard deviation estimator
  SUMMARY	STR	SAT_PIXEL_NUM
  SUMMARY	STR	SAT_PIXEL_FRAC
END


# basic stats for warped images
WARPSTATS	METADATA
  STAT          MULTI
  STAT		STR	ROBUST_MEDIAN
  STAT          STR     ROBUST_STDEV   # Background statistics estimators
END
