### Default ppStats recipe

# Options governing statistics
SAMPLE          F32     0.1     # Fraction of cell to sample

# Mask value to use for statistics.  this is only used for stand-alone
# operations.  ppStats library calls pass a mask value as needed
MASKVAL         STR     SAT,BAD 


# 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     DT_DET   # elapsed time in detrend processing
  HEADER        STR     DT_PHOT  # elapsed time in photometry processing
  HEADER        STR     DT_ASTR  # elapsed time in astrometry processing
  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 injection
INJECT  METADATA
  CONCEPT       MULTI
END

### ppStats recipe for registration
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.COMMENT     # Obs Comment

  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.CAMERA      # Instrument (eg, CFH12K)
  CONCEPT       STR     CHIP.TEMP       # Detector temperature
  CONCEPT       STR     CELL.EXPOSURE   # Exposure time

  CONCEPT       STR     FPA.M1X         # Primary x position
  CONCEPT       STR	FPA.M1Y         # Primary y position
  CONCEPT       STR	FPA.M1Z         # Primary z position
  CONCEPT       STR	FPA.M1TIP       # Primary tip
  CONCEPT       STR	FPA.M1TILT      # Primary tilt
  CONCEPT       STR	FPA.M2X         # Secondary x position
  CONCEPT       STR	FPA.M2Y         # Secondary y position
  CONCEPT       STR	FPA.M2Z         # Secondary z position
  CONCEPT       STR	FPA.M2TIP       # Secondary tip position
  CONCEPT       STR	FPA.M2TILT      # Secondary tilt position
  CONCEPT       STR	FPA.ENV.TEMP    # external temperature
  CONCEPT       STR	FPA.ENV.HUMID   # external humidity
  CONCEPT       STR	FPA.ENV.WIND    # external wind speed
  CONCEPT       STR	FPA.ENV.DIR     # external wind direction

  CONCEPT       STR     FPA.TELTEMP.M1     # Primary mirror temps (C) 
  CONCEPT       STR     FPA.TELTEMP.M1CELL # Primary mirror support temps (C)   
  CONCEPT       STR     FPA.TELTEMP.M2     # Secondary mirror temps (C
  CONCEPT       STR     FPA.TELTEMP.SPIDER # Spider temperatures (C)  
  CONCEPT       STR     FPA.TELTEMP.TRUSS  # Mid truss temperatures (C
  CONCEPT       STR     FPA.TELTEMP.EXTRA  # Miscellaneous temperatures (C)     

  CONCEPT       STR	FPA.PON.TIME    # time since last power on

  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
  HEADER        MULTI
  CONCEPT       MULTI
  STAT          MULTI
  SUMMARY       MULTI

  STAT		STR	ROBUST_MEDIAN
  STAT          STR     ROBUST_STDEV    # Background statistics estimators
  SUMMARY       STR     GOOD_PIXEL_NUM  # Number of good pixels
  SUMMARY       STR     GOOD_PIXEL_FRAC # Fraction of good pixels
END
