Index: trunk/psastro/src/psastro.h
===================================================================
--- trunk/psastro/src/psastro.h	(revision 5360)
+++ trunk/psastro/src/psastro.h	(revision 5506)
@@ -3,53 +3,47 @@
 # include <unistd.h>   // for unlink
 # include <pslib.h>
-# include "psLibUtils.h"
-# include "pmObjects_EAM.h"
-# include "psModulesUtils.h"
-# include "pmPSF.h"
-# include "pmPSFtry.h"
-# include "pmModelGroup.h"
 
-typedef struct {
-    psImage *image;
-    psImage *mask;
-    psImage *weight;
-    psMetadata *header;
-} eamReadout;
+typedef struct
+{
+    psProjection *toSky;                ///< Projection from tangent plane to sky
+    psPlaneDistort *toTPA;              ///< Transformation from focal plane to tangent plane
+    psPlaneDistort *fromTPA;            ///< Transformation from focal plane to tangent plane
+    psArray *chips;                     ///< The chips
+}
+pmFPA;
 
-// top-level psphot functions
-psMetadata  *psphotArguments (int *argc, char **argv);
-eamReadout  *psphotSetup (psMetadata *config);
-psStats     *psphotImageStats (eamReadout *imdata, psMetadata *config);
-psArray     *psphotSourceStats (eamReadout *imdata, psMetadata *config, psArray *allpeaks);
-pmPSF       *psphotChoosePSF (psMetadata *config, psArray *sources, psStats *sky);
-bool         psphotApplyPSF (eamReadout *imdata, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky);
-bool         psphotFitGalaxies (eamReadout *imdata, psMetadata *config, psArray *sources, psStats *skyStats);
-void         psphotOutput (eamReadout *imdata, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky);
+typedef struct
+{
+    // Astrometric transformations
+    psPlaneTransform *toFPA;            ///< Transformation from chip to FPA coordinates
+    psPlaneTransform *fromFPA;          ///< Transformation from FPA to chip coordinates
+    psArray *cells;                     ///< The cells
+}
+pmChip;
 
-bool         psphotMarkPSF (pmSource *source, float shapeNsigma, float minSN, float maxChi, float SATURATE);
-bool         psphotSubtractPSF (pmSource *source);
-int 	     psphotSortBySN (const void **a, const void **b);
-int          psphotSaveImage (psMetadata *header, psImage *image, char *filename);
-bool 	     psphotDefinePixels (pmSource *mySource, const eamReadout *imdata, psF32 x, psF32 y, psF32 Radius);
+typedef struct
+{
+    // Astrometric transformations
+    psPlaneTransform *toChip;           ///< Transformations from cell to chip coordinates
+    psArray *readouts;                  ///< The readouts (referred to by number)
+    psMetadata *header;                 ///< header always corresponds to a cell
+}
+pmCell;
 
-psArray     *pmPeaksSigmaLimit (eamReadout *imdata, psMetadata *config, psStats *sky);
-pmModel     *pmSourceMagnitudes (pmSource *source, pmPSF *psf, float apRadius);
-pmModel     *pmSourceSelectModel (pmSource *source);
+typedef struct
+{
+    // Position on the cell
+    int col0;                           ///< Offset from the left of chip.
+    int row0;                           ///< Offset from the bottom of chip.
+    int colBins;                        ///< Amount of binning in x-dimension
+    int rowBins;                        ///< Amount of binning in y-dimension
+    psArray *objects;			///< sources detected / measured on readout
+}
+pmReadout;
 
-// eamReadout functions
-eamReadout *eamReadoutAlloc (psImage *image, psImage *noise, psImage *mask, psMetadata *header);
-
-// output functions
-bool 	     pmSourcesWriteText (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky);
-bool 	     pmSourcesWriteOBJ  (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky);
-bool 	     pmSourcesWriteCMP  (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky);
-bool 	     pmSourcesWriteCMF  (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky);
-bool 	     pmSourcesWriteSX   (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky);
-
-bool 	     pmPeaksWriteText (psArray *sources, char *filename);
-bool 	     pmMomentsWriteText (psArray *sources, char *filename);
-bool 	     pmModelWritePSFs (psArray *sources, psMetadata *config, char *filename, pmPSF *psf);
-bool 	     pmModelWriteFLTs (psArray *sources, char *filename);
-bool 	     pmModelWriteNULLs (psArray *sources, char *filename);
-
-int  	     pmSourcesDophotType (pmSource *source);
+// dummy structure for template code (psFooAlloc, etc)
+typedef struct
+{
+    int i;
+} 
+psFoo;
