# Camera configuration file for Cfh12k: describes the camera

# File formats that we know about
FORMATS		METADATA
	RAW	STR	tc3/format.config
END

# Description of camera --- all the chips and the cells that comprise them
FPA	METADATA
	CCID58-1-06b2	STR	xy00 xy01 xy02 xy03 xy04 xy05 xy06 xy07 xy10 xy11 xy12 xy13 xy14 xy15 xy16 xy17 xy20 xy21 xy22 xy23 xy24 xy25 xy26 xy27 xy30 xy31 xy32 xy33 xy34 xy35 xy36 xy37 xy40 xy41 xy42 xy43 xy44 xy45 xy46 xy47 xy50 xy51 xy52 xy53 xy54 xy55 xy56 xy57 xy60 xy61 xy62 xy63 xy64 xy65 xy66 xy67 xy70 xy71 xy72 xy73 xy74 xy75 xy76 xy77
	CCID45-1-14A 	STR	xy00 xy01 xy02 xy03 xy04 xy05 xy06 xy07 xy10 xy11 xy12 xy13 xy14 xy15 xy16 xy17 xy20 xy21 xy22 xy23 xy24 xy25 xy26 xy27 xy30 xy31 xy32 xy33 xy34 xy35 xy36 xy37 xy40 xy41 xy42 xy43 xy44 xy45 xy46 xy47 xy50 xy51 xy52 xy53 xy54 xy55 xy56 xy57 xy60 xy61 xy62 xy63 xy64 xy65 xy66 xy67 xy70 xy71 xy72 xy73 xy74 xy75 xy76 xy77
	CCID45-1-11A 	STR	xy00 xy01 xy02 xy03 xy04 xy05 xy06 xy07 xy10 xy11 xy12 xy13 xy14 xy15 xy16 xy17 xy20 xy21 xy22 xy23 xy24 xy25 xy26 xy27 xy30 xy31 xy32 xy33 xy34 xy35 xy36 xy37 xy40 xy41 xy42 xy43 xy44 xy45 xy46 xy47 xy50 xy51 xy52 xy53 xy54 xy55 xy56 xy57 xy60 xy61 xy62 xy63 xy64 xy65 xy66 xy67 xy70 xy71 xy72 xy73 xy74 xy75 xy76 xy77
	CCID45-1-22A 	STR	xy00 xy01 xy02 xy03 xy04 xy05 xy06 xy07 xy10 xy11 xy12 xy13 xy14 xy15 xy16 xy17 xy20 xy21 xy22 xy23 xy24 xy25 xy26 xy27 xy30 xy31 xy32 xy33 xy34 xy35 xy36 xy37 xy40 xy41 xy42 xy43 xy44 xy45 xy46 xy47 xy50 xy51 xy52 xy53 xy54 xy55 xy56 xy57 xy60 xy61 xy62 xy63 xy64 xy65 xy66 xy67 xy70 xy71 xy72 xy73 xy74 xy75 xy76 xy77
	CCID45-1-04C 	STR	xy00 xy01 xy02 xy03 xy04 xy05 xy06 xy07 xy10 xy11 xy12 xy13 xy14 xy15 xy16 xy17 xy20 xy21 xy22 xy23 xy24 xy25 xy26 xy27 xy30 xy31 xy32 xy33 xy34 xy35 xy36 xy37 xy40 xy41 xy42 xy43 xy44 xy45 xy46 xy47 xy50 xy51 xy52 xy53 xy54 xy55 xy56 xy57 xy60 xy61 xy62 xy63 xy64 xy65 xy66 xy67 xy70 xy71 xy72 xy73 xy74 xy75 xy76 xy77
	CCID45-1-13A 	STR	xy00 xy01 xy02 xy03 xy04 xy05 xy06 xy07 xy10 xy11 xy12 xy13 xy14 xy15 xy16 xy17 xy20 xy21 xy22 xy23 xy24 xy25 xy26 xy27 xy30 xy31 xy32 xy33 xy34 xy35 xy36 xy37 xy40 xy41 xy42 xy43 xy44 xy45 xy46 xy47 xy50 xy51 xy52 xy53 xy54 xy55 xy56 xy57 xy60 xy61 xy62 xy63 xy64 xy65 xy66 xy67 xy70 xy71 xy72 xy73 xy74 xy75 xy76 xy77
	CCID45-1-05A 	STR	xy00 xy01 xy02 xy03 xy04 xy05 xy06 xy07 xy10 xy11 xy12 xy13 xy14 xy15 xy16 xy17 xy20 xy21 xy22 xy23 xy24 xy25 xy26 xy27 xy30 xy31 xy32 xy33 xy34 xy35 xy36 xy37 xy40 xy41 xy42 xy43 xy44 xy45 xy46 xy47 xy50 xy51 xy52 xy53 xy54 xy55 xy56 xy57 xy60 xy61 xy62 xy63 xy64 xy65 xy66 xy67 xy70 xy71 xy72 xy73 xy74 xy75 xy76 xy77
	CCID45-1-19A 	STR	xy00 xy01 xy02 xy03 xy04 xy05 xy06 xy07 xy10 xy11 xy12 xy13 xy14 xy15 xy16 xy17 xy20 xy21 xy22 xy23 xy24 xy25 xy26 xy27 xy30 xy31 xy32 xy33 xy34 xy35 xy36 xy37 xy40 xy41 xy42 xy43 xy44 xy45 xy46 xy47 xy50 xy51 xy52 xy53 xy54 xy55 xy56 xy57 xy60 xy61 xy62 xy63 xy64 xy65 xy66 xy67 xy70 xy71 xy72 xy73 xy74 xy75 xy76 xy77
END

# ccd00
# ccd01
# ccd10
# ccd11
# ccd20
# ccd21
# ccd30
# ccd31

# move this elsewhere?  we need a lookup table to go from filter ID to abstract name
FILTER.ID       METADATA
	NONE	STR	NONE
	B	STR	B
	V	STR	V
END

# Table of strings to use for the class identifier (see ippdb) according to the file level.
CLASSID		METADATA
	FPA	STR	fpa
	CHIP	STR	{CHIP.NAME}
	CELL	STR	{CHIP.NAME}:{CELL.NAME}
	fpa	STR	fpa
	chip	STR	{CHIP.NAME}
	cell	STR	{CHIP.NAME}:{CELL.NAME}
END

# 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
	# Other recipes
#        PSPHOT          STR     tc3/psphot.config           # psphot details
#        PSASTRO         STR     tc3/psastro.config          # psastro details
#	PPSTATS		STR	tc3/ppStats.config		# ppStats recipe
	PPIMAGE         STR     tc3/ppImage.config		# ppImage recipe
END

FILERULES METADATA
   ### Redirections
   PSASTRO.INPUT      STR PSASTRO.INPUT.CMP
   PSASTRO.OUTPUT     STR PSASTRO.OUTPUT.CMP
   PSPHOT.OUTPUT      STR PSPHOT.OUTPUT.CMF
   DVOCORR.OUTPUT     STR DVOCORR.MEF.OUTPUT
   DVOFLAT.OUTPUT     STR DVOFLAT.MEF.OUTPUT

   ### input file definitions
   TYPE               INPUT FILENAME.RULE                 DATA.LEVEL FILE.TYPE 
   PPIMAGE.INPUT      INPUT @FILES                        CHIP       IMAGE

   ## can we just use PPIMAGE.INPUT as the pmFPAfile name?
   DVOCORR.INPUT      INPUT @FILES                        CHIP       IMAGE     
   DVOCORR.REFHEAD    INPUT @FILES                        CHIP       HEADER     

   DVOFLAT.INPUT      INPUT @FILES                        CHIP       IMAGE 	
   DVOFLAT.CORR       INPUT @DETDB                        CHIP       IMAGE 	

   ### use these entries to get the detrend images from the database
   PPIMAGE.MASK       INPUT @DETDB                        CHIP       IMAGE
   PPIMAGE.BIAS       INPUT @DETDB                        CHIP       IMAGE
   PPIMAGE.DARK       INPUT @DETDB                        CHIP       IMAGE
   PPIMAGE.FLAT       INPUT @DETDB                        CHIP       IMAGE
   PPIMAGE.FRINGE     INPUT @DETDB                        CHIP       FRINGE     

   PSPHOT.INPUT       INPUT @FILES                        CHIP       IMAGE     
   PSASTRO.INPUT.CMP  INPUT @FILES                        CHIP       CMP       
   PSASTRO.INPUT.CMF  INPUT @FILES                        CHIP       CMF       


   ### output file definitions
   TYPE                OUTPUT FILENAME.RULE                  FILE.TYPE FITS.TYPE DATA.LEVEL FILE.SAVE FILE.FORMAT
   PPIMAGE.OUTPUT      OUTPUT {OUTPUT}.{CHIP.NAME}.fits      IMAGE     NONE      CHIP       TRUE      NONE
   PPIMAGE.OUTPUT.MASK OUTPUT {OUTPUT}.{CHIP.NAME}.mask.fits MASK      NONE      CHIP       TRUE      NONE
   PPIMAGE.OUTPUT.WEIGHT OUTPUT {OUTPUT}.{CHIP.NAME}.wt.fits WEIGHT    NONE      CHIP       TRUE      NONE
   PPIMAGE.BIN1        OUTPUT {OUTPUT}.{CHIP.NAME}.b1.fits   IMAGE     NONE      CHIP       TRUE      NONE
   PPIMAGE.BIN2        OUTPUT {OUTPUT}.{CHIP.NAME}.b2.fits   IMAGE     NONE      CHIP       TRUE      NONE
   DVOCORR.MEF.OUTPUT  OUTPUT {OUTPUT}.fc.fits               IMAGE     NONE      CHIP       TRUE      NONE
   DVOCORR.SPL.OUTPUT  OUTPUT {OUTPUT}.{CHIP.NAME}.fc.fits   IMAGE     NONE      CHIP       TRUE      NONE
   DVOFLAT.MEF.OUTPUT  OUTPUT {OUTPUT}.co.fits               IMAGE     NONE      CHIP       TRUE      NONE
   DVOFLAT.SPL.OUTPUT  OUTPUT {OUTPUT}.{CHIP.NAME}.co.fits   IMAGE     NONE      CHIP       TRUE      NONE

   PPIMAGE.OUTPUT.CHIP OUTPUT {OUTPUT}.{CHIP.NAME}.chip.fits IMAGE     NONE      CHIP       TRUE      NONE
   PPIMAGE.OUTPUT.FPA1 OUTPUT {OUTPUT}.b1.fits               IMAGE     NONE      FPA        TRUE      NONE
   PPIMAGE.OUTPUT.FPA2 OUTPUT {OUTPUT}.b2.fits               IMAGE     NONE      FPA        TRUE      NONE

   PPIMAGE.JPEG1       OUTPUT {OUTPUT}.b1.jpg                JPEG      NONE      FPA        TRUE      NONE
   PPIMAGE.JPEG2       OUTPUT {OUTPUT}.b2.jpg                JPEG      NONE      FPA        TRUE      NONE

   PSPHOT.RESID        OUTPUT {OUTPUT}.res.fits              IMAGE     NONE      CHIP       TRUE      NONE
   PSPHOT.BACKGND      OUTPUT {OUTPUT}.bck.fits              IMAGE     NONE      CHIP       TRUE      NONE
   PSPHOT.BACKSUB      OUTPUT {OUTPUT}.sub.fits              IMAGE     NONE      CHIP       TRUE      NONE
   PSPHOT.BACKMDL      OUTPUT {OUTPUT}.mdl.fits              IMAGE     NONE      CHIP       TRUE      NONE

   PSPHOT.OUTPUT.RAW   OUTPUT {OUTPUT}.{CHIP.NAME}           RAW       NONE      CHIP       TRUE      NONE
   PSPHOT.OUTPUT.SX    OUTPUT {OUTPUT}.sx                    SX        NONE      CHIP       TRUE      NONE
   PSPHOT.OUTPUT.OBJ   OUTPUT {OUTPUT}.obj                   OBJ       NONE      CHIP       TRUE      NONE
   PSPHOT.OUTPUT.CMF   OUTPUT {OUTPUT}.cmf                   CMF       NONE      CHIP       TRUE      NONE
   PSPHOT.OUTPUT.CMP   OUTPUT {OUTPUT}.{CHIP.NAME}.cmp       CMP       NONE      CHIP       TRUE      NONE

   PSASTRO.OUTPUT.CMP  OUTPUT {OUTPUT}.{CHIP.NAME}.smp       CMP       NONE      CHIP       TRUE      NONE

   LOG.IMFILE            OUTPUT {OUTPUT}.{CHIP.NAME}.log     TEXT      NONE      CHIP       TRUE      NONE
   LOG.EXP               OUTPUT {OUTPUT}.log                 TEXT      NONE      FPA        TRUE      NONE
END
