# "mcshort" is a MegaCam camera with only the central six chips --- it's faster than the entire FPA.
# Camera configuration file for MegaCam: describes the camera

# File formats that we know about
FORMATS		METADATA
	RAW	STR	mcshort/format_raw.config
	SPLICED	STR	mcshort/format_spliced.config
	SPLIT	STR	mcshort/format_split.config
END

# Description of camera --- all the chips and the cells that comprise them
FPA	METADATA
#	ccd00	STR	LeftAmp RightAmp
#	ccd01	STR	LeftAmp RightAmp
#	ccd02	STR	LeftAmp RightAmp
#	ccd03	STR	LeftAmp RightAmp
#	ccd04	STR	LeftAmp RightAmp
#	ccd05	STR	LeftAmp RightAmp
#	ccd06	STR	LeftAmp RightAmp
#	ccd07	STR	LeftAmp RightAmp
#	ccd08	STR	LeftAmp RightAmp
#	ccd09	STR	LeftAmp RightAmp
#	ccd10	STR	LeftAmp RightAmp
#	ccd11	STR	LeftAmp RightAmp
	ccd12	STR	LeftAmp RightAmp
	ccd13	STR	LeftAmp RightAmp
	ccd14	STR	LeftAmp RightAmp
#	ccd15	STR	LeftAmp RightAmp
#	ccd16	STR	LeftAmp RightAmp
#	ccd17	STR	LeftAmp RightAmp
#	ccd18	STR	LeftAmp RightAmp
#	ccd19	STR	LeftAmp RightAmp
#	ccd20	STR	LeftAmp RightAmp
	ccd21	STR	LeftAmp RightAmp
	ccd22	STR	LeftAmp RightAmp
	ccd23	STR	LeftAmp RightAmp
#	ccd24	STR	LeftAmp RightAmp
#	ccd25	STR	LeftAmp RightAmp
#	ccd26	STR	LeftAmp RightAmp
#	ccd27	STR	LeftAmp RightAmp
#	ccd28	STR	LeftAmp RightAmp
#	ccd29	STR	LeftAmp RightAmp
#	ccd30	STR	LeftAmp RightAmp
#	ccd31	STR	LeftAmp RightAmp
#	ccd32	STR	LeftAmp RightAmp
#	ccd33	STR	LeftAmp RightAmp
#	ccd34	STR	LeftAmp RightAmp
#	ccd35	STR	LeftAmp RightAmp
END

# move this elsewhere?  we need a lookup table to go from filter ID to abstract name
FILTER.ID       METADATA
   u        STR   u.MP9301     
   g        STR   g.MP9401     
   r        STR   r.MP9601     
   i        STR   i.MP9701     
   z        MULTI
   z        STR   z.MP9801     
   z        STR   Zp           
   z        STR   Zprime       

   Ha       MULTI
   Ha       STR   Ha.MP7605    
   Ha       STR   Halpha       
   Ha       STR   Haalpha.on   
   HaOff    STR   HaOFF.MP7604 
   	              		
   CN       MULTI
   CN       STR   CN.MP780     
   CN       STR   cn.MP7803    
   CN       STR   CN.MP7803    
   	              		
   TiO      MULTI
   TiO      STR   TiO.MP77     
   TiO      STR   tio.MP7701   
   TiO      STR   TiO.MP7701   
   NB920    STR   NB920        
   	              		
   B2F      STR   B2F          
   Bj       STR   Bj           
   Vj       STR   Vj           
   Rj       STR   Rj           
   Ij       STR   Ij           
   Hb       STR   Hb           
   HbOff    STR   HbOff        
END

# Recipe options
RECIPES		METADATA
	# Other recipes
        PSPHOT          STR     megacam/psphot.config           # psphot details
        PSASTRO         STR     megacam/psastro.config          # psastro details
	PPSTATS		STR	megacam/ppStats.config		# ppStats recipe
	PPIMAGE         STR     megacam/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

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

   ### use these entries to get the detrend images from specific files
   PPIMAGE.MASK       INPUT mcshort/mask.{CHIP.NAME}.fits                            CHIP       MASK
   PPIMAGE.BIAS       INPUT path://somewhere/MCSHORT.bias.norm.1.2.{CHIP.NAME}.fits  CHIP       IMAGE
   PPIMAGE.DARK       INPUT path://somewhere/MCSHORT.dark.norm.2.1.{CHIP.NAME}.fits  CHIP       IMAGE
   PPIMAGE.FLAT       INPUT path://somewhere/MCSHORT.flat.norm.3.1.{CHIP.NAME}.fits  CHIP       IMAGE
   PPIMAGE.FRINGE     INPUT path://somewhere/fringe.fits	                     CHIP       FRINGE

   ### 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

   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                  DATA.LEVEL FILE.TYPE FILE.SAVE FILE.FORMAT
#   PPIMAGE.OUTPUT      OUTPUT {OUTPUT}.{CHIP.NAME}.fits     CHIP       IMAGE     TRUE      NONE
   PPIMAGE.OUTPUT      OUTPUT {OUTPUT}.fits                  CHIP       IMAGE     TRUE      SPLICED
   PPIMAGE.OUTPUT.MASK OUTPUT {OUTPUT}.{CHIP.NAME}.mask.fits CHIP       MASK      FALSE     NONE
   PPIMAGE.OUTPUT.WEIGHT OUTPUT {OUTPUT}.{CHIP.NAME}.wt.fits CHIP       WEIGHT    FALSE     NONE
   PPIMAGE.BIN1        OUTPUT {OUTPUT}.{CHIP.NAME}.b1.fits   CHIP       IMAGE     TRUE      NONE
   PPIMAGE.BIN2        OUTPUT {OUTPUT}.{CHIP.NAME}.b2.fits   CHIP       IMAGE     TRUE      NONE

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

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

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

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

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

END
