Index: /trunk/ippconfig/ctio_mosaic2/camera.config
===================================================================
--- /trunk/ippconfig/ctio_mosaic2/camera.config	(revision 10461)
+++ /trunk/ippconfig/ctio_mosaic2/camera.config	(revision 10461)
@@ -0,0 +1,152 @@
+# Camera configuration file for MegaCam: describes the camera
+
+# File formats that we know about
+FORMATS		METADATA
+    MOSAIC	STR	ctio_mosaic2/format.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
+END
+
+
+# move this elsewhere?  we need a lookup table to go from filter ID to abstract name
+FILTER.ID       METADATA
+   VR.Supermacho.c6027 STR VR
+END
+
+# Recipe options
+RECIPES		METADATA
+	# Recipes for ppImage
+        PPIMAGE         STR     ctio_mosaic2/ppImage.config          # Default: all (normal) options on
+	#PPIMAGE_OBDSFR	STR	megacam/ppImage_obdsfr.config	# Overscan, bias, dark, shutter, flat, fringe
+	#PPIMAGE_B	STR	megacam/ppImage_b.config	# Bias only
+	#PPIMAGE_D	STR	megacam/ppImage_d.config	# Dark only
+	#PPIMAGE_S	STR	megacam/ppImage_n.config	# NOTHING --- no need for shutter yet
+	#PPIMAGE_F	STR	megacam/ppImage_f.config	# Flat only
+	#PPIMAGE_R	STR	megacam/ppImage_r.config	# Fringe only
+	#PPIMAGE_J1	STR	megacam/ppImage_j1.config	# JPEG only; binning 1
+	#PPIMAGE_J2	STR	megacam/ppImage_j2.config	# JPEG only; binning 2
+	#PPIMAGE_N	STR	megacam/ppImage_n.config	# Nothing significant; binning only
+
+	# Recipes for ppMerge
+        #PPMERGE         STR     ctio_mosaic2/ppMerge_template.config         # ppMerge recipe
+	#PPMERGE_BIAS	STR	megacam/ppMerge_bias.config
+	#PPMERGE_DARK	STR	megacam/ppMerge_dark.config
+	#PPMERGE_FLAT	STR	megacam/ppMerge_flat.config
+	#PPMERGE_FRINGE	STR	megacam/ppMerge_fringe.config
+
+	# Other recipes
+        #PSPHOT          STR     megacam/psphot.config           # psphot details
+        #PSASTRO         STR     megacam/psastro.config          # psastro details
+	#PPSTATS		STR	megacam/ppStats.config		# ppStats recipe
+END
+
+
+# Rejection levels for detrend creation
+REJECTION	METADATA
+	TYPE	LIMITS	FILTER	EXPECTED	IMFILE.MEAN	IMFILE.STDEV	EXP.MEAN	EXP.STDEV	EXP.MEANSTDEV	ENSEMBLE.MEAN	ENSEMBLE.STDEV	ENSEMBLE.MEANSTDEV
+	FLAT	MULTI
+
+	BIAS	LIMITS	*	0		0		15		0		15		0		0		0		0
+	DARK	LIMITS	*	0		0		0		0		0		0		0		0		0
+	FLAT	LIMITS	*	0		0		0		0		0		0		0		0		0
+#	FLAT	LIMITS	u	0		0		0		0		0		0		0		0		0
+#	FLAT	LIMITS	g	0		0		0		0		0		0		0		0		0
+#	FLAT	LIMITS	r	0		0		0		0		0		0		0		0		0
+#	FLAT	LIMITS	i	0		0		0		0		0		0		0		0		0
+#	FLAT	LIMITS	z	0		0		0		0		0		0		0		0		0
+	FRINGE	LIMITS	*	0		0		0		0		0		0		0		0		0
+
+# FILTER is an additional qualifier, and may be "*" (or absent!), in which case it matches everything
+# EXPECTED is the expected mean value
+# IMFILE.MEAN is the maximum permitted mean value for an imfile
+# IMFILE.STDEV is the maximum permitted standard deviation for an imfile
+# EXP.MEAN is the maximum permitted mean value for an exposure
+# EXP.STDEV is the maximum permitted standard deviation for an exposure
+# EXP.MEANSTDEV is the maximum permitted mean standard deviation for an exposure
+# ENSEMBLE.MEAN is the maximum permitted mean for an ensemble of exposures
+# ENSEMBLE.STDEV is the maximum permitted standard deviation for an ensemble of exposures
+# ENSEMBLE.MEANSTDEV is the maximum permitted mean standard deviation for an ensemble of exposures
+# These values (all except FILTER) may be zero, in which case no clipping is applied.
+
+END
+		
+
+FILERULES METADATA
+   ### Redirections
+   PSASTRO.INPUT      STR PSASTRO.INPUT.CMP
+   PSASTRO.OUTPUT     STR PSASTRO.OUTPUT.CMP
+   PSPHOT.OUTPUT      STR PSPHOT.OUTPUT.CMF
+   PPIMAGE.OUTPUT     STR PPIMAGE.OUTPUT.SPL
+   PPIMAGE.BIN1       STR PPIMAGE.BIN1.SPL
+   PPIMAGE.BIN2       STR PPIMAGE.BIN2.SPL
+
+   ### input file definitions
+   TYPE               INPUT FILENAME.RULE                 FILENAME.XTRA EXTNAME.RULE EXTNAME.XTRA DATA.LEVEL FILE.TYPE 
+   PPIMAGE.INPUT      INPUT @FILES                        {CHIP.NAME}   {CELL.NAME}  NONE         CHIP       IMAGE
+
+   ### use these entries to get the detrend images from specific files
+   PPIMAGE.MASK       INPUT megacam/mask.{CHIP.NAME}.fits                  {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       MASK     
+   PPIMAGE.BIAS       INPUT megacam/bias/MEGACAM.bias.norm.1.0.{CHIP.NAME}.fits {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE     
+   PPIMAGE.DARK       INPUT megacam/MEGACAM.dark.norm.2.0.{CHIP.NAME}.fits {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE     
+   PPIMAGE.FLAT       INPUT megacam/MEGACAM.flat.norm.3.0.{CHIP.NAME}.fits {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE     
+   PPIMAGE.FRINGE     INPUT megacam/MEGACAM.fringe.norm.4.0.{CHIP.NAME}.fits {CHIP.NAME} {CHIP.NAME}  NONE         CHIP       FRINGE     
+
+   ### use these entries to get the detrend images from the database
+   #PPIMAGE.MASK       INPUT @DETDB                       {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE
+   #PPIMAGE.BIAS       INPUT @DETDB                        {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE
+   #PPIMAGE.DARK       INPUT @DETDB                       {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE
+   #PPIMAGE.FLAT       INPUT @DETDB                       {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE
+
+   PSPHOT.INPUT       INPUT @FILES                        {CHIP.NAME}   {CELL.NAME}  NONE         CHIP       IMAGE     
+
+   PSASTRO.INPUT.CMP  INPUT @FILES                        NONE          NONE         PHU          CHIP       CMP       
+   PSASTRO.INPUT.CMF  INPUT @FILES                        NONE          SMPDATA      PHU          CHIP       CMF       
+
+   ### output file definitions
+   TYPE                OUTPUT FILENAME.RULE                 FILENAME.XTRA EXTNAME.RULE EXTNAME.XTRA FILE.LEVEL DATA.LEVEL FILE.TYPE FILE.SAVE FILE.FORMAT
+   PPIMAGE.OUTPUT.SPL  OUTPUT {OUTPUT}.{CHIP.NAME}.fits      {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      NONE
+   PPIMAGE.OUTPUT.MEF  OUTPUT {OUTPUT}.fits                  {CHIP.NAME}   {CHIP.NAME}  NONE         FPA        CHIP       IMAGE     TRUE      NONE
+   PPIMAGE.OUTPUT.MASK OUTPUT {OUTPUT}.{CHIP.NAME}.mask.fits {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       MASK      FALSE      NONE
+   PPIMAGE.OUTPUT.WEIGHT OUTPUT {OUTPUT}.{CHIP.NAME}.wt.fits {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       WEIGHT    FALSE      NONE
+   PPIMAGE.BIN1.SPL    OUTPUT {OUTPUT}.{CHIP.NAME}.b1.fits   {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      MEGACAM_CHIP:MOSAIC
+   PPIMAGE.BIN2.SPL    OUTPUT {OUTPUT}.{CHIP.NAME}.b2.fits   {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      MEGACAM_CHIP:MOSAIC
+   PPIMAGE.BIN1.MEF    OUTPUT {OUTPUT}.b1.fits               NONE          NONE         NONE         FPA        CHIP       IMAGE     TRUE      MEGACAM_CHIP:MOSAIC
+   PPIMAGE.BIN2.MEF    OUTPUT {OUTPUT}.b2.fits               NONE          NONE         NONE         FPA        CHIP       IMAGE     TRUE      MEGACAM_CHIP:MOSAIC
+
+   PPIMAGE.OUTPUT.CHIP OUTPUT {OUTPUT}.{CHIP.NAME}.chip.fits {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      MEGACAM_CHIP:MOSAIC
+   PPIMAGE.OUTPUT.FPA1 OUTPUT {OUTPUT}.b1.fits               NONE          NONE         NONE         FPA        FPA        IMAGE     TRUE      MEGACAM_FPA:MOSAIC
+   PPIMAGE.OUTPUT.FPA2 OUTPUT {OUTPUT}.b2.fits               NONE          NONE         NONE         FPA        FPA        IMAGE     TRUE      MEGACAM_FPA:MOSAIC
+
+   PPIMAGE.JPEG1       OUTPUT {OUTPUT}.b1.jpg               -greyscale    RANGE        -5:20        FPA        FPA        JPEG      TRUE      MEGACAM_FPA:MOSAIC
+   PPIMAGE.JPEG2       OUTPUT {OUTPUT}.b2.jpg               -greyscale    FRACTION     0.50:2.00    FPA        FPA        JPEG      TRUE      MEGACAM_FPA:MOSAIC
+
+   PSPHOT.RESID        OUTPUT {OUTPUT}.res.fits             NONE          {CELL.NAME}  {CELL.NAME}  CHIP       CHIP       IMAGE     TRUE      SPLICE
+   PSPHOT.BACKGND      OUTPUT {OUTPUT}.bck.fits             NONE          {CELL.NAME}  {CELL.NAME}  CHIP       CHIP       IMAGE     TRUE      SPLICE
+   PSPHOT.BACKSUB      OUTPUT {OUTPUT}.sub.fits             NONE          {CELL.NAME}  {CELL.NAME}  CHIP       CHIP       IMAGE     TRUE      SPLICE
+   PSPHOT.BACKMDL      OUTPUT {OUTPUT}.mdl.fits             NONE          {CELL.NAME}  {CELL.NAME}  CHIP       CHIP       IMAGE     TRUE      SPLICE
+
+   PSPHOT.OUTPUT.RAW   OUTPUT {OUTPUT}.{CHIP.NAME}          NONE          NONE         PHU          CHIP       CHIP       RAW       TRUE      NONE
+   PSPHOT.OUTPUT.SX    OUTPUT {OUTPUT}.sx                   NONE          NONE         PHU          CHIP       CHIP       SX        TRUE      NONE
+   PSPHOT.OUTPUT.OBJ   OUTPUT {OUTPUT}.obj                  NONE          NONE         PHU          CHIP       CHIP       OBJ       TRUE      NONE
+   PSPHOT.OUTPUT.CMF   OUTPUT {OUTPUT}.cmf                  NONE          SMPDATA      PHU          CHIP       CHIP       CMF       TRUE      NONE
+   PSPHOT.OUTPUT.CMP   OUTPUT {OUTPUT}.{CHIP.NAME}.cmp      NONE          NONE         PHU          CHIP       CHIP       CMP       TRUE      NONE
+
+   PSASTRO.OUTPUT.CMP  OUTPUT {OUTPUT}.{CHIP.NAME}.smp      NONE          NONE         PHU          CHIP       CHIP       CMP       TRUE      NONE
+
+# split version of mosaiced-chip output:
+#   PPIMAGE.OUTPUT.CHIP.SPLIT OUTPUT {OUTPUT}.{CHIP.NAME}.mos.fit  {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      MEGACAM_CHIP:MOSAIC
+# mef version of mosaiced-chip output:
+#   PPIMAGE.OUTPUT.CHIP OUTPUT {OUTPUT}.ch.fit               NONE          NONE         NONE         FPA        CHIP       IMAGE     TRUE      MEGACAM_CHIP:MOSAIC
+
+END
Index: /trunk/ippconfig/ctio_mosaic2/format.config
===================================================================
--- /trunk/ippconfig/ctio_mosaic2/format.config	(revision 10461)
+++ /trunk/ippconfig/ctio_mosaic2/format.config	(revision 10461)
@@ -0,0 +1,242 @@
+# format file for CTIO Mosaic2 camera used by ESSENCE
+
+# How to identify this type
+RULE	METADATA
+	TELESCOP	STR	CTIO 4.0 meter telescope
+	DETECTOR	STR	Mosaic2
+	EXTEND		BOOL	T
+	NEXTEND		S32	16
+END
+
+# How to read this data
+FILE	METADATA
+	PHU		STR	FPA	 # The FITS file represents an entire FPA
+	EXTENSIONS	STR	CELL	 # The extensions represent cells
+	FPA.NAME	STR	FILENAME # A PHU keyword for unique identifier within the hierarchy level
+END
+
+# What's in the FITS file?
+CONTENTS	METADATA
+	# Extension name, chip name:type
+	amp00		STR	ccd00:LeftAmp:left
+	amp01		STR	ccd00:RightAmp:right
+	amp02		STR	ccd01:LeftAmp:left
+	amp03		STR	ccd01:RightAmp:right
+	amp04		STR	ccd02:LeftAmp:left
+	amp05		STR	ccd02:RightAmp:right
+	amp06		STR	ccd03:LeftAmp:left
+	amp07		STR	ccd03:RightAmp:right
+	amp08		STR	ccd04:LeftAmp:left
+	amp09		STR	ccd04:RightAmp:right
+	amp10		STR	ccd05:LeftAmp:left
+	amp11		STR	ccd05:RightAmp:right
+	amp12		STR	ccd06:LeftAmp:left
+	amp13		STR	ccd06:RightAmp:right
+	amp14		STR	ccd07:LeftAmp:left
+	amp15		STR	ccd07:RightAmp:right
+	amp16		STR	ccd08:LeftAmp:left
+END
+
+# Specify the cell data
+CELLS	METADATA
+	left	METADATA	# Left amplifier
+		CELL.BIASSEC.SOURCE	STR	HEADER
+		CELL.TRIMSEC.SOURCE	STR	HEADER
+		CELL.BIASSEC		STR	BIASSEC
+		CELL.TRIMSEC		STR	DATASEC
+		CELL.XPARITY		S32	1 # We could have specified this as a DEFAULT, but this works
+		CELL.X0			S32	1
+		CELL.Y0			S32	1
+	END
+	right	METADATA	# Right amplifier
+		CELL.BIASSEC.SOURCE	STR	HEADER
+		CELL.TRIMSEC.SOURCE	STR	HEADER
+		CELL.BIASSEC		STR	BIASSEC
+		CELL.TRIMSEC		STR	DATASEC
+		CELL.XPARITY		S32	-1 # This cell is read out in the opposite direction
+		CELL.X0			S32	2048
+		CELL.Y0			S32	1
+	END
+END
+
+# How to translate PS concepts into FITS headers
+TRANSLATION	METADATA
+	FPA.NAME		STR	EXPNUM
+	FPA.AIRMASS		STR	AIRMASS
+	FPA.FILTER		STR	FILTER
+	FPA.POSANGLE		STR	ROTANGLE
+	FPA.RA			STR	RA
+	FPA.DEC			STR	DEC
+	FPA.RADECSYS		STR	RADECSYS
+	FPA.OBSTYPE		STR	OBSTYPE
+	FPA.OBJECT		STR	CMMTOBS
+	FPA.TIME		STR	MJD-OBS
+	FPA.TIMESYS		STR	TIMESYS
+	FPA.ALT			STR	TELALT
+	FPA.AZ			STR	TELAZ
+	CHIP.TEMP		STR	DETTEM
+	CELL.EXPOSURE		STR	EXPTIME
+	CELL.DARKTIME		STR	DARKTIME
+	CELL.GAIN		STR	GAIN
+	CELL.READNOISE		STR	RDNOISE
+	CELL.SATURATION		STR	SATURATE
+	CELL.TIME		STR	MJD-OBS
+	CELL.TIMESYS		STR	TIMESYS
+	CELL.XBIN		STR	CCDBIN1
+	CELL.YBIN		STR	CCDBIN2
+END
+
+# Default PS concepts that may be specified by value
+DEFAULTS	METADATA
+	CELL.READDIR		S32	1		# Cell is read in x direction
+	CELL.BAD		S32	0
+	CELL.YPARITY		S32	1
+
+	CHIP.X0.DEPEND		STR	CHIP.NAME
+	CHIP.X0		METADATA
+		ccd00	S32	0
+		ccd01	S32	2048
+		ccd02	S32	4096
+		ccd03	S32	6144
+		ccd04	S32	8192
+		ccd05	S32	10240
+		ccd06	S32	12288
+		ccd07	S32	14336
+		ccd08	S32	16384
+		ccd09	S32	0
+		ccd10	S32	2048
+		ccd11	S32	4096
+		ccd12	S32	6144
+		ccd13	S32	8192
+		ccd14	S32	10240
+		ccd15	S32	12288
+		ccd16	S32	14336
+		ccd17	S32	16384
+		ccd18	S32	0
+		ccd19	S32	2048
+		ccd20	S32	4096
+		ccd21	S32	6144
+		ccd22	S32	8192
+		ccd23	S32	10240
+		ccd24	S32	12288
+		ccd25	S32	14336
+		ccd26	S32	16384
+		ccd27	S32	0
+		ccd28	S32	2048
+		ccd29	S32	4096
+		ccd30	S32	6144
+		ccd31	S32	8192
+		ccd32	S32	10240
+		ccd33	S32	12288
+		ccd34	S32	14336
+		ccd35	S32	16384
+	END
+	CHIP.Y0.DEPEND		STR	CHIP.NAME
+	CHIP.Y0		METADATA
+		ccd00	S32	18447
+		ccd01	S32	18447
+		ccd02	S32	18447
+		ccd03	S32	18447
+		ccd04	S32	18447
+		ccd05	S32	18447
+		ccd06	S32	18447
+		ccd07	S32	18447
+		ccd08	S32	18447
+		ccd09	S32	13835
+		ccd10	S32	13835
+		ccd11	S32	13835
+		ccd12	S32	13835
+		ccd13	S32	13835
+		ccd14	S32	13835
+		ccd15	S32	13835
+		ccd16	S32	13835
+		ccd17	S32	13835
+		ccd18	S32	13835
+		ccd19	S32	4612
+		ccd20	S32	4612
+		ccd21	S32	4612
+		ccd22	S32	4612
+		ccd23	S32	4612
+		ccd24	S32	4612
+		ccd25	S32	4612
+		ccd26	S32	4612
+		ccd27	S32	0
+		ccd28	S32	0
+		ccd29	S32	0
+		ccd30	S32	0
+		ccd31	S32	0
+		ccd32	S32	0
+		ccd33	S32	0
+		ccd34	S32	0
+		ccd35	S32	0
+	END
+	CHIP.XPARITY	S32	1
+	CHIP.YPARITY.DEPEND	STR	CHIP.NAME
+	CHIP.YPARITY	METADATA
+		ccd00	S32	-1
+		ccd01	S32	-1
+		ccd02	S32	-1
+		ccd03	S32	-1
+		ccd04	S32	-1
+		ccd05	S32	-1
+		ccd06	S32	-1
+		ccd07	S32	-1
+		ccd08	S32	-1
+		ccd09	S32	-1
+		ccd10	S32	-1
+		ccd11	S32	-1
+		ccd12	S32	-1
+		ccd13	S32	-1
+		ccd14	S32	-1
+		ccd15	S32	-1
+		ccd16	S32	-1
+		ccd17	S32	-1
+		ccd18	S32	1
+		ccd19	S32	1
+		ccd20	S32	1
+		ccd21	S32	1
+		ccd22	S32	1
+		ccd23	S32	1
+		ccd24	S32	1
+		ccd25	S32	1
+		ccd26	S32	1
+		ccd27	S32	1
+		ccd28	S32	1
+		ccd29	S32	1
+		ccd30	S32	1
+		ccd31	S32	1
+		ccd32	S32	1
+		ccd33	S32	1
+		ccd34	S32	1
+		ccd35	S32	1
+	END
+END
+
+# How to translation PS concepts into database lookups
+DATABASE	METADATA
+	TYPE		dbEntry		TABLE		COLUMN		GIVENDBCOL	GIVENPS
+#	FPA.BIAS	METADATA
+#		TABLE	STR	Camera
+#		COLUMN	STR	gain
+#		chipId	STR	{CHIP.NAME}
+#		cellId	STR	{CELL.NAME}
+#		time	STR	{CELL.TIME}
+#	END
+#	CELL.GAIN	dbEntry		Camera		gain		chipId,cellId	CHIP.NAME,CELL.NAME
+#	CELL.READNOISE	dbEntry		Camera		readNoise	chipId,cellId	CHIP.NAME,CELL.NAME
+
+# A database entry refers to a particular column (COLUMN) in a
+# particular table (TABLE), given certain PS concepts (GIVENPS) that
+# match certain database columns (GIVENDBCOL).
+END
+
+
+# Where there might be some ambiguity, specify the format
+FORMATS		METADATA
+	FPA.RA		STR	HOURS
+	FPA.DEC		STR	DEGREES
+	FPA.TIME	STR	MJD
+	CELL.TIME	STR	MJD
+	CELL.X0		STR	FORTRAN
+	CELL.Y0		STR	FORTRAN
+END
Index: /trunk/ippconfig/ctio_mosaic2/ppImage.config
===================================================================
--- /trunk/ippconfig/ctio_mosaic2/ppImage.config	(revision 10461)
+++ /trunk/ippconfig/ctio_mosaic2/ppImage.config	(revision 10461)
@@ -0,0 +1,77 @@
+### Phase 2 recipe configuration file
+
+# List of tasks to perform
+NONLIN          BOOL    FALSE           # Non-linearity correction
+SHUTTER         BOOL    FALSE           # Shutter correction
+
+BASE.FITS       BOOL    TRUE            # Save base detrended image?
+BIN1.FITS	BOOL    TRUE            # Save 1st binned chip image?
+BIN2.FITS	BOOL    TRUE		# Save 2nd binned chip image?
+
+# binned output image options
+BIN1.XBIN               S32     8
+BIN1.YBIN               S32     8
+BIN2.XBIN               S32     64
+BIN2.YBIN               S32     64
+
+# the following entries define alternate recipe values loaded symbollically
+PPIMAGE_O         METADATA
+  MASK            BOOL    FALSE           # Mask bad pixels
+  MASK.VALUE      U8      0xff            # only mask pixels matching this bitmask
+  NONLIN          BOOL    FALSE           # Non-linearity correction
+  OVERSCAN        BOOL    TRUE            # Overscan subtraction
+  BIAS            BOOL    FALSE           # Bias subtraction
+  DARK            BOOL    FALSE           # Dark subtraction
+  SHUTTER         BOOL    FALSE           # Shutter correction
+  FLAT            BOOL    FALSE           # Flat-field normalisation
+  FRINGE          BOOL    FALSE           # Fringe subtraction
+END
+
+PPIMAGE_OB        METADATA
+  MASK            BOOL    FALSE           # Mask bad pixels
+  MASK.VALUE      U8      0xff            # only mask pixels matching this bitmask
+  NONLIN          BOOL    FALSE           # Non-linearity correction
+  OVERSCAN        BOOL    TRUE            # Overscan subtraction
+  BIAS            BOOL    TRUE            # Bias subtraction
+  DARK            BOOL    FALSE           # Dark subtraction
+  SHUTTER         BOOL    FALSE           # Shutter correction
+  FLAT            BOOL    FALSE           # Flat-field normalisation
+  FRINGE          BOOL    FALSE           # Fringe subtraction
+END
+
+PPIMAGE_OBD      METADATA
+  MASK            BOOL    FALSE           # Mask bad pixels
+  MASK.VALUE      U8      0xff            # only mask pixels matching this bitmask
+  NONLIN          BOOL    FALSE           # Non-linearity correction
+  OVERSCAN        BOOL    TRUE            # Overscan subtraction
+  BIAS            BOOL    TRUE            # Bias subtraction
+  DARK            BOOL    TRUE            # Dark subtraction
+  SHUTTER         BOOL    FALSE           # Shutter correction
+  FLAT            BOOL    FALSE           # Flat-field normalisation
+  FRINGE          BOOL    FALSE           # Fringe subtraction
+END
+
+PPIMAGE_OBDS      METADATA
+  MASK            BOOL    FALSE           # Mask bad pixels
+  MASK.VALUE      U8      0xff            # only mask pixels matching this bitmask
+  NONLIN          BOOL    FALSE           # Non-linearity correction
+  OVERSCAN        BOOL    TRUE            # Overscan subtraction
+  BIAS            BOOL    TRUE            # Bias subtraction
+  DARK            BOOL    TRUE            # Dark subtraction
+  SHUTTER         BOOL    FALSE           # Shutter correction
+  FLAT            BOOL    FALSE           # Flat-field normalisation
+  FRINGE          BOOL    FALSE           # Fringe subtraction
+END
+
+PPIMAGE_OBDSF     METADATA
+  MASK            BOOL    FALSE           # Mask bad pixels
+  MASK.VALUE      U8      0xff            # only mask pixels matching this bitmask
+  NONLIN          BOOL    FALSE           # Non-linearity correction
+  OVERSCAN        BOOL    TRUE            # Overscan subtraction
+  BIAS            BOOL    TRUE            # Bias subtraction
+  DARK            BOOL    TRUE            # Dark subtraction
+  SHUTTER         BOOL    FALSE           # Shutter correction
+  FLAT            BOOL    TRUE            # Flat-field normalisation
+  FRINGE          BOOL    FALSE           # Fringe subtraction
+END
+
Index: /trunk/ippconfig/ipprc.config
===================================================================
--- /trunk/ippconfig/ipprc.config	(revision 10460)
+++ /trunk/ippconfig/ipprc.config	(revision 10461)
@@ -2,5 +2,10 @@
 
 PATH            STR     .:$HOME/.ipp		# Default search path for configuration files
-WORKDIR		STR	$HOME/ippData/		# Top-level working directory
+# WORKDIR	STR	$HOME/ippData/		# Top-level working directory: we will retire this
+
+# place your data directories here and refer to as path://PATH/remainder
+DATAPATH	METADATA
+	DATA1	STR	/data/alala/
+END
 
 ### Database configuration
@@ -12,7 +17,4 @@
 ### Setups for each camera system
 CAMERAS		METADATA
-	MCSHORT		STR	mcshort/camera.config
-	MCSHORT_CHIP	STR	mcshort_chip/camera.config
-	MCSHORT_FPA	STR	mcshort_fpa/camera.config
 	MEGACAM		STR	megacam/camera.config
 	MEGACAM_CHIP	STR	megacam_chipmosaic/camera.config
@@ -26,4 +28,8 @@
 	ISP      	STR	isp/camera.config
 	SIMPLE		STR	simple/camera.config
+
+	MCSHORT		STR	mcshort/camera.config
+	MCSHORT_CHIP	STR	mcshort_chip/camera.config
+	MCSHORT_FPA	STR	mcshort_fpa/camera.config
 	# move the MCSHORTs to the top to force its selection 
 END
@@ -40,5 +46,8 @@
 
 RECIPES		METADATA		# Site-level recipes
-	PPMERGE		STR		ppMerge_template.config	# Recipe for combination
-	PPSTATS_PHASE0	STR		ppStats_phase0.config	# Recipe for phase 0 processing
+	PSPHOT		STR     	recipes/psphot.config
+	PPMERGE		STR		recipes/ppMerge.config	# Recipe for combination
 END
+
+
+# 	PPSTATS_PHASE0	STR		recipes/ppStats_phase0.config	# Recipe for phase 0 processing
Index: /trunk/ippconfig/isp/camera.config
===================================================================
--- /trunk/ippconfig/isp/camera.config	(revision 10460)
+++ /trunk/ippconfig/isp/camera.config	(revision 10461)
@@ -84,5 +84,5 @@
    PSASTRO.INPUT      STR PSASTRO.INPUT.CMP
    PSASTRO.OUTPUT     STR PSASTRO.OUTPUT.CMP
-   PSPHOT.OUTPUT      STR PSPHOT.OUTPUT.CMP
+   PSPHOT.OUTPUT      STR PSPHOT.OUTPUT.RAW
 
    ### input file definitions
@@ -133,4 +133,7 @@
    PSPHOT.PSF.SAVE     OUTPUT   {OUTPUT}.psf         NONE          NONE         NONE         PSF       FPA        FPA        TRUE      NONE
 
+   PSPHOT.MOMENT.PLT   OUTPUT   {OUTPUT}.mnt.png     NONE          NONE         NONE         KAPA      FPA        FPA        TRUE      NONE
+   PSPHOT.PSFMODEL.PLT OUTPUT   {OUTPUT}.psf.png     NONE          NONE         NONE         KAPA      FPA        FPA        TRUE      ISP
+
    PSASTRO.OUTPUT.CMP  OUTPUT   {OUTPUT}.smp         NONE          NONE         NONE         CMP       FPA        FPA        TRUE      NONE
 END
Index: /trunk/ippconfig/isp/ppImage.config
===================================================================
--- /trunk/ippconfig/isp/ppImage.config	(revision 10460)
+++ /trunk/ippconfig/isp/ppImage.config	(revision 10461)
@@ -1,17 +1,8 @@
-### Phase 2 recipe configuration file
+### Phase 2 recipe configuration file - only include differences from recipes/ppImage.config
 
 # List of tasks to perform
-MASK		BOOL	FALSE		# Mask bad pixels
-MASK.VALUE      U8      0xff            # only mask pixels matching this bitmask
-NONLIN		BOOL	FALSE		# Non-linearity correction
-OVERSCAN	BOOL	TRUE		# Overscan subtraction
-BIAS		BOOL	TRUE		# Bias subtraction
-DARK		BOOL	TRUE		# Dark subtraction
+# turn shutter on when we have a valid shutter correction frame
 SHUTTER		BOOL	FALSE		# Shutter correction
-FLAT		BOOL	TRUE		# Flat-field normalisation
 FRINGE		BOOL	FALSE		# Fringe subtraction
-PHOTOM		BOOL	FALSE		# Source identification and photometry
-ASTROM.CHIP	BOOL	FALSE
-ASTROM.MOSAIC	BOOL	FALSE		# Astrometry
 
 BASE.FITS       BOOL    TRUE            # Save base detrended image?
@@ -19,59 +10,8 @@
 FPA1.FITS       BOOL   	TRUE            # Save 1st binned fpa image? 
 FPA2.FITS       BOOL   	TRUE            # Save 2nd binned fpa image? 
-BIN1.FITS	BOOL	TRUE		# Save 1st binned chip image?
-BIN2.FITS	BOOL	TRUE		# Save 2nd binned chip image?
-BIN1.JPEG	BOOL	TRUE		# Save 1st binned jpeg?
+BIN1.FITS	BOOL	FALSE		# Save 1st binned chip image?
+BIN2.FITS	BOOL	FALSE		# Save 2nd binned chip image?
+BIN1.JPEG	BOOL	FALSE		# Save 1st binned jpeg?
 BIN2.JPEG	BOOL	FALSE		# Save 2nd binned jpeg?
-
-# Non-linearity correction
-NONLIN.SOURCE		STR	CHIP.NAME	# How to determine the source
-#@NONLIN.DATA		F32	0.0 1.001 0.001	# A polynomial
-NONLIN.DATA		STR	nonlin.dat	# Filename for lookup table
-#NONLIN.DATA		METADATA		# Source of non-linearity data
-#	ccd00		STR	nonlin00.dat	# A lookup table 
-#	@ccd01		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd02		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd03		F32	1.2345 		# A polynomial
-#	@ccd04		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd05		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd06		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd07		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd08		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd09		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd10		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd11		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd12		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd13		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd14		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd15		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd16		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd17		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd18		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd19		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd10		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd21		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd22		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd23		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd24		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd25		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd26		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd27		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd28		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd29		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd30		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd31		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd32		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd33		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd34		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd35		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd36		F32	0.0 1.001 0.001	# A polynomial
-#END
-
-# Overscan subtraction
-OVERSCAN.SINGLE		BOOL	FALSE		# Reduce overscan to a single value?
-#OVERSCAN.FIT		STR	SPLINE		# NONE | POLYNOMIAL | SPLINE
-OVERSCAN.FIT		STR	POLYNOMIAL	# NONE | POLYNOMIAL | SPLINE
-OVERSCAN.ORDER		S32	5		# Order of polynomial fit
-OVERSCAN.STAT		STR	MEAN		# MEAN | MEDIAN
 
 # binned output image options
Index: /trunk/ippconfig/isp/ppImage_b.config
===================================================================
--- /trunk/ippconfig/isp/ppImage_b.config	(revision 10460)
+++ /trunk/ippconfig/isp/ppImage_b.config	(revision 10461)
@@ -2,7 +2,4 @@
 
 # List of tasks to perform
-MASK		BOOL	FALSE		# Mask bad pixels
-MASK.VALUE      U8      0xff            # only mask pixels matching this bitmask
-NONLIN		BOOL	FALSE		# Non-linearity correction
 OVERSCAN	BOOL	FALSE		# Overscan subtraction
 BIAS		BOOL	TRUE		# Bias subtraction
@@ -11,7 +8,4 @@
 FLAT		BOOL	FALSE		# Flat-field normalisation
 FRINGE		BOOL	FALSE		# Fringe subtraction
-PHOTOM		BOOL	FALSE		# Source identification and photometry
-ASTROM.CHIP	BOOL	FALSE
-ASTROM.MOSAIC	BOOL	FALSE		# Astrometry
 
 BASE.FITS       BOOL    TRUE            # Save base detrended image?
@@ -24,55 +18,4 @@
 BIN2.JPEG	BOOL	FALSE		# Save 2nd binned jpeg?
 
-# Non-linearity correction
-NONLIN.SOURCE		STR	CHIP.NAME	# How to determine the source
-#@NONLIN.DATA		F32	0.0 1.001 0.001	# A polynomial
-NONLIN.DATA		STR	nonlin.dat	# Filename for lookup table
-#NONLIN.DATA		METADATA		# Source of non-linearity data
-#	ccd00		STR	nonlin00.dat	# A lookup table 
-#	@ccd01		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd02		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd03		F32	1.2345 		# A polynomial
-#	@ccd04		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd05		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd06		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd07		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd08		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd09		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd10		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd11		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd12		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd13		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd14		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd15		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd16		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd17		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd18		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd19		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd10		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd21		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd22		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd23		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd24		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd25		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd26		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd27		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd28		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd29		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd30		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd31		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd32		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd33		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd34		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd35		F32	0.0 1.001 0.001	# A polynomial
-#	@ccd36		F32	0.0 1.001 0.001	# A polynomial
-#END
-
-# Overscan subtraction
-OVERSCAN.SINGLE		BOOL	FALSE		# Reduce overscan to a single value?
-#OVERSCAN.FIT		STR	SPLINE		# NONE | POLYNOMIAL | SPLINE
-OVERSCAN.FIT		STR	POLYNOMIAL	# NONE | POLYNOMIAL | SPLINE
-OVERSCAN.ORDER		S32	5		# Order of polynomial fit
-OVERSCAN.STAT		STR	MEAN		# MEAN | MEDIAN
-
 # binned output image options
 BIN1.XBIN		S32	8
Index: /trunk/ippconfig/isp/psphot.config
===================================================================
--- /trunk/ippconfig/isp/psphot.config	(revision 10460)
+++ /trunk/ippconfig/isp/psphot.config	(revision 10461)
@@ -4,5 +4,5 @@
 #SAVE.BACKGND	BOOL 	TRUE
 #SAVE.BACKSUB	BOOL 	TRUE
-#SAVE.RESID	BOOL 	TRUE
+SAVE.RESID	BOOL 	TRUE
 #SAVE.PSF	BOOL 	TRUE
 
@@ -32,5 +32,5 @@
 PEAKS_SMOOTH_SIGMA  F32  1.0       	 # smoothing kernel sigma in pixels
 PEAKS_SMOOTH_NSIGMA F32  3.0   	   	 # smoothing kernel width in sigmas
-PEAKS_NSIGMA_LIMIT  F32  25.0 	   	 # peak significance threshold
+PEAKS_NSIGMA_LIMIT  F32  2.0 	   	 # peak significance threshold
 
 # basic object statistics
@@ -38,5 +38,6 @@
 SKY_OUTER_RADIUS    F32  25		 # square annulus for local sky measurement
 PSF_MOMENTS_RADIUS  F32  3               # calculate initial source moments with this radius
-PSF_SN_LIM          F32  50             # minimum S/N for stars used for PSF model
+PSF_SN_LIM          F32  25              # minimum S/N for stars used for PSF model
+PSF_CLUMP_NSIGMA    F32  3               # size of PSF clump in image (use a larger number for images with large PSF variations)
 PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
 
@@ -44,8 +45,8 @@
 # list as many PSF_MODEL options as desired
 # PSF_MODEL         MULTI
-# PSF_MODEL         STR  PS_MODEL_QGAUSS
+PSF_MODEL         STR  PS_MODEL_QGAUSS
 # PSF_MODEL         STR  PS_MODEL_GAUSS
-PSF_MODEL           STR  PS_MODEL_PGAUSS
-# PSF_MODEL         STR  PS_MODEL_TGAUSS  ## not well tested, not very successful
+# PSF_MODEL         STR  PS_MODEL_PGAUSS
+# PSF_MODEL           STR  PS_MODEL_TEST1
 
 MOMENTS_SCALE       F32   0.1
@@ -92,8 +93,8 @@
 
 # BREAK_POINT may be one of (PEAKS, MOMENTS, PSFMODEL, ENSEMBLE)
-# BREAK_POINT         STR  ENSEMBLE
+BREAK_POINT         STR  MOMENTS
 
 # PEAKS_OUTPUT_FILE   STR  peaks.dat
-# MOMENTS_OUTPUT_FILE STR  moments.dat
+MOMENTS_OUTPUT_FILE STR  moments.dat
 # ANALYSIS_REGION     STR  [1000:1600,2800:3400]
 # POISSON_ERRORS      BOOL TRUE
@@ -125,3 +126,2 @@
    NELEMENTS            S32   2                # number of unmasked components
 END  # folder for 4D polynomial
-
Index: /trunk/ippconfig/recipes/ppImage.config
===================================================================
--- /trunk/ippconfig/recipes/ppImage.config	(revision 10460)
+++ /trunk/ippconfig/recipes/ppImage.config	(revision 10461)
@@ -2,13 +2,13 @@
 
 # List of tasks to perform
-MASK		BOOL	FALSE		# Mask bad pixels
+MASK		BOOL	TRUE		# Mask bad pixels
 MASK.VALUE      U8      0xff            # only mask pixels matching this bitmask
-NONLIN		BOOL	FALSE		# Non-linearity correction
+NONLIN		BOOL	TRUE		# Non-linearity correction
 OVERSCAN	BOOL	TRUE		# Overscan subtraction
 BIAS		BOOL	TRUE		# Bias subtraction
 DARK		BOOL	TRUE		# Dark subtraction
-SHUTTER		BOOL	FALSE		# Shutter correction
+SHUTTER		BOOL	TRUE		# Shutter correction
 FLAT		BOOL	TRUE		# Flat-field normalisation
-FRINGE		BOOL	FALSE		# Fringe subtraction
+FRINGE		BOOL	TRUE		# Fringe subtraction
 PHOTOM		BOOL	FALSE		# Source identification and photometry
 ASTROM.CHIP	BOOL	FALSE		# Astrometry per chip?
@@ -17,10 +17,10 @@
 # output data formats to save
 BASE.FITS       BOOL    TRUE            # Save base detrended image?
-CHIP.FITS       BOOL   	TRUE            # Save chip-mosaic-ed image? 
-FPA1.FITS       BOOL   	TRUE            # Save 1st binned fpa image? 
-FPA2.FITS       BOOL   	TRUE            # Save 2nd binned fpa image? 
-BIN1.FITS	BOOL	TRUE		# Save 1st binned chip image?
-BIN2.FITS	BOOL	TRUE		# Save 2nd binned chip image?
-BIN1.JPEG	BOOL	TRUE		# Save 1st binned jpeg?
+CHIP.FITS       BOOL   	FALSE           # Save chip-mosaic-ed image? 
+FPA1.FITS       BOOL   	FALSE           # Save 1st binned fpa image? 
+FPA2.FITS       BOOL   	FALSE           # Save 2nd binned fpa image? 
+BIN1.FITS	BOOL	FALSE		# Save 1st binned chip image?
+BIN2.FITS	BOOL	FALSE		# Save 2nd binned chip image?
+BIN1.JPEG	BOOL	FALSE		# Save 1st binned jpeg?
 BIN2.JPEG	BOOL	FALSE		# Save 2nd binned jpeg?
 
@@ -50,2 +50,10 @@
 
 PHOTCODE.RULE		STR	{CAMERA}.{FILTER.ID}.{CHIP.N}
+
+## we have three possible choices in this file:
+# 1) turn on all operations and output -- turn off selected ones in camera entries
+# 2) turn off all operations and output -- turn on selected ones in camera entries
+# 3) turn on a 'best guess' set of operations and outputs
+# 
+# for case 3) we could, eg, turn on best guess defaults for a simple camera, and 
+# make the mosaic camera be varients on that, or vice versa
Index: /trunk/ippconfig/recipes/ppStats.config
===================================================================
--- /trunk/ippconfig/recipes/ppStats.config	(revision 10461)
+++ /trunk/ippconfig/recipes/ppStats.config	(revision 10461)
@@ -0,0 +1,24 @@
+### ppStats recipe for Phase 0 with MegaCam
+
+# Options governing statistics
+SAMPLE          F32     0.1     # Fraction of cell to sample
+MASKVAL         U8      0xff    # Mask value to use for statistics
+
+# Define the outputs as MULTI
+HEADER		MULTI
+CONCEPT		MULTI
+STAT		MULTI
+
+# Values to return
+CONCEPT		STR	FPA.OBJECT	# Object name
+CONCEPT		STR	FPA.OBSTYPE	# Observation type
+CONCEPT		STR	FPA.FILTER	# Filter
+CONCEPT		STR	FPA.RA FPA.DEC	# Telescope pointing
+CONCEPT		STR	FPA.AIRMASS	# Airmass
+CONCEPT		STR	FPA.ALT FPA.AZ	# Telescopy alt/az
+CONCEPT		STR	FPA.POSANGLE	# Rotator angle
+CONCEPT		STR	FPA.TIME	# Time of exposure
+CONCEPT		STR	CHIP.TEMP	# Detector temperature
+CONCEPT		STR	CELL.EXPOSURE	# Exposure time
+STAT		STR	ROBUST_MEDIAN	# Background estimator
+STAT		STR	ROBUST_STDEV	# Background standard deviation estimator
Index: /trunk/ippconfig/simple/camera.config
===================================================================
--- /trunk/ippconfig/simple/camera.config	(revision 10460)
+++ /trunk/ippconfig/simple/camera.config	(revision 10461)
@@ -14,7 +14,8 @@
 # Recipe options
 RECIPES		METADATA
-	PHASE2		STR	simple/phase2.config		# Phase 2 recipe details
+#	PHASE2		STR	simple/phase2.config		# Phase 2 recipe details
 	PSPHOT		STR	simple/psphot.config		# psphot details
-	PSASTRO		STR	simple/psastro.config		# psastro details
+	PSPHOT_ALT	STR	simple/psphot_alt.config	# psphot details
+#	PSASTRO		STR	simple/psastro.config		# psastro details
 END
 
@@ -37,4 +38,5 @@
    PSASTRO.INPUT.CMP  INPUT    none.fits                     NONE          NONE         PHU          CMP       CHIP       
    PSASTRO.INPUT.CMF  INPUT    none.fits                     NONE          SMPDATA      PHU          CMF       CHIP       
+   PSPHOT.PSF.LOAD    INPUT   {OUTPUT}.psf       NONE          NONE         NONE         PSF       FPA        FPA        TRUE      NONE
 
    ### output file definitions
@@ -59,4 +61,8 @@
    PSPHOT.OUTPUT.CMP   OUTPUT   {OUTPUT}.cmp       NONE          NONE         NONE         CMP       FPA       	FPA        TRUE      NONE
    PSPHOT.OUTPUT.CMF   OUTPUT   {OUTPUT}.cmf       NONE          SMPDATA      PHU          CMF       FPA        FPA        TRUE      NONE
+   PSPHOT.PSF.SAVE     OUTPUT   {OUTPUT}.psf       NONE          NONE         NONE         PSF       FPA        FPA        TRUE      NONE
+
+   PSPHOT.MOMENT.PLT   OUTPUT   {OUTPUT}.mnt.png   NONE          NONE         NONE         KAPA      FPA        FPA        TRUE      SIMPLE
+   PSPHOT.PSFMODEL.PLT OUTPUT   {OUTPUT}.psf.png   NONE          NONE         NONE         KAPA      FPA        FPA        TRUE      SIMPLE
 
    PSASTRO.OUTPUT.CMP  OUTPUT   {OUTPUT}.smp       NONE          NONE         NONE         CMP       FPA       	FPA        TRUE      NONE
Index: /trunk/ippconfig/simple/format.config
===================================================================
--- /trunk/ippconfig/simple/format.config	(revision 10460)
+++ /trunk/ippconfig/simple/format.config	(revision 10461)
@@ -48,5 +48,5 @@
 	FPA.RADECSYS	STR	ICRS
 	CELL.GAIN	F32	1.0
-	CELL.READNOISE	F32	0.0
+	CELL.READNOISE	F32	2.0
 	CELL.SATURATION	F32	65535
 	CELL.BAD	F32	-65535
Index: /trunk/ippconfig/simple/psphot.config
===================================================================
--- /trunk/ippconfig/simple/psphot.config	(revision 10460)
+++ /trunk/ippconfig/simple/psphot.config	(revision 10461)
@@ -1,90 +1,18 @@
 
-#SAVE.BACKMDL	BOOL 	TRUE
-#SAVE.BACKGND	BOOL 	TRUE
-#SAVE.BACKSUB	BOOL 	TRUE
-#SAVE.RESID	BOOL 	TRUE
-#SAVE.PSF	BOOL 	TRUE
-#LOAD.PSF	BOOL 	FALSE
-
-# image noise parameters
-RDNOISE             STR  HD:RDNOISE      # read-noise in electrons
-GAIN                STR  HD:GAIN         # electrons / DN
-ZERO_POINT          F32  25.000          # zero point used by DVO
-
-# background model : 
-BACKGROUND.XBIN	    S32   128
-BACKGROUND.YBIN	    S32   128
+SAVE.BACKMDL	BOOL 	TRUE
+SAVE.BACKGND	BOOL 	TRUE
+SAVE.BACKSUB	BOOL 	TRUE
+SAVE.RESID	BOOL 	FALSE
+SAVE.PSF	BOOL 	FALSE
+LOAD.PSF	BOOL 	FALSE
 
 # masking parameters
-XMIN                F32   2        	 # minimum valid x-coord
-XMAX                F32   -2        	 # maximum valid x-coord
-YMIN                F32   2        	 # minimum valid y-coord
-YMAX                F32   -2        	 # maximum valid y-coord
-SATURATION          F32  50000     	 # saturation level on this chip
-MIN_VALID_PIXEL     F32      1     	 # saturation level on this chip
+XMIN                F32   0        	 # minimum valid x-coord
+XMAX                F32   0        	 # maximum valid x-coord
+YMIN                F32   0        	 # minimum valid y-coord
+YMAX                F32   0        	 # maximum valid y-coord
 
-# image statistics parameters
-IMSTATS_NPIX        S32  1000    	 # number of pixels to use for sky estimate boxes:
-
-# peak finding 
-PEAKS_SMOOTH_SIGMA  F32  1.0       	 # smoothing kernel sigma in pixels
-PEAKS_SMOOTH_NSIGMA F32  3.0   	   	 # smoothing kernel width in sigmas
-PEAKS_NSIGMA_LIMIT  F32  25.0 	   	 # peak significance threshold
-
-# basic object statistics
-SKY_INNER_RADIUS    F32  15		 # square annulus for local sky measurement
-SKY_OUTER_RADIUS    F32  25		 # square annulus for local sky measurement
-PSF_MOMENTS_RADIUS  F32  3               # calculate initial source moments with this radius
-PSF_SN_LIM          F32  100             # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
-
-# PSF model parameters : choose the PSF model
-# list as many PSF_MODEL options as desired
-# PSF_MODEL           MULTI
-PSF_MODEL           STR  PS_MODEL_QGAUSS
-# PSF_MODEL           STR  PS_MODEL_GAUSS
-# PSF_MODEL           STR  PS_MODEL_PGAUSS
-# PSF_MODEL           STR  PS_MODEL_TGAUSS  ## not well tested, not very successful
-
-MOMENTS_SCALE       F32   0.1
-MOMENTS_SN_MIN      F32   30.0
-MOMENTS_SX_MAX      F32   3.0
-MOMENTS_SY_MAX      F32   3.0
-MOMENTS_AR_MAX      F32   1.5		 # maximum axial ratio: 1 / AR < (sx / sy) < AR
-
-PSF_FIT_RADIUS      F32  15.0	         # fitting radius for test PSF model
-PSF_REF_RADIUS      F32  35.0            # aperture magnitudes are scaled via 
-					 # curve-of-growth to this radius
-# PSF-like source model parameters
-PSF_FIT_NSIGMA       F32  1.0		 # significance for pixel included in fit
-PSF_FIT_PADDING      F32  5.0            # extra annulus to use for fit 
-PSF_SHAPE_NSIGMA     F32  3.0		 # max significance for shape variation
-PSF_MIN_SN           F32  2.0		 # reject objects below this significance
-PSF_MAX_CHI          F32  50.0		 # reject objects worse that this
-
-# EXTended source model parameters
-EXT_MODEL            STR  PS_MODEL_PGAUSS
-EXT_MIN_SN           F32  50.0           # fit galaxies above this S/N limit
-EXT_FIT_NSIGMA       F32  1		 # significance for pixel included in fit
-EXT_FIT_PADDING      F32  10             # extra annulus to use for fit 
-EXT_MOMENTS_RADIUS   F32  9
-
-FITMODE              STR  BLEND
-DEBLEND_PEAK_FRACTION   F32 0.1
-DEBLEND_SKY_NSIGMA      F32 10.0
-
-# APTREND 	     STR CONSTANT
-APTREND 	     STR  ALL
-# APTREND 	     STR  SKYSAT_XY_LIN
-# APTREND 	     STR  SKYSAT
-# APTREND 	     STR  SKYBIAS
-FULL_FIT_SN_LIM      F32  50.0
-AP_MIN_SN            F32  50.0
-
-# test options
-# BREAK_POINT         STR  PEAKS
-# PEAKS_OUTPUT_FILE   STR  peaks.dat
-# MOMENTS_OUTPUT_FILE STR  moments.dat
-# ANALYSIS_REGION     STR  [1000:1600,2800:3400]
-# POISSON_ERRORS      BOOL TRUE
-# SKY_BIAS            F32  0.0
+PSPHOT_TEST METADATA
+ SAVE.BACKSUB	BOOL 	FALSE
+ SAVE.RESID	BOOL 	TRUE
+END
