Index: /trunk/ippconfig/isp/camera.config
===================================================================
--- /trunk/ippconfig/isp/camera.config	(revision 7894)
+++ /trunk/ippconfig/isp/camera.config	(revision 7894)
@@ -0,0 +1,87 @@
+# Camera configuration file for drop-dead boring camera, consisting of a single chip with single cell.
+
+# File formats that we know about
+FORMATS         METADATA
+	SIMPLE	STR	simple/format.config
+END
+ 
+ 
+# Description of camera --- all the chips and the cells that comprise them
+FPA     METADATA
+        Chip		STR	Cell
+END
+
+# Recipe options
+RECIPES		METADATA
+	PHASE2		STR	simple/phase2.config		# Phase 2 recipe details
+	PSPHOT		STR	simple/psphot.config		# psphot details
+	PSASTRO		STR	simple/psastro.config		# psastro details
+END
+
+FILERULES METADATA
+   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                 FILENAME.XTRA EXTNAME.RULE EXTNAME.XTRA FILE.TYPE DATA.LEVEL 
+   PPIMAGE.INPUT      INPUT    none.fits                     NONE          NONE         NONE         IMAGE     FPA        
+
+   PPIMAGE.BIAS       INPUT    bias.fits                     NONE          NONE         NONE         IMAGE     CHIP       
+   PPIMAGE.DARK       INPUT    dark.fits                     NONE          NONE         NONE         IMAGE     CHIP       
+   PPIMAGE.FLAT       INPUT    flat.fits                     NONE          NONE         NONE         IMAGE     CHIP       
+   PPIMAGE.MASK       INPUT    mask.fits                     NONE          NONE         NONE         IMAGE     CHIP       
+
+   PSPHOT.INPUT       INPUT    none.fits                     NONE          NONE         NONE         IMAGE     CHIP       
+
+   PSASTRO.INPUT.CMP  INPUT    none.fits                     NONE          NONE         PHU          CMP       CHIP       
+   PSASTRO.INPUT.CMF  INPUT    none.fits                     NONE          SMPDATA      PHU          CMF       CHIP       
+
+   ### output file definitions
+   TYPE                OUTPUT   FILENAME.RULE      FILENAME.XTRA EXTNAME.RULE EXTNAME.XTRA FILE.TYPE FILE.LEVEL DATA.LEVEL FILE.SAVE FILE.FORMAT
+   PPIMAGE.OUTPUT      OUTPUT   {OUTPUT}.fit       NONE   	 NONE         NONE         IMAGE     FPA        FPA        TRUE      NONE
+   PPIMAGE.OUTPUT.CHIP OUTPUT 	{OUTPUT}.ch.fit    NONE   	 NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
+   PPIMAGE.OUTPUT.FPA1 OUTPUT 	{OUTPUT}.b1.fit    NONE   	 NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
+   PPIMAGE.OUTPUT.FPA2 OUTPUT 	{OUTPUT}.b2.fit    NONE   	 NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
+
+   PPIMAGE.BIN1        OUTPUT   {OUTPUT}.B1.fit    NONE          NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
+   PPIMAGE.BIN2        OUTPUT   {OUTPUT}.B2.fit    NONE          NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
+   PPIMAGE.JPEG1       OUTPUT   {OUTPUT}.b1.jpg    -greyscale    RANGE        -5:20        JPEG      FPA        FPA        TRUE      SIMPLE
+   PPIMAGE.JPEG2       OUTPUT   {OUTPUT}.b2.jpg    -greyscale    FRACTION     0.50:2.00    JPEG      FPA        FPA        TRUE      SIMPLE
+
+   PSPHOT.RESID        OUTPUT   {OUTPUT}.res.fits  NONE          NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
+   PSPHOT.BACKGND      OUTPUT   {OUTPUT}.bck.fits  NONE          NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
+   PSPHOT.BACKSUB      OUTPUT   {OUTPUT}.sub.fits  NONE          NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
+   PSPHOT.BACKMDL      OUTPUT   {OUTPUT}.mdl.fits  NONE          NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
+   PSPHOT.OUTPUT.RAW   OUTPUT   {OUTPUT}           NONE          NONE         NONE         RAW       FPA       	FPA        TRUE      NONE
+   PSPHOT.OUTPUT.SX    OUTPUT   {OUTPUT}.sx        NONE          NONE         NONE         SX        FPA       	FPA        TRUE      NONE
+   PSPHOT.OUTPUT.OBJ   OUTPUT   {OUTPUT}.obj       NONE          NONE         NONE         OBJ       FPA       	FPA        TRUE      NONE
+   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
+
+   PSASTRO.OUTPUT.CMP  OUTPUT   {OUTPUT}.smp       NONE          NONE         NONE         CMP       FPA       	FPA        TRUE      NONE
+END
+
+# FPA file defines properties of a possible input|output object
+# user can set the filename (I|O), filename rules (O), or abstract source (@FILES, @DETDB) (I) 
+# user can set the extension name, if used
+# user can set the file type (IMAGE, JPEG, RAW, SX, OBJ, CMP, CMF) : but these are not variable in most cases!
+# user can set the file mode (READ, WRITE), but these must be set by the programmer
+# user can set the file depth: only valid for output files
+# user can set the data depth: must be >= file depth
+# user can set the file format: only valid for newly created FPAs
+# user can set the colormap, scaling method, scaling range (JPEG only)
+# user can set the extension name for the data and header segments (CMF only)
+
+# known uses of the filename.xtra, extname.rule, and extname.xtra:
+# extname.rule: used to construct output EXTNAME keys (CMF DATA)
+# extname.xtra: used to construct output EXTNAME keys (CMF HEAD)
+
+# extname.rule: used to carry classID to DetDB
+# filename.xtra: used to carry detID to DetDB (internal)
+
+# filename.xtra: used to carry arglist name (internal)
+
+# filename.xtra: used to define the JPEG colormap
+# extname.rule: used to define the JPEG scaling method
+# extname.xtra: used to carry arguments of JPEG scaling method
Index: /trunk/ippconfig/isp/format.config
===================================================================
--- /trunk/ippconfig/isp/format.config	(revision 7894)
+++ /trunk/ippconfig/isp/format.config	(revision 7894)
@@ -0,0 +1,76 @@
+# Drop-dead simple camera with single chip with single cell
+
+# How to identify this type
+RULE	METADATA
+	SIMPLE		BOOL	TRUE
+	NAXIS		S32	2
+END
+
+# How to read this data
+FILE	METADATA
+	PHU		STR	FPA	# The FITS file represents an entire FPA
+	EXTENSIONS	STR	NONE	# There are no extensions
+	FPA.NAME	STR	SEQID	# A PHU keyword for unique identifier within the hierarchy level
+END
+
+# What's in the FITS file?
+CONTENTS	STR	Chip:Cell:amplifier
+
+# Specify the cell data
+CELLS	METADATA
+	amplifier	METADATA
+		CELL.TRIMSEC.SOURCE	STR	VALUE
+		CELL.BIASSEC.SOURCE	STR	VALUE
+		CELL.TRIMSEC		STR	[1:2048,1:2048]
+		CELL.BIASSEC		STR	[2049:2098,1:2048]
+	END
+END
+
+# How to translate PS concepts into FITS headers
+TRANSLATION	METADATA
+	FPA.FILTER	STR	FILTNAME
+	CELL.EXPOSURE	STR	EXPTIME
+	CELL.DARKTIME	STR	EXPTIME		# Doesn't seem to be a concept of "dark time", so use EXPTIME
+	CELL.TIME	STR	MJD-OBS
+
+### These aren't in the header, but probably should be
+#	FPA.AIRMASS	STR	AIRMASS
+#	FPA.POSANGLE	STR	POSANG
+#	FPA.RA		STR	OBJ-RA
+#	FPA.DEC		STR	OBJ-DEC
+#	CELL.XBIN	STR	CCDSUM
+#	CELL.YBIN	STR	CCDSUM
+END
+
+# Default PS concepts that may be specified by value
+DEFAULTS	METADATA
+	FPA.RADECSYS	STR	ICRS
+	CELL.SATURATION	F32	65535
+	CELL.BAD	F32	0
+	CELL.READDIR	S32	1
+	CELL.TIMESYS	STR	UTC
+	CHIP.XPARITY	S32	1
+	CHIP.YPARITY	S32	1
+	CHIP.X0		S32	0
+	CHIP.Y0		S32	0
+	CELL.XPARITY	S32	1
+	CELL.YPARITY	S32	1
+	CELL.X0		S32	0
+	CELL.Y0		S32	0
+
+### I hope these end up in the header or somewhere more sensible
+	FPA.AIRMASS	F32	0.0
+	FPA.POSANGLE	F32	0.0
+	FPA.RA		F32	0.0
+	FPA.DEC		F32	0.0
+	CELL.XBIN	S32	1
+	CELL.YBIN	S32	1	
+	CELL.GAIN	F32	1.0
+	CELL.READNOISE	F32	0.0
+END
+
+FORMATS		METADATA
+	FPA.RA		STR	HOURS
+	FPA.DEC		STR	DEGREES
+	CELL.TIME	STR	MJD
+END
Index: /trunk/ippconfig/isp/phase2.config
===================================================================
--- /trunk/ippconfig/isp/phase2.config	(revision 7894)
+++ /trunk/ippconfig/isp/phase2.config	(revision 7894)
@@ -0,0 +1,79 @@
+### Phase 2 recipe configuration file
+
+# List of tasks to perform
+MASK		BOOL	FALSE		# Mask bad pixels
+NONLIN		BOOL	FALSE		# Non-linearity correction
+OVERSCAN	BOOL	FALSE		# Overscan subtraction
+BIAS		BOOL	FALSE		# Bias subtraction
+DARK		BOOL	FALSE		# Dark subtraction
+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?
+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?
+BIN2.JPEG	BOOL	TRUE		# 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
+BIN1.YBIN		S32	8
+BIN2.XBIN		S32	64
+BIN2.YBIN		S32	64
Index: /trunk/ippconfig/isp/psastro.config
===================================================================
--- /trunk/ippconfig/isp/psastro.config	(revision 7894)
+++ /trunk/ippconfig/isp/psastro.config	(revision 7894)
@@ -0,0 +1,36 @@
+
+# astrometry matching parameters
+
+# nominal plate scale (microns / pixel)
+# PSASTRO.PLATE.SCALE    F32  13.5
+PSASTRO.PLATE.SCALE    F32  1.0
+
+# pmAstromGridMatch:
+PSASTRO.GRID.MIN.ANGLE F32 -0.0851
+PSASTRO.GRID.MAX.ANGLE F32 +0.0851
+PSASTRO.GRID.DEL.ANGLE F32  0.0170
+
+# pmAstromGridAngle
+# max grid offset in FP units (microns)
+# use plate-scale to make this in pixels?
+# PSASTRO.GRID.OFFSET    F32  10000.
+# PSASTRO.GRID.SCALE     F32    500.
+PSASTRO.GRID.OFFSET    F32   1000.
+PSASTRO.GRID.SCALE     F32     50
+
+# these tweak are in FP units (pixels, currently)
+PSASTRO.TWEAK.SCALE     F32      1
+PSASTRO.TWEAK.RANGE     F32     75
+PSASTRO.TWEAK.SMOOTH    F32      2
+PSASTRO.TWEAK.NSIGMA    F32      3
+
+# pmAstromRadiusMatch
+# use plate-scale to make this in pixels?
+PSASTRO.MATCH.RADIUS   F32    8
+
+# pmAstromMatchFit
+PSASTRO.CHIP.NX        S32      1  # fit order
+PSASTRO.CHIP.NY        S32      1  # fit order
+PSASTRO.CHIP.NITER     S32      3  # fit clipping iterations
+PSASTRO.CHIP.NSIGMA    F32      3  # fit clipping sigmas
+
Index: /trunk/ippconfig/isp/psphot.config
===================================================================
--- /trunk/ippconfig/isp/psphot.config	(revision 7894)
+++ /trunk/ippconfig/isp/psphot.config	(revision 7894)
@@ -0,0 +1,90 @@
+
+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
+
+# 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
+
+# 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
