# Camera configuration file for simulation test

# File formats that we know about
FORMATS         METADATA
	SIMTEST	STR	simtest/format.config
END
 
# Description of camera --- all the chips and the cells that comprise them
FPA     METADATA
        Chip		STR	Cell
END

# valid filter names and corresponding IDs
FILTER.ID       METADATA
	NONE	STR	NONE
	g	STR	g
	r	STR	r
	i	STR	i
	z	STR	z
END

# Table of strings to use for the class identifier (see ippdb) according to the file level.
CLASSID		METADATA
	FPA	STR	fpa
END

DVO.CAMERADIR	STR	simtest		# Camera directory for DVO

# convert supplied FPA.OBSTYPE values to abstract exptype names
OBSTYPE.TABLE METADATA
  bias 	   STR BIAS
  zero 	   STR BIAS
  dark 	   STR DARK
  flat 	   STR SKYFLAT
  skyflat  STR SKYFLAT
  domeflat STR DOMEFLAT
  object   STR OBJECT
  science  STR OBJECT
END

# Recipe options
RECIPES		METADATA
        PPIMAGE         STR     simtest/ppImage.config   # Default: all (normal) options on
	PSPHOT		STR	simtest/psphot.config	# psphot details
	PSASTRO		STR	simtest/psastro.config	# psastro details
	REJECTIONS	STR	simtest/rejections.config # Rejection for detrend creation
END

REDUCTION	METADATA
	# Detrend processing
	DETREND		METADATA
		BIAS_PROCESS	STR	PPIMAGE_O
		BIAS_RESID	STR	PPIMAGE_B
		BIAS_VERIFY	STR	PPIMAGE_OB
		BIAS_STACK	STR	PPMERGE_BIAS
		DARK_PROCESS	STR	PPIMAGE_OB
		DARK_RESID	STR	PPIMAGE_D
		DARK_VERIFY	STR	PPIMAGE_OBD
		DARK_STACK	STR	PPMERGE_DARK
		SHUTTER_PROCESS	STR	PPIMAGE_OBD
		SHUTTER_RESID	STR	PPIMAGE_S
		SHUTTER_VERIFY	STR	PPIMAGE_OBDS
		SHUTTER_STACK	STR	PPMERGE_SHUTTER
		FLAT_PROCESS	STR	PPIMAGE_OBDS
		FLAT_RESID	STR	PPIMAGE_F
		FLAT_VERIFY	STR	PPIMAGE_OBDSF
		FLAT_STACK	STR	PPMERGE_FLAT
		FRINGE_PROCESS	STR	PPIMAGE_OBDSF
		FRINGE_RESID	STR	PPIMAGE_R
		FRINGE_VERIFY	STR	PPIMAGE_OBDSFR
		FRINGE_STACK	STR	PPMERGE_FRINGE

 		JPEG_BIN1_IMAGE_BIAS     STR  PPIMAGE_J1_IMAGE_B
		JPEG_BIN1_IMAGE_DARK     STR  PPIMAGE_J1_IMAGE_B
		JPEG_BIN1_IMAGE_SHUTTER  STR  PPIMAGE_J1_IMAGE_F
		JPEG_BIN1_IMAGE_FLAT     STR  PPIMAGE_J1_IMAGE_F
		JPEG_BIN1_IMAGE_DOMEFLAT STR  PPIMAGE_J1_IMAGE_F
		JPEG_BIN1_IMAGE_SKYFLAT  STR  PPIMAGE_J1_IMAGE_F
		JPEG_BIN1_IMAGE_FRINGE   STR  PPIMAGE_J1_IMAGE_R
 		JPEG_BIN2_IMAGE_BIAS     STR  PPIMAGE_J2_IMAGE_B
		JPEG_BIN2_IMAGE_DARK     STR  PPIMAGE_J2_IMAGE_B
		JPEG_BIN2_IMAGE_SHUTTER  STR  PPIMAGE_J2_IMAGE_F
		JPEG_BIN2_IMAGE_FLAT     STR  PPIMAGE_J2_IMAGE_F
		JPEG_BIN2_IMAGE_DOMEFLAT STR  PPIMAGE_J2_IMAGE_F
		JPEG_BIN2_IMAGE_SKYFLAT  STR  PPIMAGE_J2_IMAGE_F
		JPEG_BIN2_IMAGE_FRINGE   STR  PPIMAGE_J2_IMAGE_R

 		JPEG_BIN1_RESID_BIAS     STR  PPIMAGE_J1_RESID_B
		JPEG_BIN1_RESID_DARK     STR  PPIMAGE_J1_RESID_B
		JPEG_BIN1_RESID_SHUTTER  STR  PPIMAGE_J1_RESID_F
		JPEG_BIN1_RESID_FLAT     STR  PPIMAGE_J1_RESID_F
		JPEG_BIN1_RESID_DOMEFLAT STR  PPIMAGE_J1_RESID_F
		JPEG_BIN1_RESID_SKYFLAT  STR  PPIMAGE_J1_RESID_F
		JPEG_BIN1_RESID_FRINGE   STR  PPIMAGE_J1_RESID_R
 		JPEG_BIN2_RESID_BIAS     STR  PPIMAGE_J2_RESID_B
		JPEG_BIN2_RESID_DARK     STR  PPIMAGE_J2_RESID_B
		JPEG_BIN2_RESID_SHUTTER  STR  PPIMAGE_J2_RESID_F
		JPEG_BIN2_RESID_FLAT     STR  PPIMAGE_J2_RESID_F
		JPEG_BIN2_RESID_DOMEFLAT STR  PPIMAGE_J2_RESID_F
		JPEG_BIN2_RESID_SKYFLAT  STR  PPIMAGE_J2_RESID_F
		JPEG_BIN2_RESID_FRINGE   STR  PPIMAGE_J2_RESID_R
	END
	# Processing raw data
	DEFAULT		METADATA
		CHIP		STR	PPIMAGE_OBDSFRA
 		JPEG_BIN1       STR     PPIMAGE_J1
 		JPEG_BIN2       STR     PPIMAGE_J2
	END
	NO_PHOTOM	METADATA
		CHIP		STR	PPIMAGE_OBDSF
	END
	# Photometry and astrometry of data that's already processed
	PROCESSED	METADATA
		CHIP		STR	PPIMAGE_PA
	END

END

FITS    METADATA
# BITPIX is the bits per pixel for writing the output data
# COMPRESSION = NONE|RICE|GZIP|HCOMPRESS|PLIO is the compression algorithm
# TILE.[XYZ] are the tile sizes.  0 means entire the dimension, so (0,1,1) forms tiles from rows
# NOISE [0..16] is the number of "noise bits" to preserve when quantising floating point data; 16 for no loss
# HSCALE is the scale factor for lossy compression with HCOMPRESS; 0 or 1 for none; 2*RMS --> 10x compression
# HSMOOTH is the smoothing to apply to HCOMPRESSed data when decompressing; 0 for none
        TYPE            FITS    BITPIX  COMPRESSION     TILE.X  TILE.Y  TILE.Z  NOISE   HSCALE  HSMOOTH
        DET_IMAGE       FITS    -32     RICE            0       1       1       16      0       0
        DET_MASK        FITS    8       PLIO            0       1       1       0       0       0
        DET_WEIGHT      FITS    -32     RICE            0       1       1       16      0       0
        SKY_IMAGE       FITS    -32     RICE            0       1       1       16      0       0
        SKY_MASK        FITS    8       PLIO            0       1       1       0       0       0
        SKY_WEIGHT      FITS    -32     RICE            0       1       1       16      0       0
END

FILERULES	STR	simtest/filerules.mdc

EXTNAME.RULES METADATA
  CMF.HEAD STR {CHIP.NAME}.hdr
  CMF.DATA STR {CHIP.NAME}.psf # use .PSF and .EXT?

  PSF.HEAD  STR	{CHIP.NAME}.hdr
  PSF.TABLE STR {CHIP.NAME}.psf_model
  PSF.RESID STR {CHIP.NAME}.psf_resid
END

BLANK.HEADERS	METADATA
	FPA.TIME	STR	MJD-OBS
	FPA.EXPOSURE	STR	EXPTIME
	FPA.AIRMASS	STR	AIRMASS
END

TESSELLATIONS	METADATA
	# Tessellation name with corresponding DVO catdir
	Skycells	STR	path://SIMTEST/skycells
END
