### File rules for PHU=FPA, EXT=NONE

PSASTRO.INPUT      STR PSASTRO.INPUT.CMF
PSASTRO.OUTPUT     STR PSASTRO.OUTPUT.CMF
PSASTRO.OUTPUT.MEF STR PSASTRO.OUTPUT.CMF
PSPHOT.OUTPUT      STR PSPHOT.OUTPUT.CMF

### 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        FPA        IMAGE     
PPIMAGE.INPUT.MASK      INPUT    @FILES        FPA        MASK      
PPIMAGE.INPUT.WEIGHT    INPUT    @FILES        FPA        WEIGHT    
PPIMAGE.INPUT.PSF       INPUT    @FILES        READOUT    PSF       
PPIMAGE.INPUT.SRC       INPUT    @FILES        READOUT    CMF       
PPIMAGE.MASK       	INPUT    @DETDB        CHIP       IMAGE     
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        FPA        IMAGE     
PSWARP.WEIGHT      	INPUT    @FILES        FPA        WEIGHT
PSWARP.MASK        	INPUT    @FILES        FPA        MASK
PSWARP.SKYCELL     	INPUT    @FILES        FPA        IMAGE     
PSWARP.ASTROM      	INPUT    @FILES        FPA        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        FPA        IMAGE

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

PPSIM.INPUT             INPUT    @FILES        FPA        IMAGE     
PPSIM.REAL.SOURCES      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}.fits         IMAGE     NONE       FPA        TRUE      SIMPLE
PPIMAGE.OUTPUT.MASK     OUTPUT {OUTPUT}.mk.fits      MASK      NONE       FPA        TRUE      SIMPLE
PPIMAGE.OUTPUT.WEIGHT   OUTPUT {OUTPUT}.wt.fits      WEIGHT    NONE       FPA        TRUE      SIMPLE
PPIMAGE.OUTPUT.DETMASK  OUTPUT {OUTPUT}.fits         IMAGE     NONE       FPA        TRUE      SIMPLE
PPIMAGE.OUTPUT.RESID    OUTPUT {OUTPUT}.fits         IMAGE     NONE       FPA        TRUE      SIMPLE
						     
PPIMAGE.CHIP        	OUTPUT {OUTPUT}.ch.fits      IMAGE     NONE       FPA        TRUE      SIMPLE
PPIMAGE.CHIP.MASK   	OUTPUT {OUTPUT}.ch.mk.fits   MASK      NONE       FPA        TRUE      SIMPLE
PPIMAGE.CHIP.WEIGHT 	OUTPUT {OUTPUT}.ch.wt.fits   WEIGHT    NONE       FPA        TRUE      SIMPLE
						     
PPIMAGE.OUTPUT.FPA1 	OUTPUT {OUTPUT}.b1.fits      IMAGE     NONE       FPA        TRUE      SIMPLE
PPIMAGE.OUTPUT.FPA2 	OUTPUT {OUTPUT}.b2.fits      IMAGE     NONE       FPA        TRUE      SIMPLE
						     
PPIMAGE.BIN1        	OUTPUT {OUTPUT}.b1.fits      IMAGE     NONE       FPA        TRUE      SIMPLE
PPIMAGE.BIN2        	OUTPUT {OUTPUT}.b2.fits      IMAGE     NONE       FPA        TRUE      SIMPLE
						     
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      NONE

## note: these use the  same output naming convention since they are used for different ppMerge runs
PPMERGE.OUTPUT.MASK   	OUTPUT {OUTPUT}.fits         MASK      NONE       FPA        TRUE      SIMPLE
PPMERGE.OUTPUT.BIAS   	OUTPUT {OUTPUT}.fits         IMAGE     NONE       FPA        TRUE      SIMPLE
PPMERGE.OUTPUT.DARK   	OUTPUT {OUTPUT}.fits         DARK      NONE       FPA        TRUE      SIMPLE
PPMERGE.OUTPUT.SHUTTER	OUTPUT {OUTPUT}.fits         IMAGE     NONE       FPA        TRUE      SIMPLE
PPMERGE.OUTPUT.FLAT   	OUTPUT {OUTPUT}.fits         IMAGE     NONE       FPA        TRUE      SIMPLE
PPMERGE.OUTPUT.FRINGE 	OUTPUT {OUTPUT}.fits         FRINGE    NONE       FPA        TRUE      SIMPLE
PPMERGE.OUTPUT.SIGMA  	OUTPUT {OUTPUT}.sigma.fits   IMAGE     NONE       FPA        TRUE      SIMPLE
PPMERGE.OUTPUT.COUNT  	OUTPUT {OUTPUT}.count.fits   IMAGE     NONE       FPA        TRUE      SIMPLE
						     
DVOCORR.OUTPUT      	OUTPUT {OUTPUT}.fc.fits      IMAGE     NONE       FPA        TRUE      SIMPLE
DVOFLAT.OUTPUT      	OUTPUT {OUTPUT}.co.fits      IMAGE     NONE       FPA        TRUE      SIMPLE
						     
PSPHOT.RESID        	OUTPUT {OUTPUT}.res.fits     IMAGE     NONE       FPA        TRUE      SIMPLE
PSPHOT.BACKGND      	OUTPUT {OUTPUT}.bck.fits     IMAGE     NONE       FPA        TRUE      SIMPLE
PSPHOT.BACKSUB      	OUTPUT {OUTPUT}.sub.fits     IMAGE     NONE       FPA        TRUE      SIMPLE
PSPHOT.BACKMDL      	OUTPUT {OUTPUT}.mdl.fits     IMAGE     NONE       FPA        TRUE      SIMPLE
						     
PSPHOT.OUTPUT.RAW   	OUTPUT {OUTPUT}              RAW       NONE       FPA        TRUE      NONE
PSPHOT.OUTPUT.SX    	OUTPUT {OUTPUT}.sx           SX        NONE       FPA        TRUE      NONE
PSPHOT.OUTPUT.OBJ   	OUTPUT {OUTPUT}.obj          OBJ       NONE       FPA        TRUE      NONE
PSPHOT.OUTPUT.CMP   	OUTPUT {OUTPUT}.cmp          CMP       NONE       FPA        TRUE      NONE
PSPHOT.OUTPUT.CMF   	OUTPUT {OUTPUT}.cmf          CMF       NONE       CHIP       TRUE      NONE
PSPHOT.PSF.SAVE     	OUTPUT {OUTPUT}.psf          PSF       NONE       FPA        TRUE      NONE
						     
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}.smp          CMP       NONE       FPA        TRUE      NONE
PSASTRO.OUTPUT.CMF  	OUTPUT {OUTPUT}.smf          CMF       NONE       FPA        TRUE      NONE
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     NONE       FPA        TRUE      NONE
PSWARP.OUTPUT.MASK  	OUTPUT {OUTPUT}.mask.fits    MASK      NONE       FPA        TRUE      NONE
PSWARP.OUTPUT.WEIGHT    OUTPUT {OUTPUT}.wt.fits      WEIGHT    NONE       FPA        TRUE      NONE
PSWARP.OUTPUT.SOURCES   OUTPUT {OUTPUT}.cmf          CMF       NONE       FPA        TRUE      NONE
PSWARP.BIN1         	OUTPUT {OUTPUT}.b1.fits      IMAGE     NONE       FPA        TRUE      NONE
PSWARP.BIN2         	OUTPUT {OUTPUT}.b2.fits      IMAGE     NONE       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     NONE       FPA        TRUE      NONE
PPSUB.OUTPUT.MASK   	OUTPUT {OUTPUT}.mask.fits    MASK      NONE       FPA        TRUE      NONE
PPSUB.OUTPUT.WEIGHT 	OUTPUT {OUTPUT}.wt.fits      WEIGHT    NONE       FPA        TRUE      NONE
						     
PPSTACK.OUTPUT      	OUTPUT {OUTPUT}.fits         IMAGE     NONE       FPA        TRUE      NONE
PPSTACK.OUTPUT.MASK 	OUTPUT {OUTPUT}.mask.fits    MASK      NONE       FPA        TRUE      NONE
PPSTACK.OUTPUT.WEIGHT   OUTPUT {OUTPUT}.weight.fits  WEIGHT    NONE       FPA        TRUE      NONE
						     
PPSTAMP.OUTPUT      	OUTPUT {OUTPUT}.fits         IMAGE     NONE       FPA        TRUE      SIMPLE
PPSTAMP.CHIP        	OUTPUT {OUTPUT}.ch.fits      IMAGE     NONE       CHIP       FALSE     SIMPLE
						     
PPSIM.OUTPUT        	OUTPUT {OUTPUT}.fits         IMAGE     NONE       FPA        TRUE      SIMPLE
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      NONE
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     NONE       FPA        TRUE      SIMPLE
PPARITH.OUTPUT.MASK   	OUTPUT {OUTPUT}.fits         MASK      NONE       FPA        TRUE      SIMPLE

LOG.IMFILE            	OUTPUT {OUTPUT}.imfile.log   TEXT      NONE       FPA        TRUE      NONE
LOG.EXP               	OUTPUT {OUTPUT}.exp.log      TEXT      NONE       FPA        TRUE      NONE

TRACE.IMFILE          	OUTPUT {OUTPUT}.imfile.trace TEXT      NONE       FPA        TRUE      NONE
TRACE.EXP             	OUTPUT {OUTPUT}.exp.trace    TEXT      NONE       FPA        TRUE      NONE
