Index: trunk/ppNoiseMap/configure.ac
===================================================================
--- trunk/ppNoiseMap/configure.ac	(revision 24453)
+++ trunk/ppNoiseMap/configure.ac	(revision 24458)
@@ -23,4 +23,6 @@
 CFLAGS="${CFLAGS=} -Wall -Werror"
 
+IPP_VERSION
+
 AC_SUBST([PPNOISEMAP_CFLAGS])
 AC_SUBST([PPNOISEMAP_LIBS])
Index: trunk/ppNoiseMap/src/Makefile.am
===================================================================
--- trunk/ppNoiseMap/src/Makefile.am	(revision 24453)
+++ trunk/ppNoiseMap/src/Makefile.am	(revision 24458)
@@ -4,5 +4,28 @@
 	ppNoiseMap.h 
 
-ppNoiseMap_CFLAGS = $(PPNOISEMAP_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPNOISEMAP_VERSION=$(SVN_VERSION) -DPPNOISEMAP_BRANCH=$(SVN_BRANCH) -DPPNOISEMAP_SOURCE=$(SVN_SOURCE)
+if HAVE_SVNVERSION
+PPNOISEMAP_VERSION=`$(SVNVERSION) ..`
+else
+PPNOISEMAP_VERSION="UNKNOWN"
+endif
+
+if HAVE_SVN
+PPIMAGE_BRANCH=`$(SVN) info .. | $(SED) -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'`
+PPIMAGE_SOURCE=`$(SVN) info | $(SED) -n -e 's/Repository UUID: // p'`
+else
+PPIMAGE_BRANCH="UNKNOWN"
+PPIMAGE_SOURCE="UNKNOWN"
+endif
+
+# Force recompilation of ppNoiseMapVersion.c, since it gets the version information
+ppNoiseMapVersion.c: ppNoiseMapVersionDefinitions.h
+ppNoiseMapVersionDefinitions.h: ppNoiseMapVersionDefinitions.h.in FORCE
+	-$(RM) ppNoiseMapVersionDefinitions.h
+	$(SED) -e "s|@PPNOISEMAP_VERSION@|\"$(PPNOISEMAP_VERSION)\"|" -e "s|@PPNOISEMAP_BRANCH@|\"$(PPNOISEMAP_BRANCH)\"|" -e "s|@PPNOISEMAP_SOURCE@|\"$(PPNOISEMAP_SOURCE)\"|" ppNoiseMapVersionDefinitions.h.in > ppNoiseMapVersionDefinitions.h
+FORCE: ;
+
+BUILT_SOURCES = ppNoiseMapVersionDefinitions.h
+
+ppNoiseMap_CFLAGS = $(PPNOISEMAP_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
 ppNoiseMap_LDFLAGS = $(PPNOISEMAP_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS)
 ppNoiseMap_SOURCES = \
@@ -12,5 +35,4 @@
 	ppNoiseMapLoop.c \
 	ppNoiseMapCleanup.c \
-	ppNoiseMapFileCheck.c \
 	ppNoiseMapVersion.c \
 	ppNoiseMapDefineFile.c
Index: trunk/ppNoiseMap/src/ppNoiseMap.c
===================================================================
--- trunk/ppNoiseMap/src/ppNoiseMap.c	(revision 24453)
+++ trunk/ppNoiseMap/src/ppNoiseMap.c	(revision 24458)
@@ -14,5 +14,5 @@
     if (config == NULL) {
         psErrorStackPrint(stderr, "Unable to parse command-line arguments.");
-        ppNoiseMapCleanup(config, NULL);
+        ppNoiseMapCleanup(config);
         exit(PS_EXIT_CONFIG_ERROR);
     }
Index: trunk/ppNoiseMap/src/ppNoiseMap.h
===================================================================
--- trunk/ppNoiseMap/src/ppNoiseMap.h	(revision 24453)
+++ trunk/ppNoiseMap/src/ppNoiseMap.h	(revision 24458)
@@ -12,236 +12,37 @@
 #include "pslib.h"
 #include "psmodules.h"
-#include "psphot.h"
-#include "psastro.h"
-#include "ppStats.h"
 
-#define RECIPE_NAME   "PPNOISEMAP"      // Name of the recipe to use
-#define TIMER_TOTAL   "PPNOISE.TOTAL"   // Name of timer for total time
-#define TIMER_DETREND "PPNOISE.DETREND" // Name of timer for detrend time
-#define TIMER_PHOT    "PPNOISE.PHOT"    // Name of timer for photometry time
+#define RECIPE_NAME   "PPNOISEMAP"	 // Name of the recipe to use
+#define TIMER_TOTAL   "PPNOISEMAP.TOTAL" // Name of timer for total time
 
-// Options for ppImage processing
-typedef struct {
-    // actions which ppImage should perform
-    bool doMaskBuild;                   // Build internal mask
-    bool doVarianceBuild;               // Build internal variance map
-    bool doMask;                        // Mask bad pixels
-    bool doNonLin;                      // Non-linearity correction
-    bool doOverscan;                    // Overscan subtraction
-    bool doBias;                        // Bias subtraction
-    bool doDark;                        // Dark subtraction
-    bool doRemnance;                    // Remnance masking
-    bool doShutter;                     // Shutter correction
-    bool doFlat;                        // Flat-field normalisation
-    bool doFringe;                      // Fringe subtraction
-    bool doPhotom;                      // Source identification and photometry
-    bool doBG;                          // Background subtraction
-    bool doAstromChip;                  // per-chip Astrometry
-    bool doAstromMosaic;                // full-mosaic Astrometry
-    bool doStats;                       // call ppStats on the image
-    bool checkCTE;			// measure pixel-based variance
+/// Get the configuration
+pmConfig *ppNoiseMapArguments(int argc, char **argv);
 
-    // output files requested
-    bool BaseFITS;
-    bool BaseMaskFITS;
-    bool BaseVarianceFITS;
+/// Determine what type of camera, and initialise
+bool ppNoiseMapParseCamera(pmConfig *config);
 
-    bool ChipFITS;
-    bool ChipMaskFITS;
-    bool ChipVarianceFITS;
+/// Loop over the input
+bool ppNoiseMapLoop(pmConfig *config);
 
-    bool FPA1FITS;
-    bool FPA2FITS;
-    bool Bin1FITS;
-    bool Bin1JPEG;
-    bool Bin2FITS;
-    bool Bin2JPEG;
+/// free memory, check for leaks
+void ppNoiseMapCleanup (pmConfig *config);
 
-    // make values for abstract concepts of masking
-    psImageMaskType maskValue;          // apply this bit-mask to choose masked bits
-    psImageMaskType markValue;          // apply this bit-mask to choose masked bits
-    psImageMaskType satMask;            // Mask value to give saturated pixels
-    psImageMaskType badMask;            // Mask value to give bad pixels
-    psImageMaskType flatMask;           // Mask value to give bad flat pixels
-    psImageMaskType blankMask;          // Mask value to give blank pixels
-
-    // non-linear correction parameters
-    psDataType nonLinearType;
-    psMetadataItem *nonLinearData;
-    void *nonLinearSource;
-
-    // options for the analysis
-    pmOverscanOptions *overscan;        // Overscan options
-
-    // binning parameters
-    int xBin1;                          // x-binning, scale 1
-    int yBin1;                          // y-binning, scale 1
-    int xBin2;                          // x-binning, scale 2
-    int yBin2;                          // y-binning, scale 2
-
-    // parameters used by the fringe analysis
-    float fringeRej;                    // Fringe rejection limit
-    int fringeIter;                     // Fringe iterations
-    float fringeKeep;                   // Fringe keep fraction
-
-    int remnanceSize;                   // Size for remnance detection
-    float remnanceThresh;               // Threshold for remnance detection
-
-    char *normClass;			// class to use for per-class normalization 
-} ppImageOptions;
-
-// 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
-} ppImageDetrend;
-
-ppImageOptions *ppImageOptionsAlloc(void);
-
-// Determine the processing options
-ppImageOptions *ppImageOptionsParse(pmConfig *config);
-
-// Get the configuration
-pmConfig *ppImageArguments(int argc, char **argv);
-
-// Determine what type of camera, and initialise
-ppImageOptions *ppImageParseCamera(pmConfig *config);
-bool ppImageSetMaskBits (pmConfig *config, ppImageOptions *options);
-
-// Loop over the input
-bool ppImageLoop(pmConfig *config, ppImageOptions *options);
-
-// free memory, check for leaks
-void ppImageCleanup (pmConfig *config, ppImageOptions *options);
-
-// perform the detrend analysis on the current readout
-bool ppImageDetrendReadout (pmConfig *config, ppImageOptions *options, pmFPAview *view);
-
-bool ppImageDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppImageOptions *options);
-
-bool ppImageDetrendNonLinear(pmReadout *input, ppImageOptions *options);
-bool ppImageDetrendNonLinearLookup(pmReadout *input, psMetadataItem *dataItem);
-bool ppImageDetrendNonLinearPolynomial(pmReadout *input, psMetadataItem *dataItem);
-
-bool ppImageDetrendCell(ppImageDetrend *detrend, ppImageOptions *options, pmConfig *config);
-bool ppImageDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppImageOptions *options);
-pmReadout* ppImageDetrendSelectFirst(pmCell *cell, char *name, bool doThis);
-
-bool ppImageDetrendFree(pmConfig *config, pmFPAview *view);
-bool ppImageFringeFree(pmConfig *config, pmFPAview *view);
-
-bool ppImageCheckCTE(pmConfig *config, ppImageOptions *options, pmFPAview *view);
-
-// Record which detrend file was used for the detrending
-bool ppImageDetrendRecord(
-    pmCell *cell,                       // Cell of interest
-    const pmConfig *config,             // Configuration
-    const ppImageOptions *options,      // Processing options
-    const pmFPAview *view               // View to cell
-    );
-
-bool ppImageRebinChip (pmConfig *config, pmFPAview *view, ppImageOptions *options, char *outName);
-
-bool ppImagePhotom (pmConfig *config, pmFPAview *view);
-bool ppImageAstrom (pmConfig *config);
-bool ppImageAddstar (pmConfig *config);
-
-// Subtract background from the chip-mosaicked image
-bool ppImageSubtractBackground(
-    pmConfig *config,                   // Configuration
-    const pmFPAview *view,              // View to chip of interest
-    const ppImageOptions *options       // Processing options
-    );
-
-bool ppImageMosaicChip (pmConfig *config, const ppImageOptions *options, const pmFPAview *view,
-                        const char *outFile, const char *inFile);
-bool ppImageMosaicFPA (pmConfig *config, const ppImageOptions *options,
-                       const char *outFile, const char *inFile);
-
-bool ppImageSetMaskBits (pmConfig *config, ppImageOptions *options);
-
-void ppImageFileCheck (pmConfig *config);
-
-// functions used by ppFocus
-pmConfig *ppFocusArguments(int argc, char **argv);
-ppImageOptions *ppFocusParseCamera (pmConfig *config, int entry);
-bool ppFocusGetFWHM (pmConfig *config, psVector *focus, psVector *fwhm);
-bool ppFocusFitFWHM (pmConfig *config, psVector *focus, psVector *fwhm);
-
-void ppFocusDropCamera (pmConfig *config);
-
-bool ppImageDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType, pmDetrendType detrendType);
-
-// write stats to output file
-bool ppImageStatsOutput(pmConfig *config, // Configuration
-                        psMetadata *stats, // Statistics output
-                        const ppImageOptions *options // Options
-    );
-
-
-// Measure fringes
-bool ppImageDetrendFringeMeasure(pmReadout *readout, // Readout to measure
-                                 pmCell *fringe, // Fringe cell (each readout is a different component)
-                                 const bool isResidual,
-                                 const ppImageOptions *options // Options
-    );
-
-// Solve the fringe system
-bool ppImageDetrendFringeSolve(pmChip *scienceChip, // Chip with science
-                               const pmChip *refChip, // Chip with reference fringes
-                               const bool isResidual,
-                               const ppImageOptions *options // Options
-    );
-
-// Generate fringe frame
-bool ppImageDetrendFringeGenerate(pmCell *science, // Science cell
-                                  pmCell *fringes, // Fringe cell, one readout per fringe component
-                                  const ppImageOptions *options // Options
-    );
-
-
-bool ppImageDetrendFringeApply (pmConfig *config, // config
-                                pmChip *chip, // science chip
-                                const pmFPAview *inputView, // current view
-                                const ppImageOptions *options // options
-    );
+/// define the input files
+bool ppNoiseMapDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType);
 
 /// Return short version information
-psString ppImageVersion(void);
+psString ppNoiseMapVersion(void);
 
 /// Return software source
-psString ppImageSource(void);
+psString ppNoiseMapSource(void);
 
 /// Return long version information
-psString ppImageVersionLong(void);
+psString ppNoiseMapVersionLong(void);
 
 /// Populate the header with version information for all dependencies
-bool ppImageVersionHeader(psMetadata *metadata ///< Header to populate
-    );
+bool ppNoiseMapVersionHeader(psMetadata *header);
 
 /// Print version information
-void ppImageVersionPrint(void);
-
-
-// calculate stats, including MD5
-bool ppImagePixelStats(pmConfig *config,// Configuration
-                       psMetadata *stats, // Statistics output
-                       const ppImageOptions *options, // Options
-                       const pmFPAview *inputView // View to data
-    );
-
-// calculate stats from headers and concepts
-bool ppImageMetadataStats(pmConfig *config, // Configuration
-                          psMetadata *stats, // Statistics output
-                          const ppImageOptions *options // Options
-    );
-
-void ppImageFileCheck(pmConfig *config);
-
-/// Dump memory summary to text file
-void ppImageMemoryDump(const char *description);
+void ppNoiseMapVersionPrint(void);
 
 #endif
Index: trunk/ppNoiseMap/src/ppNoiseMapArguments.c
===================================================================
--- trunk/ppNoiseMap/src/ppNoiseMapArguments.c	(revision 24453)
+++ trunk/ppNoiseMap/src/ppNoiseMapArguments.c	(revision 24458)
@@ -9,6 +9,4 @@
 pmConfig *ppNoiseMapArguments(int argc, char **argv)
 {
-    int argnum;                         // Argument number of interest
-
     if (argc == 1) {
         usage();
Index: trunk/ppNoiseMap/src/ppNoiseMapLoop.c
===================================================================
--- trunk/ppNoiseMap/src/ppNoiseMapLoop.c	(revision 24453)
+++ trunk/ppNoiseMap/src/ppNoiseMapLoop.c	(revision 24458)
@@ -51,5 +51,5 @@
             pmHDU *hdu = pmHDUGetHighest(input->fpa, chip, cell);
             if (hdu && hdu != lastHDU) {
-                ppImageVersionHeader(hdu->header);
+                ppNoiseMapVersionHeader(hdu->header);
                 lastHDU = hdu;
             }
@@ -72,7 +72,7 @@
 
                 // perform the noise analysis
-                if (!ppNoiseMapReadout(config, view)) {
-                    ESCAPE("Unable to detrend readout");
-                }
+                // if (!ppNoiseMapReadout(config, view)) {
+                //     ESCAPE("Unable to detrend readout");
+                // }
 
             }
Index: trunk/ppNoiseMap/src/ppNoiseMapParseCamera.c
===================================================================
--- trunk/ppNoiseMap/src/ppNoiseMapParseCamera.c	(revision 24453)
+++ trunk/ppNoiseMap/src/ppNoiseMapParseCamera.c	(revision 24458)
@@ -2,6 +2,4 @@
 
 bool ppNoiseMapParseCamera(pmConfig *config) {
-
-    bool status = false;
 
     if (!ppNoiseMapDefineFile(config, NULL, "PPNOISEMAP.INPUT", "INPUT", PM_FPA_FILE_IMAGE)) {
@@ -13,5 +11,6 @@
 
     // add recipe options supplied on command line
-    psMetadata *recipe  = psMetadataLookupPtr(&status, config->recipes, RECIPE_NAME);
+    // bool status = false;
+    // psMetadata *recipe  = psMetadataLookupPtr(&status, config->recipes, RECIPE_NAME);
 
     // the following files are output targets
Index: trunk/ppNoiseMap/src/ppNoiseMapVersionDefinitions.h
===================================================================
--- trunk/ppNoiseMap/src/ppNoiseMapVersionDefinitions.h	(revision 24453)
+++ 	(revision )
@@ -1,8 +1,0 @@
-#ifndef PPIMAGE_VERSION_DEFINITIONS_H
-#define PPIMAGE_VERSION_DEFINITIONS_H
-
-#define PPIMAGE_VERSION "24411" // SVN version
-#define PPIMAGE_BRANCH  "trunk/ppImage"  // SVN branch
-#define PPIMAGE_SOURCE  "60eb6cdc-a59c-4636-a4e0-dba66a9721fd"  // SVN source
-
-#endif
Index: trunk/ppNoiseMap/src/ppNoiseMapVersionDefinitions.h.in
===================================================================
--- trunk/ppNoiseMap/src/ppNoiseMapVersionDefinitions.h.in	(revision 24458)
+++ trunk/ppNoiseMap/src/ppNoiseMapVersionDefinitions.h.in	(revision 24458)
@@ -0,0 +1,8 @@
+#ifndef PPNOISEMAP_VERSION_DEFINITIONS_H
+#define PPNOISEMAP_VERSION_DEFINITIONS_H
+
+#define PPNOISEMAP_VERSION @PPNOISEMAP_VERSION@ // SVN version
+#define PPNOISEMAP_BRANCH  @PPNOISEMAP_BRANCH@  // SVN branch
+#define PPNOISEMAP_SOURCE  @PPNOISEMAP_SOURCE@  // SVN source
+
+#endif
