Index: trunk/psphot/src/psphot.h
===================================================================
--- trunk/psphot/src/psphot.h	(revision 6056)
+++ trunk/psphot/src/psphot.h	(revision 6117)
@@ -5,4 +5,6 @@
 # include <pmObjects.h>
 # include <pmGrowthCurve.h>
+# include <pmConfig.h>
+# include <pmFPARead.h>
 # include <pmPSF.h>
 # include <pmPSFtry.h>
@@ -11,11 +13,20 @@
 # include "psModulesUtils.h"
 # include "psSparse.h"
+#include "pmFPAConstruct.h"
+
+# define PSPHOT_RECIPE "PSPHOT"
 
 # define psMemCopy(A)(psMemIncrRefCounter((A)))
 
 // top-level psphot functions
-psMetadata     *psphotArguments (int *argc, char **argv);
-pmReadout      *psphotSetup (psMetadata *config, psMetadata **header);
+ppConfig       *psphotArguments (int *argc, char **argv);
+ppFile         *psphotParseCamera (ppConfig *config);
+bool            psphotImageLoop (ppFile *input, ppConfig *config);
+
 bool            psphotModelTest (pmReadout *readout, psMetadata *config);
+bool            psphotReadout (pmReadout *readout, psMetadata *config);
+bool            ppImageLoadPixels (ppFile *input, psDB *db, int chipNum, int cellNum);
+
+// psphotReadout functions
 psStats        *psphotImageStats (pmReadout *readout, psMetadata *config);
 psPolynomial2D *psphotImageBackground (pmReadout *readout, psMetadata *config, psStats *sky);
@@ -25,5 +36,5 @@
 bool            psphotBasicDeblend (psArray *sources, psMetadata *config, psStats *sky);
 pmPSF          *psphotChoosePSF (psMetadata *config, psArray *sources, psStats *sky);
-void            psphotOutput (pmReadout *readout, psMetadata *header, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky);
+void            psphotOutput (pmReadout *readout, psMetadata *config);
 
 // optional object analysis steps
@@ -46,4 +57,5 @@
 bool            psphotGrowthCurve (pmReadout *readout, pmPSF *psf);
 void            psphotTestArguments (int *argc, char **argv);
+bool            pmCellSetMask (pmCell *cell, psMetadata *recipe);
 
 // functions to set the correct source pixels
@@ -56,11 +68,11 @@
 
 // output functions
-bool 	     	pmSourcesWriteText (pmReadout *readout, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky);
-bool 	     	pmSourcesWriteOBJ  (pmReadout *readout, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky);
-bool 	     	pmSourcesWriteCMP  (pmReadout *readout, psMetadata *header, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky);
-bool 	     	pmSourcesWriteCMF  (pmReadout *readout, psMetadata *header, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky);
-bool 	     	pmSourcesWriteSX   (pmReadout *readout, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky);
+bool 	     	pmSourcesWriteSX   (psArray *sources, char *filename);
+bool 	     	pmSourcesWriteOBJ  (psArray *sources, char *filename);
+bool 	     	pmSourcesWriteCMP  (psArray *sources, char *filename, psMetadata *header);
+bool 	     	pmSourcesWriteCMF  (psArray *sources, char *filename, psMetadata *header);
+bool 	     	pmSourcesWriteText (psArray *sources, char *filename);
 
-bool 	     	pmModelWritePSFs (psArray *sources, psMetadata *config, char *filename, pmPSF *psf);
+bool 	     	pmModelWritePSFs (psArray *sources, char *filename);
 bool 	     	pmModelWriteEXTs (psArray *sources, char *filename);
 bool 	     	pmModelWriteNULLs (psArray *sources, char *filename);
@@ -74,4 +86,6 @@
 int  	     	pmSourcesDophotType (pmSource *source);
 bool            psMetadataItemTransfer (psMetadata *out, psMetadata *in, char *key);
+
+bool            psphotMagnitudes (psMetadata *config, psArray *sources, pmPSF *psf);
 
 // PSF / DBL / EXT evaluation functions
@@ -99,4 +113,7 @@
 psPlane         psImageBicubeMin (psPolynomial2D *poly);
 
+bool psImageJpegColormap (char *name);
+bool psImageJpeg (psImage *image, char *filename, float zero, float scale);
+
 // optional mode for clip fit?
 psPolynomial4D *psVectorChiClipFitPolynomial4D(
