Index: unk/ppFringe/.cvsignore
===================================================================
--- /trunk/ppFringe/.cvsignore	(revision 10003)
+++ 	(revision )
@@ -1,11 +1,0 @@
-Makefile.in
-aclocal.m4
-autom4te.cache
-compile
-configure
-depcomp
-install-sh
-missing
-Makefile
-config.log
-config.status
Index: unk/ppFringe/Makefile.am
===================================================================
--- /trunk/ppFringe/Makefile.am	(revision 10003)
+++ 	(revision )
@@ -1,3 +1,0 @@
-SUBDIRS = src
-
-CLEANFILES = *~ core core.*
Index: unk/ppFringe/autogen.sh
===================================================================
--- /trunk/ppFringe/autogen.sh	(revision 10003)
+++ 	(revision )
@@ -1,103 +1,0 @@
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-ORIGDIR=`pwd`
-cd $srcdir
-
-PROJECT=ppFringe
-TEST_TYPE=-f
-# change this to be a unique filename in the top level dir
-FILE=autogen.sh
-
-DIE=0
-
-LIBTOOLIZE=libtoolize
-ACLOCAL=aclocal
-AUTOHEADER=autoheader
-AUTOMAKE=automake
-AUTOCONF=autoconf
-
-#($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
-#        echo
-#        echo "You must have $LIBTOOlIZE installed to compile $PROJECT."
-#        echo "Download the appropriate package for your distribution,"
-#        echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/"
-#        DIE=1
-#}
-
-($ACLOCAL --version) < /dev/null > /dev/null 2>&1 || {
-        echo
-        echo "You must have $ACLOCAL installed to compile $PROJECT."
-        echo "Download the appropriate package for your distribution,"
-        echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
-        DIE=1
-}
-
-($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 || {
-        echo
-        echo "You must have $AUTOHEADER installed to compile $PROJECT."
-        echo "Download the appropriate package for your distribution,"
-        echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
-        DIE=1
-}
-
-($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
-        echo
-        echo "You must have $AUTOMAKE installed to compile $PROJECT."
-        echo "Download the appropriate package for your distribution,"
-        echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
-        DIE=1
-}
-
-($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
-        echo
-        echo "You must have $AUTOCONF installed to compile $PROJECT."
-        echo "Download the appropriate package for your distribution,"
-        echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
-        DIE=1
-}
-
-if test "$DIE" -eq 1; then
-        exit 1
-fi
-
-test $TEST_TYPE $FILE || {
-        echo "You must run this script in the top-level $PROJECT directory"
-        exit 1
-}
-
-if test -z "$*"; then
-        echo "I am going to run ./configure with no arguments - if you wish "
-        echo "to pass any to it, please specify them on the $0 command line."
-fi
-
-#$LIBTOOLIZE --copy --force || echo "$LIBTOOlIZE failed"
-$ACLOCAL || echo "$ACLOCAL failed"
-$AUTOHEADER || echo "$AUTOHEADER failed"
-$AUTOMAKE --add-missing --force-missing --copy || echo "$AUTOMAKE failed"
-$AUTOCONF || echo "$AUTOCONF failed"
-
-cd $ORIGDIR
-
-run_configure=true
-for arg in $*; do
-    case $arg in
-        --no-configure)
-            run_configure=false
-            ;;
-        *)
-            ;;
-    esac
-done
-
-if $run_configure; then
-    $srcdir/configure --enable-maintainer-mode "$@"
-    echo
-    echo "Now type 'make' to compile $PROJECT."
-else
-    echo
-    echo "Now run 'configure' and 'make' to compile $PROJECT."
-fi
Index: unk/ppFringe/configure.ac
===================================================================
--- /trunk/ppFringe/configure.ac	(revision 10003)
+++ 	(revision )
@@ -1,38 +1,0 @@
-AC_PREREQ(2.59)
-
-AC_INIT([ppFringe], [0.0.1], [price@ifa.hawaii.edu])
-AC_CONFIG_SRCDIR([src])
-
-AM_INIT_AUTOMAKE([1.6 foreign dist-bzip2])
-AM_CONFIG_HEADER([src/config.h])
-AM_MAINTAINER_MODE
-
-AC_LANG(C)
-AC_GNU_SOURCE
-AC_PROG_CC
-AC_PROG_INSTALL
-dnl AC_PROG_LIBTOOL
-
-dnl enable largefile supports
-AC_SYS_LARGEFILE
-
-dnl handle debug building
-AC_ARG_ENABLE(optimize,
-  [AS_HELP_STRING(--enable-optimize,enable compiler optimization)],
-  [AC_MSG_RESULT(compile optimization enabled)
-   CFLAGS="${CFLAGS=} -O2"],
-  [AC_MSG_RESULT([compile optimization disabled])
-   CFLAGS="${CFLAGS=} -O0 -g"]
-)
-
-PKG_CHECK_MODULES([PSLIB], [pslib >= 0.12.99]) 
-PKG_CHECK_MODULES([PSMODULE], [psmodules >= 0.12.99]) 
-
-ppFringe_CFLAGS="-Wall -Werror -std=c99"
-AC_SUBST([ppFringe_CFLAGS])
-
-AC_CONFIG_FILES([
-  Makefile
-  src/Makefile
-])
-AC_OUTPUT
Index: unk/ppFringe/src/.cvsignore
===================================================================
--- /trunk/ppFringe/src/.cvsignore	(revision 10003)
+++ 	(revision )
@@ -1,7 +1,0 @@
-Makefile.in
-ppFringe
-Makefile
-.deps
-config.h
-config.h.in
-stamp-h1
Index: unk/ppFringe/src/Makefile.am
===================================================================
--- /trunk/ppFringe/src/Makefile.am	(revision 10003)
+++ 	(revision )
@@ -1,26 +1,0 @@
-bin_PROGRAMS = ppFringe
-
-ppFringe_CFLAGS += $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
-ppFringe_LDFLAGS = $(PSMODULE_LIBS) $(PSLIB_LIBS)
-### For profiling:
-#ppMerge_CFLAGS += -g -pg -fprofile-arcs $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
-#ppMerge_LDFLAGS = -pg -Wl,--start-group -Wl,-Bstatic $(PSMODULE_LIBS) $(PSLIB_LIBS) -Wl,-Bdynamic
-
-ppFringe_SOURCES =		\
-	ppFringe.c		\
-	ppFringeData.c		\
-	ppFringeLoop.c		\
-	ppFringeSetup.c
-
-noinst_HEADERS =		\
-	ppFringeData.h		\
-	ppFringe.h		\
-	ppFringeSetup.h
-
-CLEANFILES = *~
-
-clean-local:
-	-rm -f TAGS
-# Tags for emacs
-tags:
-	etags `find . -name \*.[ch] -print`
Index: unk/ppFringe/src/ppFringe.c
===================================================================
--- /trunk/ppFringe/src/ppFringe.c	(revision 10003)
+++ 	(revision )
@@ -1,33 +1,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <pslib.h>
-#include <psmodules.h>
-
-#include "ppFringe.h"
-
-int main(int argc, char *argv[])
-{
-
-    psLibInit(NULL);
-    psTimerStart(TIMERNAME);
-
-    // Parse the configuration and arguments
-    pmConfig *config = pmConfigRead(&argc, argv);
-
-    // Get the options, open the files
-    ppFringeData *data = ppFringeSetup(config);
-
-    // Go through the FPA and measure the fringes
-    ppFringeLoop(data, config);
-
-    psFree(data);
-    psFree(config);
-    pmConceptsDone();
-    pmConfigDone();
-    psLibFinalize();
-
-    return EXIT_SUCCESS;
-}
Index: unk/ppFringe/src/ppFringe.h
===================================================================
--- /trunk/ppFringe/src/ppFringe.h	(revision 10003)
+++ 	(revision )
@@ -1,19 +1,0 @@
-#ifndef PP_FRINGE_H
-#define PP_FRINGE_H
-
-#define RECIPE "PPFRINGE"
-#define TIMERNAME "PPFRINGE"
-
-#include <psmodules.h>
-#include "ppFringeData.h"
-
-// Set up the options and input/output files
-ppFringeData *ppFringeSetup(pmConfig *config // Configuration
-    );
-
-// Loop over the input image and do all the hard work
-void ppFringeLoop(ppFringeData *data,   // The data
-                  const pmConfig *config// Configuration
-    );
-
-#endif
Index: unk/ppFringe/src/ppFringeData.c
===================================================================
--- /trunk/ppFringe/src/ppFringeData.c	(revision 10003)
+++ 	(revision )
@@ -1,49 +1,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <pslib.h>
-
-#include "ppFringeData.h"
-
-static void fringeDataFree(ppFringeData *data // Data to free
-    )
-{
-    // inName, outName and templateName are not on the psLib memory system (they are from argv).
-    psFree(data->inFPA);
-
-    if (data->inFile) {
-        psFitsClose(data->inFile);
-        data->inFile = NULL;
-    }
-    if (data->outFile) {
-        psFitsClose(data->outFile);
-        data->outFile = NULL;
-    }
-    return;
-}
-
-
-ppFringeData *ppFringeDataAlloc(void)
-{
-    ppFringeData *data = psAlloc(sizeof(ppFringeData)); // Newly allocated data
-    psMemSetDeallocator(data, (psFreeFunc)fringeDataFree);
-
-    data->inName = NULL;
-    data->outName = NULL;
-    data->numPoints = 0;
-    data->xWidth = 0;
-    data->yWidth = 0;
-    data->xSmooth = 0;
-    data->ySmooth = 0;
-    data->maskVal = 0;
-
-    data->inFile = NULL;
-    data->outFile = NULL;
-    data->inFPA = NULL;
-
-    return data;
-}
-
-
Index: unk/ppFringe/src/ppFringeData.h
===================================================================
--- /trunk/ppFringe/src/ppFringeData.h	(revision 10003)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#ifndef PP_FRINGE_DATA_H
-#define PP_FRINGE_DATA_H
-
-#include <pslib.h>
-#include <psmodules.h>
-
-typedef struct {
-    // Options
-    const char *inName;                 // Input FITS image file
-    const char *outName;                // Output FITS table file
-    int numPoints;                      // Number of fringe points
-    int xWidth, yWidth;                 // Width of fringe points in x and y
-    int xSmooth, ySmooth;               // Large-scale smoothing in x and y
-    psMaskType maskVal;                 // Mask value
-    // Data
-    psFits *inFile;                     // Input file handle
-    psFits *outFile;                    // Output file handle
-    pmFPA *inFPA;                       // Input FPA
-} ppFringeData;
-
-// Allocator
-ppFringeData *ppFringeDataAlloc(void);
-
-#endif
Index: unk/ppFringe/src/ppFringeLoop.c
===================================================================
--- /trunk/ppFringe/src/ppFringeLoop.c	(revision 10003)
+++ 	(revision )
@@ -1,172 +1,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <pslib.h>
-#include <psmodules.h>
-
-#include "ppFringe.h"
-
-void ppFringeLoop(ppFringeData *data,   // The data
-                  const pmConfig *config// Configuration
-    )
-{
-    psRandom *rng = NULL; // Random number generator
-
-    // Set up output header
-    const char *detId = psMetadataLookupStr(NULL, config->arguments, "-detid"); // Detector ID, for header
-    const char *classId = psMetadataLookupStr(NULL, config->arguments, "-classid"); // Class ID, for header
-    psMetadata *outHeader = psMetadataAlloc(); // Header for output
-    if (detId && strlen(detId) > 0) {
-        psMetadataAddStr(outHeader, PS_LIST_TAIL, "DETID", 0, "Detector ID for this image.", detId);
-    }
-    if (classId && strlen(classId) > 0) {
-        psMetadataAddStr(outHeader, PS_LIST_TAIL, "CLASSID", 0, "Class ID for this image.", classId);
-    }
-
-    // Get table of contents for the output FITS file
-    // XXX what is the EXTNAME??
-    psMetadata *contents = psFitsReadHeaderSet(NULL, data->outFile);
-    if (!contents || contents->list->n == 0) {
-        psFitsWriteBlank(data->outFile, NULL, "");
-    }
-
-    // Iterate through the FPA
-    pmFPA *fpa = data->inFPA;           // The FPA of interest
-    psArray *chips = fpa->chips;        // Array of component chips
-    for (long i = 0; i < chips->n; i++) {
-        pmChip *chip = chips->data[i];  // The chip of interest
-        if (!chip) {
-            continue;
-        }
-        const char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // Name of chip
-        psArray *cells = chip->cells;   // Array of component cells
-        for (long j = 0; j < cells->n; j++) {
-            pmCell *cell = cells->data[j]; // The cell of interest
-            if (!cell) {
-                continue;
-            }
-            const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of cell
-
-            if (!pmCellRead(cell, data->inFile, config->database)) {
-                psLogMsg(__func__, PS_LOG_WARN, "Unable to read chip %s cell %s\n", chipName, cellName);
-                pmCellFreeData(cell);
-                continue;
-            }
-
-            psArray *readouts = cell->readouts; // Array of component readouts
-            if (readouts->n == 0) {
-                pmCellFreeData(cell);
-                continue;
-            }
-            if (readouts->n > 1) {
-                psLogMsg(__func__, PS_LOG_WARN, "Multiple readouts (%ld) present in chip %s cell %s --- "
-                         "using only the first.\n", readouts->n, chipName, cellName);
-            }
-            pmReadout *readout = readouts->data[0]; // The readout of interest
-            if (!readout->image) {
-                psLogMsg(__func__, PS_LOG_WARN, "No image associated with readout in chip %s cell %s --- "
-                         "ignored.\n", chipName, cellName);
-                pmCellFreeData(cell);
-                continue;
-            }
-
-            // Look for this chip/cell in the output file
-            pmFringeRegions *regions = NULL; // Points at which to measure fringes
-            bool preDefined = false;    // Are the regions defined in the output file?
-            psString extname = NULL;
-            psStringAppend(&extname, "%s_%s", chipName, cellName);
-            if (contents && contents->list->n > 0) {
-                bool mdok;              // Status of MD lookup
-                psMetadata *header = psMetadataLookupMetadata(&mdok, contents, extname); // Header
-                if (mdok && header) {
-                    regions = pmFringeRegionsReadFits(NULL, data->outFile, extname);
-                    if (regions) {
-                        preDefined = true;
-                    } else {
-                        psLogMsg(__func__, PS_LOG_WARN, "Unable to read fringe regions for chip %s cell %s "
-                                 " --- will generate new regions.\n", chipName, cellName);
-                    }
-                }
-            }
-
-            // Otherwise, generate one ourselves
-            if (!regions) {
-                if (!rng) {
-                    rng = psRandomAlloc(PS_RANDOM_TAUS, 0);
-                }
-                // Create points to measure fringes
-                regions = pmFringeRegionsAlloc(data->numPoints, data->xWidth, data->yWidth,
-                                               data->xSmooth, data->ySmooth);
-                if (!pmFringeRegionsCreatePoints(regions, readout->image, rng)) {
-                    psLogMsg(__func__, PS_LOG_WARN, "Unable to create fringe regions for chip %s cell %s --- "
-                             "ignored.\n", chipName, cellName);
-                    psFree(extname);
-                    psFree(regions);
-                    pmCellFreeData(cell);
-                    continue;
-                }
-            }
-
-            // Measure fringes
-            pmFringeStats *fringeStats = pmFringeStatsMeasure(regions, readout, data->maskVal);
-            psFree(regions);            // Drop reference
-            if (!fringeStats) {
-                psLogMsg(__func__, PS_LOG_WARN, "Unable to measure fringes for chip %s cell %s --- "
-                         "ignored.\n", chipName, cellName);
-                pmCellFreeData(cell);
-                continue;
-            }
-
-            // Write fringe regions
-            if (!preDefined &&
-                !pmFringeRegionsWriteFits(data->outFile, NULL, fringeStats->regions, extname)) {
-                psLogMsg(__func__, PS_LOG_WARN, "Unable to write fringe regions for chip %s cell %s --- "
-                         "ignored.\n", chipName, cellName);
-                psFree(fringeStats);
-                psFree(extname);
-                pmCellFreeData(cell);
-                continue;
-            }
-
-            int version = 0;            // Version number
-            if (preDefined) {
-                // Find the lowest possible version number that isn't already taken
-                psMetadata *header = NULL; // Header from the table of contents
-                bool mdok = true;       // Status of MD lookup
-                do {
-                    version++;
-                    psString checkName = NULL; // Extension name to check
-                    psStringAppend(&checkName, "%s:%d", extname, version);
-                    header = psMetadataLookupMetadata(&mdok, contents, checkName);
-                    psFree(checkName);
-                } while (mdok && header);
-            }
-
-            // Write fringe measurements
-            psStringAppend(&extname, ":%d", version);
-            if (!pmFringeStatsWriteFits(data->outFile, outHeader, fringeStats, extname)) {
-                psLogMsg(__func__, PS_LOG_WARN, "Unable to write fringe measurements for chip %s cell %s --- "
-                         "ignored.\n", chipName, cellName);
-                psFree(fringeStats);
-                psFree(extname);
-                pmCellFreeData(cell);
-                continue;
-            }
-
-            psFree(fringeStats);
-            psFree(extname);
-            pmCellFreeData(cell);
-        }
-        pmChipFreeData(chip);
-    }
-    pmFPAFreeData(fpa);
-
-    psFree(rng);
-    psFree(contents);
-    psFree(outHeader);
-
-    return;
-}
Index: unk/ppFringe/src/ppFringeSetup.c
===================================================================
--- /trunk/ppFringe/src/ppFringeSetup.c	(revision 10003)
+++ 	(revision )
@@ -1,120 +1,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <pslib.h>
-#include <psmodules.h>
-#include <string.h>
-
-#include "ppFringe.h"
-
-// Print usage information and die
-static void usageAndDie(pmConfig *config      // Configuration (contains the arguments list)
-    )
-{
-    printf("Generate fringe points for a FITS image file.\n\n"
-           "Usage:\n"
-           "\t%s INPUT.fits OUTPUT.fits\n"
-           "\n", config->argv[0]);
-    psArgumentHelp(config->arguments);
-    psFree(config);
-    psLibFinalize();
-    pmConceptsDone();
-    pmConfigDone();
-    exit(EXIT_FAILURE);
-}
-
-ppFringeData *ppFringeSetup(pmConfig *config // Configuration
-    )
-{
-    // Setup and parse command-line arguments
-    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-detid", 0, "Detrend identifier", NULL);
-    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-classid", 0, "Class identifier", NULL);
-
-    if (*config->argc == 1) {
-        // No command-line arguments: print the help
-        usageAndDie(config);
-    }
-    if (!psArgumentParse(config->arguments, config->argc, config->argv) || *config->argc < 2) {
-        printf("Unable to parse command-line arguments.\n\n");
-        usageAndDie(config);
-    }
-
-    ppFringeData *data = ppFringeDataAlloc(); // The data
-    data->inName = config->argv[1];
-    data->outName = config->argv[2];
-
-    // Open the input file, determine the camera
-    data->inFile = psFitsOpen(data->inName, "r");
-    if (!data->inFile) {
-        psError(PS_ERR_IO, false, "Unable to open input file %s\n", data->inName);
-        goto die;
-    }
-    psMetadata *header = psFitsReadHeader(NULL, data->inFile); // The FITS (primary) header
-    psMetadata *format = pmConfigCameraFormatFromHeader(config, header);
-    if (!format) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to determine camera format for %s\n", data->inName);
-        psFree(header);
-        goto die;
-    }
-    data->inFPA = pmFPAConstruct(config->camera);
-    if (!data->inFPA) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to construct FPA for %s\n", data->inName);
-        psFree(header);
-        psFree(format);
-        goto die;
-    }
-    pmFPAview *view = pmFPAAddSourceFromHeader(data->inFPA, header, format);
-    psFree(header);
-    psFree(format);
-    if (!view) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to add input file %s to FPA.\n", data->inName);
-        goto die;
-    }
-    psFree(view);
-
-    // Now we have a camera format, we can read the recipe
-    bool mdok;                          // Status of MD lookup
-    psMetadata *recipe = psMetadataLookupMetadata(&mdok, config->recipes, RECIPE); // The recipe
-    if (!recipe) {
-        psError(PS_ERR_IO, true, "Unable to find recipe %s.\n", RECIPE);
-        goto die;
-    }
-
-    #define READ_RECIPE_ITEM(NAME, RECIPE, TARGET, TYPE) \
-    { \
-        bool mdok; \
-        TARGET = psMetadataLookup##TYPE(&mdok, RECIPE, NAME); \
-        if (!mdok || TARGET <= 0) { \
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "%s in the recipe is not valid: %d.\n", NAME, \
-                    TARGET); \
-            goto die; \
-        } \
-    }
-
-    READ_RECIPE_ITEM("NUMPOINTS", recipe, data->numPoints, S32);
-    READ_RECIPE_ITEM("XWIDTH", recipe, data->xWidth, S32);
-    READ_RECIPE_ITEM("YWIDTH", recipe, data->yWidth, S32);
-    READ_RECIPE_ITEM("XSMOOTH", recipe, data->xSmooth, S32);
-    READ_RECIPE_ITEM("YSMOOTH", recipe, data->ySmooth, S32);
-    READ_RECIPE_ITEM("MASKVAL", recipe, data->maskVal, U8);
-
-    // Open the output file
-    data->outFile = psFitsOpen(data->outName, "a+");
-    if (!data->outFile) {
-        psError(PS_ERR_IO, false, "Unable to open output file %s\n", data->outName);
-        goto die;
-    }
-
-    return data;
-
-    // Common path for error conditions: clean up and exit.
-die:
-    psFree(config);
-    psFree(data);
-    pmConceptsDone();
-    pmConfigDone();
-    psLibFinalize();
-    exit(EXIT_FAILURE);
-}
Index: unk/ppFringe/src/ppFringeSetup.h
===================================================================
--- /trunk/ppFringe/src/ppFringeSetup.h	(revision 10003)
+++ 	(revision )
@@ -1,5 +1,0 @@
-#ifndef PP_FRINGE_SETUP_H
-#define PP_FRINGE_SETUP_H
-
-
-#endif
