Index: trunk/ippconfig/mcshort_chip/camera.config
===================================================================
--- trunk/ippconfig/mcshort_chip/camera.config	(revision 8894)
+++ trunk/ippconfig/mcshort_chip/camera.config	(revision 8894)
@@ -0,0 +1,158 @@
+# File formats that we know about (these are relative to PATH)
+FORMATS		METADATA
+	MOSAIC	STR	mcshort_chip/format_mosaic.config
+END
+
+
+# Description of camera --- all the chips and the cells that comprise them
+FPA	METADATA
+#	ccd00	STR	Cell
+#	ccd01	STR	Cell
+#	ccd02	STR	Cell
+#	ccd03	STR	Cell
+#	ccd04	STR	Cell
+#	ccd05	STR	Cell
+#	ccd06	STR	Cell
+#	ccd07	STR	Cell
+#	ccd08	STR	Cell
+#	ccd09	STR	Cell
+#	ccd10	STR	Cell
+#	ccd11	STR	Cell
+	ccd12	STR	Cell
+	ccd13	STR	Cell
+	ccd14	STR	Cell
+#	ccd15	STR	Cell
+#	ccd16	STR	Cell
+#	ccd17	STR	Cell
+#	ccd18	STR	Cell
+#	ccd19	STR	Cell
+#	ccd20	STR	Cell
+	ccd21	STR	Cell
+	ccd22	STR	Cell
+	ccd23	STR	Cell
+#	ccd24	STR	Cell
+#	ccd25	STR	Cell
+#	ccd26	STR	Cell
+#	ccd27	STR	Cell
+#	ccd28	STR	Cell
+#	ccd29	STR	Cell
+#	ccd30	STR	Cell
+#	ccd31	STR	Cell
+#	ccd32	STR	Cell
+#	ccd33	STR	Cell
+#	ccd34	STR	Cell
+#	ccd35	STR	Cell
+END
+
+# move this elsewhere?  we need a lookup table to go from filter ID to abstract name
+FILTER.ID	METADATA
+   u.MP9301  	STR u
+   g.MP9401  	STR g
+   r.MP9601  	STR r
+   i.MP9701  	STR i
+   z.MP9801  	STR z
+   Zp        	STR z
+   Zprime    	STR z
+   Ha.MP7605 	STR Ha
+   Halpha 	STR Ha
+   Haalpha.on	STR Ha
+   HaOFF.MP7604 STR HaOff
+
+   CN.MP780     STR CN
+   cn.MP7803    STR CN
+   CN.MP7803    STR CN
+
+   TiO.MP77     STR TiO
+   tio.MP7701   STR TiO
+   TiO.MP7701   STR TiO
+   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
+	# Recipes for ppImage
+        PPIMAGE         STR     mcshort/ppImage.config          # Default: all (normal) options on
+	PPIMAGE_O	STR	mcshort/ppImage_o.config	# Overscan only
+	PPIMAGE_OB	STR	mcshort/ppImage_ob.config	# Overscan, bias only
+	PPIMAGE_OBD	STR	mcshort/ppImage_obd.config	# Overscan, bias, dark only
+	PPIMAGE_OBDF	STR	mcshort/ppImage_obdf.config	# Overscan, bias, dark, flat only
+	PPIMAGE_B	STR	mcshort/ppImage_b.config	# Bias only
+	PPIMAGE_D	STR	mcshort/ppImage_d.config	# Dark only
+	PPIMAGE_F	STR	mcshort/ppImage_f.config	# Flat only
+	PPIMAGE_J	STR	mcshort/ppImage_j.config	# JPEG only
+
+	# Recipes for ppMerge
+	PPMERGE_BIAS	STR	mcshort/ppMerge_bias.config
+	# Other recipes
+        PPMERGE         STR     ppMerge_template.config         # ppMerge recipe
+        PSPHOT          STR     mcshort/psphot.config           # psphot details
+        PSASTRO         STR     mcshort/psastro.config          # psastro details
+	PPSTATS		STR	mcshort/ppStats.config		# ppStats recipe
+	PPSTATS_PHASE0	STR	mcshort/ppStats_phase0.config	# ppStats recipe for phase 0
+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                 FILENAME.XTRA EXTNAME.RULE EXTNAME.XTRA DATA.LEVEL FILE.TYPE 
+   PPIMAGE.INPUT      INPUT @FILES                        {CHIP.NAME}   {CELL.NAME}  NONE         CHIP       IMAGE
+   PPARITH.INPUT      INPUT @FILES                        {CHIP.NAME}   {CELL.NAME}  NONE         CHIP       IMAGE
+
+   ### use these entries to get the detrend images from specific files
+   PPIMAGE.MASK       INPUT mask.mef.fits                 {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE     
+   PPIMAGE.BIAS       INPUT bias_mc_1_0.{CHIP.NAME}.fit   {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE     
+   PPIMAGE.DARK       INPUT dark_mc_1_0.{CHIP.NAME}.fit   {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE     
+   PPIMAGE.FLAT       INPUT flat_mc_1_0.{CHIP.NAME}.fit   {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE     
+
+   ### 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                       fpa           fpa          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      OUTPUT {OUTPUT}.{CHIP.NAME}.fit      {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      NONE
+   PPIMAGE.BIN1        OUTPUT {OUTPUT}.{CHIP.NAME}.b1.fit   {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      NONE
+   PPIMAGE.BIN2        OUTPUT {OUTPUT}.{CHIP.NAME}.b2.fit   {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      NONE
+
+   PPIMAGE.OUTPUT.CHIP OUTPUT {OUTPUT}.{CHIP.NAME}.chip.fit {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      NONE
+   PPIMAGE.OUTPUT.FPA1 OUTPUT {OUTPUT}.b1.fit               NONE          NONE         NONE         FPA        FPA        IMAGE     TRUE      MCSHORT_FPA:MOSAIC
+   PPIMAGE.OUTPUT.FPA2 OUTPUT {OUTPUT}.b2.fit               NONE          NONE         NONE         FPA        FPA        IMAGE     TRUE      MCSHORT_FPA:MOSAIC
+
+   PPIMAGE.JPEG1       OUTPUT {OUTPUT}.b1.jpg               -greyscale    RANGE        -5:20        FPA        FPA        JPEG      TRUE      MCSHORT_FPA:MOSAIC
+   PPIMAGE.JPEG2       OUTPUT {OUTPUT}.b2.jpg               -greyscale    FRACTION     0.50:2.00    FPA        FPA        JPEG      TRUE      MCSHORT_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
+
+   PPARITH.OUTPUT      OUTPUT {OUTPUT}.{CHIP.NAME}.fit      {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      NONE
+
+END
Index: trunk/ippconfig/mcshort_chip/format_mosaic.config
===================================================================
--- trunk/ippconfig/mcshort_chip/format_mosaic.config	(revision 8894)
+++ trunk/ippconfig/mcshort_chip/format_mosaic.config	(revision 8894)
@@ -0,0 +1,200 @@
+# The spliced MecaCam data is stored in single extensions for each chip
+
+# How to recognise this type
+RULE	METADATA
+	TELESCOP	STR	CFHT 3.6m
+	DETECTOR	STR	MegaCam Mosaicked:Chip
+END
+
+FILE	METADATA
+	# How to read this data
+	PHU		STR	CHIP	# The FITS file represents an entire FPA
+	EXTENSIONS	STR	NONE	# The extensions represent chips
+	FPA.NAME	STR	EXPNUM	# A PHU keyword for unique identifier
+	CHIP.NAME	STR	EXTNAME	# A PHU keyword for unique identifier
+	CONTENT		STR	{CHIP.NAME} # A string to index the CONTENTS menu; required because EXT=NONE
+END
+
+# What's in the FITS file?
+CONTENTS	METADATA
+	# Extension name, chip name:component cell
+#	ccd00		STR	ccd00:Cell:mosaic
+#	ccd01		STR	ccd01:Cell:mosaic
+#	ccd02		STR	ccd02:Cell:mosaic
+#	ccd03		STR	ccd03:Cell:mosaic
+#	ccd04		STR	ccd04:Cell:mosaic
+#	ccd05		STR	ccd05:Cell:mosaic
+#	ccd06		STR	ccd06:Cell:mosaic
+#	ccd07		STR	ccd07:Cell:mosaic
+#	ccd08		STR	ccd08:Cell:mosaic
+#	ccd09		STR	ccd09:Cell:mosaic
+#	ccd10		STR	ccd10:Cell:mosaic
+#	ccd11		STR	ccd11:Cell:mosaic
+	ccd12		STR	ccd12:Cell:mosaic
+	ccd13		STR	ccd13:Cell:mosaic
+	ccd14		STR	ccd14:Cell:mosaic
+#	ccd15		STR	ccd15:Cell:mosaic
+#	ccd16		STR	ccd16:Cell:mosaic
+#	ccd17		STR	ccd17:Cell:mosaic
+#	ccd18		STR	ccd18:Cell:mosaic
+#	ccd19		STR	ccd19:Cell:mosaic
+#	ccd20		STR	ccd20:Cell:mosaic
+	ccd21		STR	ccd21:Cell:mosaic
+	ccd22		STR	ccd22:Cell:mosaic
+	ccd23		STR	ccd23:Cell:mosaic
+#	ccd24		STR	ccd24:Cell:mosaic
+#	ccd25		STR	ccd25:Cell:mosaic
+#	ccd26		STR	ccd26:Cell:mosaic
+#	ccd27		STR	ccd27:Cell:mosaic
+#	ccd28		STR	ccd28:Cell:mosaic
+#	ccd29		STR	ccd29:Cell:mosaic
+#	ccd30		STR	ccd30:Cell:mosaic
+#	ccd31		STR	ccd31:Cell:mosaic
+#	ccd32		STR	ccd32:Cell:mosaic
+#	ccd33		STR	ccd33:Cell:mosaic
+#	ccd34		STR	ccd34:Cell:mosaic
+#	ccd35		STR	ccd35:Cell:mosaic
+END
+
+# Specify the cells
+CELLS		METADATA
+	mosaic		METADATA
+		CELL.BIASSEC.SOURCE	STR	HEADER
+		CELL.TRIMSEC.SOURCE	STR	HEADER
+		CELL.BIASSEC		STR	BIASSEC
+		CELL.TRIMSEC		STR	TRIMSEC
+	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
+        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.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.TIMESYS		STR	UTC
+	CELL.XPARITY		S32	1
+	CELL.YPARITY		S32	1
+	CELL.X0			S32	0
+	CELL.Y0			S32	0
+
+	CHIP.XPARITY		S32	1
+	CHIP.YPARITY		S32	1
+	CHIP.X0.DEPEND		STR	CHIP.NAME
+	CHIP.X0		METADATA
+#		ccd00	S32	
+#		ccd01	S32
+#		ccd02	S32
+#		ccd03	S32
+#		ccd04	S32
+#		ccd05	S32
+#		ccd06	S32
+#		ccd07	S32
+#		ccd08	S32
+#		ccd09	S32
+#		ccd10	S32
+#		ccd11	S32
+		ccd12	S32	0
+		ccd13	S32	2048
+		ccd14	S32	4096
+#		ccd15	S32
+#		ccd16	S32
+#		ccd17	S32
+#		ccd18	S32
+#		ccd19	S32
+#		ccd20	S32
+		ccd21	S32	0
+		ccd22	S32	2048
+		ccd23	S32	4096
+#		ccd24	S32
+#		ccd25	S32
+#		ccd26	S32
+#		ccd27	S32
+#		ccd28	S32
+#		ccd29	S32
+#		ccd30	S32
+#		ccd31	S32
+#		ccd32	S32
+#		ccd33	S32
+#		ccd34	S32
+#		ccd35	S32
+	END
+	CHIP.Y0.DEPEND		STR	CHIP.NAME
+	CHIP.Y0		METADATA
+#		ccd00	S32	
+#		ccd01	S32
+#		ccd02	S32
+#		ccd03	S32
+#		ccd04	S32
+#		ccd05	S32
+#		ccd06	S32
+#		ccd07	S32
+#		ccd08	S32
+#		ccd09	S32
+#		ccd10	S32
+#		ccd11	S32
+		ccd12	S32	9223
+		ccd13	S32	9223
+		ccd14	S32	9223
+#		ccd15	S32
+#		ccd16	S32
+#		ccd17	S32
+#		ccd18	S32
+#		ccd19	S32
+#		ccd20	S32
+		ccd21	S32	0
+		ccd22	S32	0
+		ccd23	S32	0
+#		ccd24	S32
+#		ccd25	S32
+#		ccd26	S32
+#		ccd27	S32
+#		ccd28	S32
+#		ccd29	S32
+#		ccd30	S32
+#		ccd31	S32
+#		ccd32	S32
+#		ccd33	S32
+#		ccd34	S32
+#		ccd35	S32
+	END
+END
+
+
+# How to translation PS concepts into database lookups
+DATABASE	METADATA
+	TYPE		dbEntry		TABLE		COLUMN		GIVENDBCOL	GIVENPS
+#	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
+	CELL.TIME	STR	MJD
+END
+
+
Index: trunk/ippconfig/mcshort_fpa/camera.config
===================================================================
--- trunk/ippconfig/mcshort_fpa/camera.config	(revision 8894)
+++ trunk/ippconfig/mcshort_fpa/camera.config	(revision 8894)
@@ -0,0 +1,94 @@
+# Camera configuration file for MegaCam: describes the camera
+
+# File formats that we know about (these are relative to PATH)
+FORMATS		METADATA
+	MOSAIC	STR	mcshort_fpa/format_mosaic.config
+END
+
+
+# Description of camera --- all the chips and the cells that comprise them
+FPA	METADATA
+	Chip	STR	Cell
+END
+
+
+# Recipe options
+RECIPES		METADATA
+	# Recipes for ppImage
+        PPIMAGE         STR     mcshort/ppImage.config          # Default: all (normal) options on
+	PPIMAGE_O	STR	mcshort/ppImage_o.config	# Overscan only
+	PPIMAGE_OB	STR	mcshort/ppImage_ob.config	# Overscan, bias only
+	PPIMAGE_OBD	STR	mcshort/ppImage_obd.config	# Overscan, bias, dark only
+	PPIMAGE_OBDF	STR	mcshort/ppImage_obdf.config	# Overscan, bias, dark, flat only
+	PPIMAGE_B	STR	mcshort/ppImage_b.config	# Bias only
+	PPIMAGE_D	STR	mcshort/ppImage_d.config	# Dark only
+	PPIMAGE_F	STR	mcshort/ppImage_f.config	# Flat only
+	PPIMAGE_J	STR	mcshort/ppImage_j.config	# JPEG only
+
+	# Recipes for ppMerge
+	PPMERGE_BIAS	STR	mcshort/ppMerge_bias.config
+	# Other recipes
+        PPMERGE         STR     ppMerge_template.config         # ppMerge recipe
+        PSPHOT          STR     mcshort/psphot.config           # psphot details
+        PSASTRO         STR     mcshort/psastro.config          # psastro details
+	PPSTATS		STR	mcshort/ppStats.config		# ppStats recipe
+	PPSTATS_PHASE0	STR	mcshort/ppStats_phase0.config	# ppStats recipe for phase 0
+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                 FILENAME.XTRA EXTNAME.RULE EXTNAME.XTRA DATA.LEVEL FILE.TYPE 
+   PPIMAGE.INPUT      INPUT @FILES                        {CHIP.NAME}   {CELL.NAME}  NONE         CHIP       IMAGE
+   PPARITH.INPUT      INPUT @FILES                        {CHIP.NAME}   {CELL.NAME}  NONE         CHIP       IMAGE
+
+   ### use these entries to get the detrend images from specific files
+   PPIMAGE.MASK       INPUT mask.mef.fits                 {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE     
+   PPIMAGE.BIAS       INPUT bias_mc_1_0.{CHIP.NAME}.fit   {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE     
+   PPIMAGE.DARK       INPUT dark_mc_1_0.{CHIP.NAME}.fit   {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE     
+   PPIMAGE.FLAT       INPUT flat_mc_1_0.{CHIP.NAME}.fit   {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE     
+
+   ### 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                       fpa           fpa          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      OUTPUT {OUTPUT}.{CHIP.NAME}.fit      {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      NONE
+   PPIMAGE.BIN1        OUTPUT {OUTPUT}.{CHIP.NAME}.b1.fit   {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      NONE
+   PPIMAGE.BIN2        OUTPUT {OUTPUT}.{CHIP.NAME}.b2.fit   {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      NONE
+
+   PPIMAGE.OUTPUT.CHIP OUTPUT {OUTPUT}.{CHIP.NAME}.chip.fit {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      NONE
+   PPIMAGE.OUTPUT.FPA1 OUTPUT {OUTPUT}.b1.fit               NONE          NONE         NONE         FPA        FPA        IMAGE     TRUE      NONE
+   PPIMAGE.OUTPUT.FPA2 OUTPUT {OUTPUT}.b2.fit               NONE          NONE         NONE         FPA        FPA        IMAGE     TRUE      NONE
+
+   PPIMAGE.JPEG1       OUTPUT {OUTPUT}.b1.jpg               -greyscale    RANGE        -5:20        FPA        FPA        JPEG      TRUE      NONE
+   PPIMAGE.JPEG2       OUTPUT {OUTPUT}.b2.jpg               -greyscale    FRACTION     0.50:2.00    FPA        FPA        JPEG      TRUE      NONE
+
+   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
+
+   PPARITH.OUTPUT      OUTPUT {OUTPUT}.{CHIP.NAME}.fit      {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       CHIP       IMAGE     TRUE      NONE
+
+END
Index: trunk/ippconfig/mcshort_fpa/format_mosaic.config
===================================================================
--- trunk/ippconfig/mcshort_fpa/format_mosaic.config	(revision 8894)
+++ trunk/ippconfig/mcshort_fpa/format_mosaic.config	(revision 8894)
@@ -0,0 +1,83 @@
+# The spliced MecaCam data is stored in single extensions for each chip
+
+# How to recognise this type
+RULE	METADATA
+	TELESCOP	STR	CFHT 3.6m
+	DETECTOR	STR	MegaCam Mosaicked:FPA
+END
+
+FILE	METADATA
+	# How to read this data
+	PHU		STR	FPA	# The FITS file represents an entire FPA
+	EXTENSIONS	STR	NONE	# The extensions represent chips
+	FPA.NAME	STR	EXPNUM	# A PHU keyword for unique identifier
+END
+
+# What's in the FITS file?
+CONTENTS	STR	Chip:Cell:mosaic
+
+# Specify the cells
+CELLS		METADATA
+	mosaic		METADATA
+		CELL.BIASSEC.SOURCE	STR	HEADER
+		CELL.TRIMSEC.SOURCE	STR	HEADER
+		CELL.BIASSEC		STR	BIASSEC
+		CELL.TRIMSEC		STR	TRIMSEC
+	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
+        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.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.TIMESYS		STR	UTC
+	CELL.XPARITY		S32	1
+	CELL.YPARITY		S32	1
+	CHIP.XPARITY		S32	1
+	CHIP.YPARITY		S32	1
+	CHIP.X0			S32	0
+	CHIP.X0			S32	0
+	CELL.X0			S32	0
+	CELL.Y0			S32	0
+END
+
+
+# How to translation PS concepts into database lookups
+DATABASE	METADATA
+	TYPE		dbEntry		TABLE		COLUMN		GIVENDBCOL	GIVENPS
+#	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
+	CELL.TIME	STR	MJD
+END
+
+
