Index: trunk/ppArith/src/.cvsignore
===================================================================
--- trunk/ppArith/src/.cvsignore	(revision 8827)
+++ 	(revision )
@@ -1,7 +1,0 @@
-Makefile
-Makefile.in
-ppArith
-.deps
-config.h
-config.h.in
-stamp-h1
Index: trunk/ppArith/src/Makefile.am
===================================================================
--- trunk/ppArith/src/Makefile.am	(revision 8827)
+++ 	(revision )
@@ -1,23 +1,0 @@
-bin_PROGRAMS = ppArith
-
-ppArith_CFLAGS += $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
-ppArith_LDFLAGS += $(PSMODULE_LIBS) $(PSLIB_LIBS) -Wl,-Bdynamic
-
-ppArith_SOURCES =		\
-	ppArith.c		\
-	ppArithData.c		\
-	ppArithLoop.c		\
-	ppArithSetup.c
-
-noinst_HEADERS =		\
-	ppArith.h		\
-	ppArithData.h
-
-
-CLEANFILES = *~
-
-clean-local:
-	-rm -f TAGS
-# Tags for emacs
-tags:
-	etags `find . -name \*.[ch] -print`
Index: trunk/ppArith/src/ppArith.c
===================================================================
--- trunk/ppArith/src/ppArith.c	(revision 8827)
+++ 	(revision )
@@ -1,33 +1,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <pslib.h>
-#include <psmodules.h>
-
-#include "ppArith.h"
-
-int main(int argc, char *argv[])
-{
-    psLibInit(NULL);
-    psTimerStart(TIMERNAME);
-    psMemSetThreadSafety(false);
-
-    // Parse the configuration and arguments
-    pmConfig *config = pmConfigRead(&argc, argv);
-
-    // Get the options, open the files
-    ppArithData *data = ppArithSetup(config);
-
-    // Go through the FPA and do the hard work
-    ppArithLoop(data, config);
-
-    psFree(data);
-    psFree(config);
-    pmConceptsDone();
-    pmConfigDone();
-    psLibFinalize();
-
-    return EXIT_SUCCESS;
-}
Index: trunk/ppArith/src/ppArith.h
===================================================================
--- trunk/ppArith/src/ppArith.h	(revision 8827)
+++ 	(revision )
@@ -1,21 +1,0 @@
-#ifndef PP_ARITH_H
-#define PP_ARITH_H
-
-#define RECIPENAME "PPARITH"
-#define TIMERNAME "PPARITH"
-#define INPUTNAME "PPARITH.INPUT"
-#define OUTPUTNAME "PPARITH.OUTPUT"
-
-#include <psmodules.h>
-#include "ppArithData.h"
-
-// Set up the options and input/output files
-ppArithData *ppArithSetup(pmConfig *config // Configuration
-    );
-
-// Loop over the input image and do all the hard work
-void ppArithLoop(ppArithData *data,       // The data
-                 pmConfig *config        // Configuration
-    );
-
-#endif
Index: trunk/ppArith/src/ppArithData.c
===================================================================
--- trunk/ppArith/src/ppArithData.c	(revision 8827)
+++ 	(revision )
@@ -1,31 +1,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <pslib.h>
-
-#include "ppArithData.h"
-
-static void arithDataFree(ppArithData *data // Data to free
-    )
-{
-    // Nothing to free; this function is just for identification purposes
-    return;
-}
-
-
-ppArithData *ppArithDataAlloc(void)
-{
-    ppArithData *data = psAlloc(sizeof(ppArithData)); // Newly allocated data
-    psMemSetDeallocator(data, (psFreeFunc)arithDataFree);
-
-    data->input1 = NULL;
-    data->input2 = NULL;
-    data->constant = NAN;
-    data->operation = NULL;
-    data->output = NULL;
-
-    return data;
-}
-
Index: trunk/ppArith/src/ppArithData.h
===================================================================
--- trunk/ppArith/src/ppArithData.h	(revision 8827)
+++ 	(revision )
@@ -1,18 +1,0 @@
-#ifndef PP_NORM_DATA_H
-#define PP_NORM_DATA_H
-
-#include <psmodules.h>
-
-// Options for processing
-typedef struct {
-    pmFPAfile *input1;                  // First input
-    pmFPAfile *input2;                  // Second input
-    float constant;                     // A constant value
-    const char *operation;              // Operation to perform
-    pmFPAfile *output;                  // FPA file for output
-} ppArithData;
-
-// Allocator
-ppArithData *ppArithDataAlloc(void);
-
-#endif
Index: trunk/ppArith/src/ppArithLoop.c
===================================================================
--- trunk/ppArith/src/ppArithLoop.c	(revision 8827)
+++ 	(revision )
@@ -1,104 +1,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <assert.h>
-#include <string.h>
-#include <pslib.h>
-#include <psmodules.h>
-
-#include "ppArith.h"
-
-
-void ppArithLoop(ppArithData *data,       // The data
-                 pmConfig *config        // Configuration
-    )
-{
-    bool mdok;                          // Status of MD lookup
-    pmFPAfile *input1 = psMetadataLookupPtr(&mdok, config->files, INPUTNAME); // Input FPA file
-    if (!input1 || !mdok) {
-        psAbort(__func__, "Should never get here: I'm sure I saved it.\n");
-    }
-
-    // Iterate through the FPA
-    pmFPAview *view = pmFPAviewAlloc(0);// View of FPA
-    if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
-        psError(PS_ERR_IO, false, "Unable to check file I/O.\n");
-        goto done;
-    }
-    pmChip *chip;                       // Chip, from iteration
-    while ((chip = pmFPAviewNextChip(view, input1->fpa, 1))) {
-        if (!chip->file_exists) {
-            continue;
-        }
-        const char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // Name of chip
-        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
-            psError(PS_ERR_IO, false, "Unable to check file I/O at chip %s.\n", chipName);
-            goto done;
-        }
-        pmCell *cell;                   // Cell, from iteration
-        while ((cell = pmFPAviewNextCell(view, input1->fpa, 1))) {
-            if (!cell->file_exists) {
-                continue;
-            }
-            const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of cell
-            if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
-                psError(PS_ERR_IO, false, "Unable to check file I/O at chip %s, cell %s.\n",
-                        chipName, cellName);
-                goto done;
-            }
-
-            pmReadout *readout;         // Readout, from iteration
-            for (int roNum = 0; (readout = pmFPAviewNextReadout(view, input1->fpa, 1)); roNum++) {
-                if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
-                    psError(PS_ERR_IO, false, "Unable to check file I/O at chip %s, cell %s, readout %d.\n",
-                            chipName, cellName, roNum);
-                    goto done;
-                }
-
-                // Perform the operations
-                psBinaryOp(readout->image, readout->image, data->operation,
-                           psScalarAlloc(data->constant, PS_TYPE_F32));
-
-                if (psListLength(readout->bias) > 0) {
-                    psListIterator *iter = psListIteratorAlloc(readout->bias, PS_LIST_HEAD, false);
-                    psImage *bias;      // Bias image, from iteration
-                    while ((bias = psListGetAndIncrement(iter))) {
-                        psBinaryOp(bias, bias, data->operation, psScalarAlloc(data->constant, PS_TYPE_F32));
-                    }
-                    psFree(iter);
-                }
-
-                if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
-                    psError(PS_ERR_IO, false, "Unable to check file I/O at chip %s, cell %s, readout %d.\n",
-                            chipName, cellName, roNum);
-                    goto done;
-                }
-
-                pmReadoutFreeData(readout);
-            }
-
-            if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
-                psError(PS_ERR_IO, false, "Unable to check file I/O at chip %s, cell %s.\n",
-                        chipName, cellName);
-                goto done;
-            }
-            pmCellFreeData(cell);
-        }
-        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
-            psError(PS_ERR_IO, false, "Unable to check file I/O at chip %s.\n", chipName);
-            goto done;
-        }
-        pmChipFreeData(chip);
-    }
-    if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
-        psError(PS_ERR_IO, false, "Unable to check file I/O.\n");
-        goto done;
-    }
-    pmFPAFreeData(input1->fpa);
-
-done:
-    psFree(view);
-    return;
-}
Index: trunk/ppArith/src/ppArithSetup.c
===================================================================
--- trunk/ppArith/src/ppArithSetup.c	(revision 8827)
+++ 	(revision )
@@ -1,128 +1,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <pslib.h>
-#include <psmodules.h>
-#include <string.h>
-
-#include "ppArith.h"
-#include "ppArithData.h"
-
-// Print usage information and die
-static void usageAndDie(pmConfig *config      // Configuration (contains the arguments list)
-    )
-{
-    printf("Normalize the input FPA.\n\n"
-           "Usage:\n"
-           "\t%s -file1 INPUT1.fits -op OP -file2 INPUT2.fits -out OUTPUT\n"
-           "OR\n"
-           "\t%s -file1 INPUT1.fits -op OP -constant CONSTANT -out OUTPUT\n"
-           "\n", config->argv[0], config->argv[0]);
-    psArgumentHelp(config->arguments);
-    psFree(config);
-    psLibFinalize();
-    pmConceptsDone();
-    pmConfigDone();
-    exit(EXIT_FAILURE);
-}
-
-ppArithData *ppArithSetup(pmConfig *config // Configuration
-    )
-{
-    // Setup and parse command-line arguments
-    psMetadata *arguments = config->arguments; // Arguments
-    psMetadataAddStr(arguments, PS_LIST_TAIL, "-op", 0, "Operation to apply", NULL);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-constant", 0, "Constant", NAN);
-    psMetadataAddStr(arguments, PS_LIST_TAIL, "-out", 0, "Output", NULL);
-
-    // No command-line arguments: print the help
-    if (*config->argc == 1) {
-        usageAndDie(config);
-    }
-
-    // Get input files
-    if (!pmConfigFileSetsMD(arguments, config, "INPUT1", "-file1", "-list1")) {
-        psError(PS_ERR_IO, false, "Unable to open input files #1.\n");
-        usageAndDie(config);
-    }
-
-    // If no constant, look for a second file
-    if (!psMetadataLookup(arguments, "-constant")) {
-        if (!pmConfigFileSetsMD(arguments, config, "INPUT2", "-file2", "-list2")) {
-            psError(PS_ERR_IO, false, "Unable to open input files #2.\n");
-            usageAndDie(config);
-        }
-    }
-
-    if (!psArgumentParse(arguments, config->argc, config->argv)) {
-        printf("Unable to parse command-line arguments.\n\n");
-        usageAndDie(config);
-    }
-
-    // Check for mandatory arguments
-    if (!psMetadataLookup(arguments, "-op")) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "No operation specified.\n");
-        usageAndDie(config);
-    }
-    const char *outName = psMetadataLookupStr(NULL, arguments, "-out");
-    if (!outName || strlen(outName) == 0) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "No output specified.\n");
-        usageAndDie(config);
-    }
-    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", outName);
-
-
-    // Now process what we've got
-    ppArithData *data = ppArithDataAlloc(); // The data
-
-    // Read the camera
-    bool status = false;                // Status of function calls
-    data->input1 = pmFPAfileDefineFromArgs(&status, config, INPUTNAME, "INPUT1");
-    if (!status) {
-        psError(PS_ERR_IO, false, "Failed to build FPA from %s.\n", INPUTNAME);
-        goto die;
-    }
-
-    if (psMetadataLookup(arguments, "INPUT2")) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Binary operation with two files is not yet supported.\n");
-        goto die;
-
-        data->input2 = pmFPAfileDefineFromArgs(&status, config, INPUTNAME, "INPUT2");
-        if (!status) {
-            psError(PS_ERR_IO, false, "Failed to build FPA from %s.\n", INPUTNAME);
-            goto die;
-        }
-    }
-
-    pmFPAfile *output = pmFPAfileDefineOutput(config, data->input1->fpa, OUTPUTNAME);
-    if (!output) {
-        psError(PS_ERR_UNKNOWN, false, "Failed to build output from %s.\n", OUTPUTNAME);
-        goto die;
-    }
-
-    data->operation = psMetadataLookupStr(NULL, arguments, "-op"); // Operation to perform
-    if (strcmp(data->operation, "+") &&
-        strcmp(data->operation, "-") &&
-        strcmp(data->operation, "*") &&
-        strcmp(data->operation, "/")) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unknown operation: %s\n", data->operation);
-        goto die;
-    }
-
-    if (!data->input2) {
-        data->constant = psMetadataLookupF32(NULL, arguments, "-constant");
-    }
-
-    return data;
-
-    // Common path for error conditions: clean up and exit.
-die:
-    psFree(config);
-    psFree(data);
-    pmConceptsDone();
-    pmConfigDone();
-    psLibFinalize();
-    exit(EXIT_FAILURE);
-}
