### Recipe values for ppSim, the Pan-STARRS data simulator

## XXX need to consider this better: used to run / skip fake, should be a function of chip (and context?)
SKIP.FAKE       BOOL    TRUE

IMAGE.TYPE      STR     BIAS            # default image type

BIAS            BOOL    TRUE
BIAS.LEVEL	F32	1000.0		# Bias level (e)
BIAS.RANGE	F32	20.0		# Range of bias values (e)
BIAS.ORDER	S32	7		# Order for overscan polynomial

DARK            BOOL    TRUE
DARK.RATE	F32	5.0		# Dark current (e/s)

FLAT            BOOL    TRUE
FLAT.SIGMA	F32	3.0		# Flat gaussian width (FPA sizes)
FLAT.RATE	F32	2000.0		# Flat illumination rate (e/s)

SHUTTER.TIME	F32	1.0		# Time for shutter to fully open
SCATTER.FRAC    F32     0.0

SKY		BOOL	TRUE		# Sky illumination rate (e/s)
SKY.RATE	F32	20.0		# Sky illumination rate (e/s)

PHOTOM          BOOL    FALSE           # perform photometry on the faked stars?

FORCED.PHOT     BOOL    FALSE           # measure forced photometry for specific points?
FORCED.CATDIR   STR     NONE            # source of the forced photometry positions
FORCED.PHOTCODE STR     r               # source of the forced photometry positions

STARS.REAL	BOOL	TRUE		# Add stars from a catalogue?
MATCH.DENSITY   BOOL    TRUE            # significance of faintest sources

STARS.FAKE      BOOL    TRUE		# Add fake stars, randomly distributed?
STARS.LUM	F32	0.6		# Stellar luminosity function slope (magnitude slope)
STARS.MAG	F32	15.5		# Brightest magnitude for fake stars
STARS.DENSITY	F32     50.0		# Stellar density (per square degree) at the brightest magnitude
STARS.SIGMA.LIM F32      5.0            # significance of faintest sources

STARS.FLAT.LUM  BOOL    FALSE           # use a (non-physical) constant number of stars per mag bin?
STARS.FLAT.NUM  S32     5000            # number of stars to generate for flat magnitude distribution
PSF.MODEL       STR     PS_MODEL_QGAUSS

GALAXY.FAKE     BOOL    FALSE		# Generate fake galaxies?

GALAXY.LUM	  F32	-0.8		# Stellar luminosity function slope
GALAXY.MAG	  F32	11.0		# Brightest magnitude for fake stars
GALAXY.DENSITY	  F32	6.0		# Galaxy density (per square degree) at the brightest magnitude

GALAXY.RMAJOR.MIN F32	2.0		# Minimum semi-major axis for galaxy models
GALAXY.RMAJOR.MAX F32	10.0		# Maximum semi-major axis for galaxy models

GALAXY.ARATIO.MIN F32	1.0		# Minimum axis ratio for galaxy models
GALAXY.ARATIO.MAX F32	0.2		# Maximum axis ratio for galaxy models

GALAXY.INDEX.MIN F32    0.25		# Minimum Sersic index for galaxy models
GALAXY.INDEX.MAX F32	0.500           # Maximum Sersic index for galaxy models

GALAXY.THETA.MIN F32    0.0		# Minimum position angle for galaxy models
GALAXY.THETA.MAX F32	3.14            # Maximum position angle for galaxy models

GALAXY.GRID      BOOL   FALSE		# Generate a (regular) grid of galaxy models?
GALAXY.GRID.DX   S32    200             # Spacing between galaxies in grid in x
GALAXY.GRID.DY   S32    200             # Spacing between galaxies in grid in y

GALAXY.MODEL     STR    PS_MODEL_SERSIC

GALAXY.MODEL     STR    PS_MODEL_SERSIC

BADPIX.SEED	U64	123456789	# Seed for RNG in creating deterministic bad pixels
BADPIX.FRAC	F32	0.0001		# Fraction of bad pixels

### The following options are used if not defined by the concepts (e.g., usually read from headers)
GAIN		F32	1.0		# Default gain (e/ADU)
READNOISE	F32	10.0		# Default read noise (e)
OVERSCAN.SIZE	S32	32		# Default overscan columns
SATURATION	F32	65535		# Default saturation level (ADU)

PIXEL.SCALE     F32     0.26            # pixel size in arcsec

# filter-dependent parameters
ZEROPTS MULTI

ZEROPTS  METADATA
  FILTER    STR  g
  ZERO_PT   F32  24.0
END
ZEROPTS  METADATA
  FILTER    STR  r
  ZERO_PT   F32  25.15
END
ZEROPTS  METADATA
  FILTER    STR  i
  ZERO_PT   F32  25.00
END
ZEROPTS  METADATA
  FILTER    STR  z
  ZERO_PT   F32  24.50
END
ZEROPTS  METADATA
  FILTER    STR  y
  ZERO_PT   F32  24.00
END

# the following values are not set by default, but supplied if needed from arguments
EXPTIME     F32     NAN                 # exposure time (seconds)
RA          F32     NAN                 # exposure time (seconds)
DEC         F32     NAN                 # exposure time (seconds)
PA          F32     NAN                 # exposure time (seconds)
SEEING      F32     NAN                 # exposure time (seconds)
SCALE       F32     NAN                 # exposure time (seconds)
ZEROPOINT   F32     NAN                 # exposure time (seconds)
SKY.MAGS    F32     NAN                 # exposure time (seconds)

FILTER      STR     NONE                # exposure time (seconds)
BINNING     S32     1                   # exposure time (seconds)

ADDFAKES    METADATA
 BIAS            BOOL    FALSE
 DARK            BOOL    FALSE
 FLAT            BOOL    FALSE
 SKY		 BOOL	 FALSE		# Sky illumination rate (e/s)
 STARS.REAL  	 BOOL	 FALSE		# Add stars from a catalogue?
 STARS.FAKE  	 BOOL	 TRUE		# Add stars from a catalogue?
END

FAKEPHOT    METADATA
 BIAS            BOOL    FALSE
 DARK            BOOL    FALSE
 FLAT            BOOL    FALSE
 SKY		 BOOL	 FALSE		# Sky illumination rate (e/s)
 STARS.REAL  	 BOOL	 FALSE		# Add stars from a catalogue?
 STARS.FAKE  	 BOOL	 TRUE		# Add stars from a catalogue?
 PHOTOM          BOOL    FALSE           # perform photometry on the faked stars?
 FORCED.PHOT     BOOL    TRUE
 FORCED.CATDIR   STR     DVO.FORCE
END

