Index: trunk/ppImage/src/ppImage.h
===================================================================
--- trunk/ppImage/src/ppImage.h	(revision 6125)
+++ trunk/ppImage/src/ppImage.h	(revision 6260)
@@ -2,11 +2,15 @@
 #define PP_IMAGE_H
 
-#include <stdio.h>
+#include "pslib.h"
+#include "pmFPA.h"
+#include "ppConfig.h"
+#include "ppFile.h"
+#include "ppImageData.h"
+#include "ppImageOptions.h"
+
+
+#if 0
 #include <strings.h>
-
-#include "pslib.h"
-
 #include "psAdditionals.h"
-
 #include "pmFPA.h"
 #include "pmFPAConstruct.h"
@@ -15,107 +19,26 @@
 #include "pmReadout.h"
 #include "pmConfig.h"
-
 #include "pmFlatField.h"
 #include "pmMaskBadPixels.h"
 #include "pmNonLinear.h"
+#include "pmChipMosaic.h"
 #include "pmSubtractBias.h"
-#include "pmChipMosaic.h"
-//#include "pmFPAMorph.h"
-#include "pmSubtractBias.h"
+#endif
+
 
 #define RECIPE "PHASE2"                 // Name of the recipe to use
 #define TIMERNAME "ppImage"             // Name of timer
 
-// How much of the FPA to load at a time
-typedef enum {
-    PP_LOAD_NONE,                       // Don't load anything
-    PP_LOAD_FPA,                        // Load the entire FPA at once
-    PP_LOAD_CHIP,                       // Load by chip
-    PP_LOAD_CELL,                       // Load by cell
-} ppImageLoadDepth;
-
-// Configuration data
-typedef struct {
-    psMetadata *site;                   // The site configuration
-    psMetadata *camera;                 // The camera configuration
-    psMetadata *recipe;                 // The recipe (i.e., specific setups)
-    psMetadata *arguments;              // The command-line arguments
-    psDB       *database;               // Database handle
-} ppConfig;
-
-// Options
-typedef struct {
-    bool doMask;                        // Mask bad pixels
-    bool doBias;                        // Bias subtraction
-    bool doDark;                        // Dark subtraction
-    bool doFlat;                        // Flat-field normalisation
-    bool doFringe;                      // Fringe subtraction
-    bool doSource;                      // Source identification and photometry
-    bool doAstrom;                      // Astrometry
-    bool doOverscan;                    // Overscan subtraction
-    pmOverscanOptions *overscan;        // Overscan options
-    bool doNonLin;                      // Non-linearity correction
-    psDataType nonLinearType;
-    psMetadataItem *nonLinearData;
-    void *nonLinearSource;
-    ppImageLoadDepth imageLoadDepth;    // How much of the FPA to load at once
-} ppOptions;
-
-// A file to process
-typedef struct {
-    char *filename;                     // File name
-    psFits *fits;                       // The FITS file handle
-    psMetadata *phu;                    // The FITS header
-    pmFPA *fpa;                         // The FPA, with pixels and extensions
-} ppFile;
-
-// The data to be processed
-typedef struct {
-    ppFile *input;                      // The input, to be operated upon
-    ppFile *mask;                       // The bad pixel mask image
-    ppFile *bias;                       // The bias correction image
-    ppFile *dark;                       // The dark correction image
-    ppFile *flat;                       // The flat-field correction image
-    ppFile *fringe;                     // The fringe correction image
-    psFits *output;                     // The output file
-#if 0
-    ppFile *process;                    // A dummy file pointing out what needs to be processed
-#endif
-} ppData;
-
-// Cells to be used in the detrend
-typedef struct {
-    pmCell *input;                      // The input cell, to be operated upon
-    pmCell *mask;                       // The bad pixel mask
-    pmCell *bias;                       // The bias correction
-    pmCell *dark;                       // The dark correction
-    pmCell *flat;                       // The flat-field correction
-} ppDetrend;
-
-
-// Allocators
-ppFile *ppFileAlloc(void);
-
-
-
-// Parse the site configuration (and camera and recipe if specified); read the command-line arguments
-bool ppImageConfig(ppConfig *config,   // The configuration(output)
-                   int argc, char **argv // Command-line arguments
-                   );
+// Get the configuration
+bool ppImageConfig(ppConfig *config, int argc, char **argv);
 
 // Determine what type of camera, and initialise
-bool ppImageParseCamera(ppData *data,   // The data to be processed
+bool ppImageParseCamera(ppImageData *data,   // The data to be processed
                         ppConfig *config // Configuration
                         );
 
-// Determine the procession options
-bool ppImageOptions(ppData *data,       // The data to be processed
-                    ppOptions *options, // Processing options
-                    ppConfig *config    // Configuration
-                    );
 
-
-// Loop over the
-bool ppImageLoop(ppData *data, ppOptions *options, ppConfig *config);
+// Loop over the input
+bool ppImageLoop(ppImageData *data, ppImageOptions *options, ppConfig *config);
 
 // Load the pixels for the given file
@@ -126,26 +49,15 @@
                        );
 
-bool ppImageParseDetrend(ppData *data, ppOptions *options, ppConfig *config);
+bool ppImageParseDetrend(ppImageData *data, ppImageOptions *options, ppConfig *config);
 
 bool ppReadoutWeights(pmReadout *readout);
 
-bool ppDetrendCell(ppDetrend *detrend, ppOptions *options, ppConfig *config);
-
-bool ppDetrendMask(pmCell *cell, pmReadout *input, pmReadout *mask);
-bool ppDetrendNonLinear(pmCell *cell, pmReadout *input, ppOptions *options);
-bool ppDetrendNonLinearLookup(pmReadout *input, psMetadataItem *dataItem);
-bool ppDetrendNonLinearPolynomial(pmReadout *input, psMetadataItem *dataItem);
-bool ppDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppOptions *options);
 #if 0
-pmReadout* ppDetrendPedestal(pmReadout *pedestal, pmCell *input, pmReadout *bias, pmReadout *dark, float darkTime, ppOptions *options);
-#endif
-pmReadout* ppDetrendSelectFirst(pmCell *cell, char *name, bool doThis);
-
-#if 0
+// These functions are not implemented, or not needed
+pmReadout* ppDetrendPedestal(pmReadout *pedestal, pmCell *input, pmReadout *bias, pmReadout *dark, float darkTime, ppImageOptions *options);
+bool ppImageOutput(ppImageData *data, ppConfig *config);
+bool ppImagePhot(ppImageData *data, ppImageOptions *options, ppConfig *config);
 bool ppFileOpen(ppFile *fpa, psMetadata *camera, char *name, bool doThis);
 #endif
 
-bool ppImageOutput(ppData *data, ppConfig *config);
-bool ppImagePhot(ppData *data, ppOptions *options, ppConfig *config);
-
 #endif // Pau.
