### File rules for PHU=FPA, EXT=CHIP (eg, Megacam)
### this file specifies compression types for various output files

### Redirections (MEF)
PPIMAGE.OUTPUT        STR PPIMAGE.OUTPUT.MEF
PPIMAGE.OUTPUT.MASK   STR PPIMAGE.OUT.MK.MEF
PPIMAGE.OUTPUT.WEIGHT STR PPIMAGE.OUT.WT.MEF

PPIMAGE.CHIP          STR PPIMAGE.CHIP.MEF
PPIMAGE.CHIP.MASK     STR PPIMAGE.CHIP.MK.MEF
PPIMAGE.CHIP.WEIGHT   STR PPIMAGE.CHIP.WT.MEF

PPIMAGE.BIN1          STR PPIMAGE.BIN1.MEF
PPIMAGE.BIN2          STR PPIMAGE.BIN2.MEF

PSASTRO.OUTPUT        STR PSASTRO.OUT.CMF.MEF
PSPHOT.OUTPUT         STR PSPHOT.OUT.CMF.MEF

### Redirections (SPL)
# PPIMAGE.OUTPUT        STR PPIMAGE.OUTPUT.SPL
# PPIMAGE.OUTPUT.MASK   STR PPIMAGE.OUT.MK.SPL
# PPIMAGE.OUTPUT.WEIGHT STR PPIMAGE.OUT.WT.SPL
# 
# PPIMAGE.CHIP          STR PPIMAGE.CHIP.SPL
# PPIMAGE.CHIP.MASK     STR PPIMAGE.CHIP.MK.SPL
# PPIMAGE.CHIP.WEIGHT   STR PPIMAGE.CHIP.WT.SPL
# 
# PPIMAGE.BIN1          STR PPIMAGE.BIN1.SPL
# PPIMAGE.BIN2          STR PPIMAGE.BIN2.SPL
# 
# PSASTRO.OUTPUT        STR PSASTRO.OUT.CMF.SPL
# PSPHOT.OUTPUT         STR PSPHOT.OUT.CMF.SPL

### Redirections (common)

PPIMAGE.OUTPUT.FPA1   STR PPIMAGE.OUTPUT.FPA1.MEF
PPIMAGE.OUTPUT.FPA2   STR PPIMAGE.OUTPUT.FPA2.MEF
PPSTAMP.CHIP          STR PPSTAMP.CHIP.MEF
PSASTRO.INPUT         STR PSASTRO.INPUT.CMF
PSASTRO.OUTPUT.MEF    STR PSASTRO.OUT.CMF.MEF
DVOCORR.OUTPUT        STR DVOCORR.MEF.OUTPUT
DVOFLAT.OUTPUT        STR DVOFLAT.MEF.OUTPUT

### input file definitions
### use @DETDB entries to get the detrend images from the database
### replace @DETDB with @FILES if you want to require it from the 
### command line, or with an explicit name to require a specific file
TYPE                    INPUT    FILENAME.RULE DATA.LEVEL FILE.TYPE

## files used by ppImage
PPIMAGE.INPUT           INPUT    @FILES        CHIP       IMAGE
PPIMAGE.INPUT.MASK      INPUT    @FILES        CHIP       MASK
PPIMAGE.INPUT.WEIGHT    INPUT    @FILES        CHIP       WEIGHT
PPIMAGE.INPUT.PSF       INPUT    @FILES        CHIP       PSF
PPIMAGE.INPUT.SRC       INPUT    @FILES        CHIP       CMF
PPIMAGE.MASK       	INPUT 	 @DETDB        CHIP       MASK
PPIMAGE.BIAS       	INPUT 	 @DETDB        CHIP       IMAGE
PPIMAGE.DARK       	INPUT 	 @DETDB        CHIP       DARK
PPIMAGE.FLAT       	INPUT 	 @DETDB        CHIP       IMAGE
PPIMAGE.FRINGE     	INPUT 	 @DETDB        CHIP       FRINGE
PPIMAGE.SHUTTER    	INPUT 	 @DETDB        CHIP       IMAGE     

## Files used by ppMerge
PPMERGE.INPUT           INPUT 	 @FILES        CHIP       IMAGE
PPMERGE.INPUT.MASK      INPUT 	 @FILES        CHIP       MASK
PPMERGE.INPUT.WEIGHT    INPUT 	 @FILES        CHIP       WEIGHT

## files used to build and apply the flat-field correction images
DVOCORR.INPUT      	INPUT 	 @FILES        CHIP       IMAGE
DVOCORR.REFHEAD    	INPUT 	 @FILES        CHIP       HEADER
DVOFLAT.INPUT      	INPUT 	 @FILES        CHIP       IMAGE
DVOFLAT.CORR       	INPUT 	 @DETDB        CHIP       IMAGE

## files used by psphot 
PSPHOT.LOAD        	INPUT 	 @FILES        CHIP       IMAGE
PSPHOT.INPUT       	INPUT 	 @FILES        CHIP       IMAGE
PSPHOT.MASK        	INPUT 	 @FILES        CHIP       MASK     
PSPHOT.WEIGHT      	INPUT 	 @FILES        CHIP       WEIGHT     
PSPHOT.PSF.LOAD    	INPUT 	 @FILES        CHIP       PSF       
PSPHOT.INPUT.CMF   	INPUT 	 @FILES        CHIP       CMF       

## files used by psastro 
PSASTRO.INPUT.CMP  	INPUT 	 @FILES        CHIP       CMP
PSASTRO.INPUT.CMF  	INPUT 	 @FILES        CHIP       CMF
PSASTRO.WCS        	INPUT 	 @FILES        CHIP       CMF
PSASTRO.MODEL      	INPUT 	 @DETDB        FPA        ASTROM

## files used by pswarp
PSWARP.INPUT       	INPUT 	 @FILES        CHIP       IMAGE
PSWARP.WEIGHT      	INPUT 	 @FILES        CHIP       WEIGHT
PSWARP.MASK        	INPUT 	 @FILES        CHIP       MASK
PSWARP.SKYCELL     	INPUT 	 @FILES        CHIP       IMAGE
PSWARP.ASTROM      	INPUT 	 @FILES        CHIP       CMF

## files used by ppsub
PPSUB.INPUT        	INPUT 	 @FILES        FPA        IMAGE
PPSUB.INPUT.MASK   	INPUT 	 @FILES        FPA        MASK
PPSUB.INPUT.WEIGHT 	INPUT 	 @FILES        FPA        WEIGHT
PPSUB.REF          	INPUT 	 @FILES        FPA        IMAGE
PPSUB.REF.MASK     	INPUT 	 @FILES        FPA        MASK
PPSUB.REF.WEIGHT   	INPUT 	 @FILES        FPA        WEIGHT
PPSUB.SOURCES      	INPUT 	 @FILES        FPA        CMF

## files used by ppstack
PPSTACK.INPUT      	INPUT 	 @FILES        FPA        IMAGE
PPSTACK.INPUT.MASK 	INPUT 	 @FILES        FPA        MASK
PPSTACK.INPUT.WEIGHT    INPUT 	 @FILES        FPA        WEIGHT
PPSTACK.INPUT.PSF  	INPUT 	 @FILES        CHIP       PSF
PPSTACK.INPUT.SOURCES  	INPUT 	 @FILES        FPA        CMF

## files used by ppstamp
PPSTAMP.INPUT           INPUT 	 @FILES        CHIP       IMAGE

# files used by pparith
PPARITH.INPUT.IMAGE 	INPUT 	 @FILES        CHIP       IMAGE
PPARITH.INPUT.MASK  	INPUT 	 @FILES        CHIP       MASK

### output file definitions
TYPE                    OUTPUT FILENAME.RULE                     FILE.TYPE FITS.TYPE  DATA.LEVEL FILE.SAVE FILE.FORMAT
PPIMAGE.OUTPUT.MEF      OUTPUT {OUTPUT}.b0.fits                  IMAGE     COMP_IMG   CHIP       TRUE      MEF
PPIMAGE.OUT.MK.MEF      OUTPUT {OUTPUT}.mk.fits                  MASK      COMP_MASK  CHIP       TRUE      MEF
PPIMAGE.OUT.WT.MEF      OUTPUT {OUTPUT}.wt.fits                  WEIGHT    COMP_WT    CHIP       TRUE      MEF
PPIMAGE.OUTPUT.SPL      OUTPUT {OUTPUT}.{CHIP.NAME}.b0.fits      IMAGE     NONE       CHIP       TRUE      SPLIT
PPIMAGE.OUT.MK.SPL      OUTPUT {OUTPUT}.{CHIP.NAME}.mk.fits      MASK      NONE       CHIP       TRUE      SPLIT
PPIMAGE.OUT.WT.SPL      OUTPUT {OUTPUT}.{CHIP.NAME}.wt.fits      WEIGHT    NONE       CHIP       TRUE      SPLIT
PPIMAGE.OUTPUT.DETMASK  OUTPUT {OUTPUT}.fits                     IMAGE     MASK       CHIP       TRUE      MEF
PPIMAGE.OUTPUT.RESID    OUTPUT {OUTPUT}.b0.fits                  IMAGE     COMP_SUB   CHIP       TRUE      MEF
		        					        		     
PPIMAGE.CHIP.MEF        OUTPUT {OUTPUT}.ch.fits                  IMAGE     COMP_IMG   CHIP       TRUE      MEF
PPIMAGE.CHIP.MK.MEF     OUTPUT {OUTPUT}.ch.mk.fits               MASK      COMP_MASK  CHIP       TRUE      MEF
PPIMAGE.CHIP.WT.MEF     OUTPUT {OUTPUT}.ch.wt.fits               WEIGHT    COMP_WT    CHIP       TRUE      MEF
PPIMAGE.CHIP.SPL        OUTPUT {OUTPUT}.{CHIP.NAME}.ch.fits      IMAGE     NONE       CHIP       TRUE      SPLIT
PPIMAGE.CHIP.MK.SPL     OUTPUT {OUTPUT}.{CHIP.NAME}.ch.mk.fits   MASK      NONE       CHIP       TRUE      SPLIT
PPIMAGE.CHIP.WT.SPL     OUTPUT {OUTPUT}.{CHIP.NAME}.ch.wt.fits   WEIGHT    NONE       CHIP       TRUE      SPLIT
							        		     
PPIMAGE.OUTPUT.FPA1.MEF OUTPUT {OUTPUT}.b1.fits                  IMAGE     COMP_IMG   FPA        TRUE      MEF
PPIMAGE.OUTPUT.FPA2.MEF OUTPUT {OUTPUT}.b2.fits                  IMAGE     COMP_IMG   FPA        TRUE      MEF
PPIMAGE.OUTPUT.FPA1.SPL OUTPUT {OUTPUT}.{CHIP.NAME}.b1.fits      IMAGE     NONE       CHIP       TRUE      SPLIT
PPIMAGE.OUTPUT.FPA2.SPL OUTPUT {OUTPUT}.{CHIP.NAME}.b2.fits      IMAGE     NONE       CHIP       TRUE      SPLIT
							        		     
PPIMAGE.BIN1.MEF      	OUTPUT {OUTPUT}.b1c.fits                 IMAGE     COMP_IMG   CHIP       TRUE      MEF
PPIMAGE.BIN2.MEF      	OUTPUT {OUTPUT}.b2c.fits                 IMAGE     COMP_IMG   CHIP       TRUE      MEF
PPIMAGE.BIN1.SPL      	OUTPUT {OUTPUT}.{CHIP.NAME}.b1.fits      IMAGE     COMP_IMG   CHIP       TRUE      SPLIT
PPIMAGE.BIN2.SPL      	OUTPUT {OUTPUT}.{CHIP.NAME}.b2.fits      IMAGE     COMP_IMG   CHIP       TRUE      SPLIT
		      						       		     
PPIMAGE.JPEG1         	OUTPUT {OUTPUT}.b1.jpg                   JPEG      NONE       FPA        TRUE      NONE
PPIMAGE.JPEG2         	OUTPUT {OUTPUT}.b2.jpg                   JPEG      NONE       FPA        TRUE      NONE
		      						       		     
PPIMAGE.STATS         	OUTPUT {OUTPUT}.stats                    STATS     NONE       FPA        TRUE      MEF

## note: these use the same output naming convention since they are used for different ppMerge runs
PPMERGE.OUTPUT.MASK     OUTPUT {OUTPUT}.fits                   	 MASK      NONE       CHIP       TRUE      NONE
PPMERGE.OUTPUT.BIAS     OUTPUT {OUTPUT}.fits                   	 IMAGE     NONE       CHIP       TRUE      NONE
PPMERGE.OUTPUT.DARK     OUTPUT {OUTPUT}.fits                   	 DARK      NONE       CHIP       TRUE      NONE
PPMERGE.OUTPUT.SHUTTER  OUTPUT {OUTPUT}.fits                   	 IMAGE     NONE       CHIP       TRUE      NONE
PPMERGE.OUTPUT.FLAT     OUTPUT {OUTPUT}.fits                   	 IMAGE     NONE       CHIP       TRUE      NONE
PPMERGE.OUTPUT.FRINGE   OUTPUT {OUTPUT}.fits                   	 FRINGE    NONE       CHIP       TRUE      NONE
PPMERGE.OUTPUT.SIGMA    OUTPUT {OUTPUT}.sigma.fits             	 IMAGE     NONE       CHIP       TRUE      NONE
PPMERGE.OUTPUT.COUNT    OUTPUT {OUTPUT}.count.fits             	 IMAGE     NONE       CHIP       TRUE      NONE
							        		     
DVOCORR.MEF.OUTPUT    	OUTPUT {OUTPUT}.fc.fits                  IMAGE     NONE       CHIP       TRUE      MEF
DVOCORR.SPL.OUTPUT    	OUTPUT {OUTPUT}.{CHIP.NAME}.fc.fits      IMAGE     NONE       CHIP       TRUE      SPLIT
DVOFLAT.MEF.OUTPUT    	OUTPUT {OUTPUT}.co.fits                  IMAGE     NONE       CHIP       TRUE      MEF
DVOFLAT.SPL.OUTPUT    	OUTPUT {OUTPUT}.{CHIP.NAME}.co.fits      IMAGE     NONE       CHIP       TRUE      SPLIT
		      						       		     
PSPHOT.RESID          	OUTPUT {OUTPUT}.res.fits                 IMAGE     NONE       CHIP       FALSE     MEF
PSPHOT.BACKGND        	OUTPUT {OUTPUT}.bck.fits                 IMAGE     NONE       CHIP       FALSE     MEF
PSPHOT.BACKSUB        	OUTPUT {OUTPUT}.sub.fits                 IMAGE     NONE       CHIP       FALSE     MEF
PSPHOT.BACKMDL        	OUTPUT {OUTPUT}.mdl.fits                 IMAGE     NONE       CHIP       FALSE     MEF
		      						       		     
PSPHOT.OUTPUT.RAW     	OUTPUT {OUTPUT}.{CHIP.NAME}              RAW       NONE       CHIP       TRUE      NONE
PSPHOT.OUTPUT.SX      	OUTPUT {OUTPUT}.{CHIP.NAME}.sx           SX        NONE       CHIP       TRUE      NONE
PSPHOT.OUTPUT.OBJ     	OUTPUT {OUTPUT}.{CHIP.NAME}.obj          OBJ       NONE       CHIP       TRUE      NONE
PSPHOT.OUTPUT.CMP     	OUTPUT {OUTPUT}.{CHIP.NAME}.cmp          CMP       NONE       CHIP       TRUE      NONE
PSPHOT.OUT.CMF.SPL    	OUTPUT {OUTPUT}.{CHIP.NAME}.cmf          CMF       NONE       CHIP       TRUE      SPLIT
PSPHOT.OUT.CMF.MEF    	OUTPUT {OUTPUT}.cmf                      CMF       NONE       CHIP       TRUE      MEF
PSPHOT.PSF.SAVE       	OUTPUT {OUTPUT}.psf                      PSF       NONE       CHIP       TRUE      MEF
		      						       		     
SOURCE.PLOT.MOMENTS   	OUTPUT {OUTPUT}.mnt.png                  KAPA      NONE       FPA        TRUE      NONE
SOURCE.PLOT.PSFMODEL  	OUTPUT {OUTPUT}.psf.png                  KAPA      NONE       FPA        TRUE      NONE
SOURCE.PLOT.APRESID   	OUTPUT {OUTPUT}.dap.png                  KAPA      NONE       FPA        TRUE      NONE
		      						       		     
PSASTRO.OUTPUT.CMP    	OUTPUT {OUTPUT}.{CHIP.NAME}.smp          CMP       NONE       CHIP       TRUE      NONE
PSASTRO.OUT.CMF.SPL   	OUTPUT {OUTPUT}.{CHIP.NAME}.smf          CMF       NONE       CHIP       TRUE      SPLIT
PSASTRO.OUT.CMF.MEF   	OUTPUT {OUTPUT}.smf                      CMF       NONE       FPA        TRUE      MEF
PSASTRO.OUT.MODEL     	OUTPUT {OUTPUT}.asm                ASTROM.MODEL    NONE       FPA        TRUE      NONE
PSASTRO.OUT.REFSTARS  	OUTPUT {OUTPUT}.aref.fits          ASTROM.REFSTARS NONE       FPA        TRUE      NONE
PSASTRO.STATS           OUTPUT {OUTPUT}.stats                    STATS     NONE       FPA        TRUE      NONE
	      									     
PSWARP.OUTPUT         	OUTPUT {OUTPUT}.fits                     IMAGE     COMP_IMG   FPA        TRUE      NONE
PSWARP.OUTPUT.MASK    	OUTPUT {OUTPUT}.mk.fits                  MASK      COMP_MASK  FPA        TRUE      NONE
PSWARP.OUTPUT.WEIGHT  	OUTPUT {OUTPUT}.wt.fits                  WEIGHT    COMP_WT    FPA        TRUE      NONE
PSWARP.OUTPUT.SOURCES 	OUTPUT {OUTPUT}.cmf                      CMF       NONE       FPA        TRUE      NONE
PSWARP.BIN1           	OUTPUT {OUTPUT}.b1.fits                  IMAGE     COMP_IMG   FPA        TRUE      NONE
PSWARP.BIN2           	OUTPUT {OUTPUT}.b2.fits                  IMAGE     COMP_IMG   FPA        TRUE      NONE
		      						       		     
SKYCELL.STATS         	OUTPUT {OUTPUT}.stats                    STATS     NONE       FPA        TRUE      NONE
SKYCELL.TEMPLATE      	OUTPUT {OUTPUT}.skycell                  SKYCELL   NONE       FPA        TRUE      NONE
		      						       		     
PPSUB.OUTPUT          	OUTPUT {OUTPUT}.fits                     IMAGE     COMP_IMG   FPA        TRUE      NONE
PPSUB.OUTPUT.MASK     	OUTPUT {OUTPUT}.mk.fits                  MASK      COMP_MASK  FPA        TRUE      NONE
PPSUB.OUTPUT.WEIGHT   	OUTPUT {OUTPUT}.wt.fits                  WEIGHT    COMP_WT    FPA        TRUE      NONE
		      						       		     
PPSTACK.OUTPUT        	OUTPUT {OUTPUT}.fits                     IMAGE     COMP_IMG   FPA        TRUE      NONE
PPSTACK.OUTPUT.MASK   	OUTPUT {OUTPUT}.mk.fits                  MASK      COMP_MASK  FPA        TRUE      NONE
PPSTACK.OUTPUT.WEIGHT 	OUTPUT {OUTPUT}.wt.fits                  WEIGHT    COMP_WT    FPA        TRUE      NONE
		      						       		     
PPSTAMP.OUTPUT        	OUTPUT {OUTPUT}.fits                     IMAGE     NONE       FPA        TRUE      NONE
PPSTAMP.CHIP.MEF      	OUTPUT {OUTPUT}.ch.fits                  IMAGE     NONE       CHIP       FALSE     MEF
		      						       		     
PPSIM.OUTPUT.MEF      	OUTPUT {OUTPUT}.fits                     IMAGE     NONE       CHIP       TRUE      MEF
PPSIM.OUTPUT.SPL      	OUTPUT {OUTPUT}.{CHIP.NAME}.fits         IMAGE     NONE       CHIP       TRUE      SPLIT
PPSIM.FAKE.CHIP        	OUTPUT {OUTPUT}.fake.fits     		 IMAGE     NONE       FPA        TRUE      SIMPLE
PPSIM.FORCE.CHIP       	OUTPUT {OUTPUT}.force.fits     		 IMAGE     NONE       FPA        TRUE      SIMPLE
PPSIM.SOURCES         	OUTPUT {OUTPUT}.cmf                      CMF       NONE       FPA        TRUE      MEF
PPSIM.FAKE.SOURCES     	OUTPUT {OUTPUT}.fake.cmf                 CMF       NONE       FPA        TRUE      NONE
PPSIM.FORCE.SOURCES    	OUTPUT {OUTPUT}.force.cmf                CMF       NONE       FPA        TRUE      NONE
		      						       		     
PPARITH.OUTPUT.IMAGE  	OUTPUT {OUTPUT}.fits                     IMAGE     COMP_IMG   CHIP       TRUE      NONE
PPARITH.OUTPUT.MASK   	OUTPUT {OUTPUT}.fits                     MASK      COMP_MASK  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
		      						       		     
TRACE.IMFILE          	OUTPUT {OUTPUT}.{CHIP.NAME}.trace        TEXT      NONE       CHIP       TRUE      NONE
TRACE.EXP             	OUTPUT {OUTPUT}.trace                    TEXT      NONE       FPA        TRUE      NONE
