Index: unk/ppShutter/.cvsignore
===================================================================
--- /trunk/ppShutter/.cvsignore	(revision 10004)
+++ 	(revision )
@@ -1,11 +1,0 @@
-Makefile
-Makefile.in
-aclocal.m4
-autom4te.cache
-compile
-config.log
-config.status
-configure
-depcomp
-install-sh
-missing
Index: unk/ppShutter/Makefile.am
===================================================================
--- /trunk/ppShutter/Makefile.am	(revision 10004)
+++ 	(revision )
@@ -1,3 +1,0 @@
-SUBDIRS = src
-
-CLEANFILES = *~ core core.*
Index: unk/ppShutter/autogen.sh
===================================================================
--- /trunk/ppShutter/autogen.sh	(revision 10004)
+++ 	(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=ppMerge
-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/ppShutter/configure.ac
===================================================================
--- /trunk/ppShutter/configure.ac	(revision 10004)
+++ 	(revision )
@@ -1,56 +1,0 @@
-AC_PREREQ(2.59)
-
-AC_INIT([ppShutter], [0.0.1], [eugene@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
-
-ppShutter_CFLAGS="-Wall -Werror -std=c99"
-ppShutter_LDFLAGS=""
-
-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"]
-)
-
-dnl handle path coverage checking
-AC_ARG_ENABLE(coverage,
-  [AS_HELP_STRING(--enable-coverage,enable path coverage checking)],
-  [AC_MSG_RESULT(path coverage enabled)
-   CFLAGS="${CFLAGS=} -fprofile-arcs -ftest-coverage -pg"]
-)
-
-PKG_CHECK_MODULES([PSLIB], [pslib >= 0.12.99]) 
-PKG_CHECK_MODULES([PSMODULE], [psmodules >= 0.12.99]) 
-
-dnl handle profiler building
-AC_ARG_ENABLE(profile,
-  [AS_HELP_STRING(--enable-profile,enable compiler profiler information inclusion)],
-  [AC_MSG_RESULT(compile optimization enabled)
-  ppShutter_CFLAGS="${ppShutter_CFLAGS} -g -pg"
-  ppShutter_LDFLAGS="${ppShutter_LDFLAGS} -pg -Wl,--start-group -Wl,-Bstatic"]
-  )
-  
-AC_SUBST([ppShutter_CFLAGS])
-AC_SUBST([ppShutter_LDFLAGS])
-
-AC_CONFIG_FILES([
-  Makefile
-  src/Makefile
-])
-AC_OUTPUT
Index: unk/ppShutter/src/.cvsignore
===================================================================
--- /trunk/ppShutter/src/.cvsignore	(revision 10004)
+++ 	(revision )
@@ -1,7 +1,0 @@
-.deps
-Makefile
-Makefile.in
-config.h
-config.h.in
-stamp-h1
-ppShutter
Index: unk/ppShutter/src/Makefile.am
===================================================================
--- /trunk/ppShutter/src/Makefile.am	(revision 10004)
+++ 	(revision )
@@ -1,19 +1,0 @@
-bin_PROGRAMS = ppShutter
-
-ppShutter_CFLAGS += $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
-ppShutter_LDFLAGS += $(PPSTATS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) -Wl,-Bdynamic
-
-ppShutter_SOURCES =		\
-	ppShutter.c		
-
-#noinst_HEADERS =		\
-#	ppShutter.h
-
-CLEANFILES = *~
-
-clean-local:
-	-rm -f TAGS
-
-# Tags for emacs
-tags:
-	etags `find . -name \*.[ch] -print`
Index: unk/ppShutter/src/ppShutter.c
===================================================================
--- /trunk/ppShutter/src/ppShutter.c	(revision 10004)
+++ 	(revision )
@@ -1,145 +1,0 @@
-#include <stdio.h>
-#include <pslib.h>
-#include <psmodules.h>
-
-void usage () {
-
-    fprintf (stderr, "USAGE: ppShutter (output) (outscale) (input) (input) (input) ...\n");
-    fprintf (stderr, " minimum number of input images: 5\n");
-    exit (1);
-}
-
-// simple test: ppShutter (output) (input) (input) (input) ...
-int main(int argc, char **argv)
-{
-
-    psFits *fits;
-    psRegion fullimage = {0, 0, 0, 0};
-    psRegion region;
-
-    // minimum number of input images: 5
-    if (argc < 8) usage ();
-
-    int Ninput = argc - 3;
-
-    // load the input images (for now, load them all into memory)
-    psArray *files   = psArrayAlloc (Ninput);
-    psArray *headers = psArrayAlloc (Ninput);
-    psArray *images  = psArrayAlloc (Ninput);
-    for (int i = 0; i < Ninput; i++) {
-	fits = psFitsOpen (argv[i+3], "r");
-	files->data[i] = fits;
-
-	psMetadata *header = psFitsReadHeader (NULL, fits);
-	headers->data[i] = header;
-
-	psImage *image = psFitsReadImage (fits, fullimage, 0);
-	images->data[i] = image;
-    }
-    images->n = files->n = headers->n = Ninput;
-
-    // find the exposures times for each input images
-    // need to resort the array based on the exposure times
-    psVector *exptime = psVectorAlloc (Ninput, PS_TYPE_F32);
-    psVector *fluxRef = psVectorAlloc (Ninput, PS_TYPE_F32);
-    psVector *normCts = psVectorAlloc (Ninput, PS_TYPE_F32);
-    psVector *normErr = psVectorAlloc (Ninput, PS_TYPE_F32);
-    for (int i = 0; i < Ninput; i++) {
-	exptime->data.F32[i] = psMetadataLookupF32 (NULL, headers->data[i], "EXPTIME");
-    }
-    exptime->n = fluxRef->n = normCts->n = normErr->n = Ninput;
-
-    psVector *index = psVectorSortIndex (NULL, exptime);
-
-    // use the first image as a coord reference
-    psImage *refimage = images->data[0];
-
-    // statistics used to measure initial parameters
-    psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_STDEV);
-
-    // define the reference region
-    region = psRegionForSquare(0.5*refimage->numCols, 0.5*refimage->numRows, 10);
-
-    // first, measure the reference region statistic from each image
-    for (int i = 0; i < Ninput; i++) {
-	psImage *image = images->data[index->data.S32[i]];
-	myStats = psImageStats(myStats, image, NULL, 0);
-	fluxRef->data.F32[i] = myStats->sampleMean;
-	fprintf (stderr, "ref flux for image %d: %f\n", i, fluxRef->data.F32[i]);
-    }	
-
-    // define the sample regions
-    int Nsamples = 4;
-    psArray *samples = psArrayAlloc (Nsamples);
-    for (int i = 0; i < 4; i++) {
-	psPlane *coord = psPlaneAlloc ();
-	coord->x = (i % 2) ? 10 : refimage->numCols - 10;
-	coord->y = (i > 1) ? 10 : refimage->numRows - 10;
-	samples->data[i] = coord;
-    }
-
-    // use several regions to make a measurement of dTo 
-    psVector *refOffsetSample = psVectorAlloc (Nsamples, PS_TYPE_F32);
-    for (int j = 0; j < Nsamples; j++) {
-	psPlane *coord = samples->data[j];
-
-	fprintf (stderr, "norm cnts for region %d: ", j);
-	for (int i = 0; i < Ninput; i++) {
-	    psImage *image = images->data[index->data.S32[i]];
-
-	    region = psRegionForSquare(coord->x, coord->y, 10);
-	    region = psRegionForImage(image, region);
-	    // fprintf (stderr, "%f,%f:%f,%f : ", region.x0, region.y0, region.x1, region.y1);
-
-	    psImage *raster = psImageSubset (image, region);
-	    myStats = psImageStats(myStats, raster, NULL, 0);
-	    normCts->data.F32[i] = myStats->sampleMean / fluxRef->data.F32[i];
-	    normErr->data.F32[i] = myStats->sampleStdev / fluxRef->data.F32[i];
-	    fprintf (stderr, "%f ", normCts->data.F32[i]);
-	    // fprintf (stderr, "%f\n", myStats->sampleMean);
-	    
-	    psFree (raster);
-	}	
-	fprintf (stderr, "\n");
-	
-	pmShutterCorrPars *guess = pmShutterCorrectionGuess (exptime, normCts);
-	pmShutterCorrPars *params = pmShutterCorrectionFullFit (exptime, normCts, normErr, guess);
-
-	refOffsetSample->data.F32[j] = params->offref;
-    }
-    refOffsetSample->n = Nsamples;
-    myStats = psVectorStats (myStats, refOffsetSample, NULL, NULL, 0);
-    float refOffset = myStats->sampleMean;
-    fprintf (stderr, "refOffset : %f +/- %f\n", myStats->sampleMean, myStats->sampleStdev);
-
-    // now run through all pixels in the images and measure the shutter parameters for each pixel
-    psImage *pattern = psImageAlloc (refimage->numCols, refimage->numRows, PS_TYPE_F32);
-    psImage *offset = psImageAlloc (refimage->numCols, refimage->numRows, PS_TYPE_F32);
-
-    int dotInterval = refimage->numRows / 32;
-    for (int ny = 0; ny < refimage->numRows; ny++) {
-	if (ny % dotInterval == 0) fprintf (stderr, ".");	
-	for (int nx = 0; nx < refimage->numCols; nx++) {
-	    for (int i = 0; i < Ninput; i++) {
-		psImage *image = images->data[index->data.S32[i]];
-		normCts->data.F32[i] = image->data.F32[ny][nx] / fluxRef->data.F32[i];
-		normErr->data.F32[i] = sqrt(image->data.F32[ny][nx]) / fluxRef->data.F32[i];
-	    }
-	    pmShutterCorrPars *params = pmShutterCorrectionLinFit (exptime, normCts, normErr, refOffset);
-	    pattern->data.F32[ny][nx] = params->scale;
-	    offset->data.F32[ny][nx] = params->offset;
-	}
-    }
-
-    // save the resulting offset image
-    fits = psFitsOpen (argv[1], "w");
-    psFitsWriteImage (fits, NULL, offset, 0, NULL);
-    psFitsClose (fits);
-
-    // save the resulting illumination pattern image
-    fits = psFitsOpen (argv[2], "w");
-    psFitsWriteImage (fits, NULL, pattern, 0, NULL);
-    psFitsClose (fits);
-
-    exit (0);
-}
Index: unk/ppShutter/test/.cvsignore
===================================================================
--- /trunk/ppShutter/test/.cvsignore	(revision 10004)
+++ 	(revision )
@@ -1,2 +1,0 @@
-*.fits
-.mana
Index: unk/ppShutter/test/tests.pro
===================================================================
--- /trunk/ppShutter/test/tests.pro	(revision 10004)
+++ 	(revision )
@@ -1,95 +1,0 @@
-
-macro shresid
-  if ($0 != 3)
-    echo "USAGE shresid (input) (output)"
-    break
-  end
-  rd A $1 
-  extract A a 0 0 2048 2048 0 0 2048 2048
-  keyword a EXPTIME time
-  echo "dt: $time"
-  set t = ($time + dt)
-  set da = a / t / pattern
-  stats da - - - -
-  tv da {$MEDIAN*0.95} {$MEDIAN*0.1}
-end
-
-# make a simple shutter offset map : off = Ax((x-Nx/2)/Nx)^2 + Ay((y-Ny/2)/Ny)^2
-macro mkshutter.model
- if ($0 != 6)
-   echo "USAGE: mkshutter.model (Nx) (Ny) (Ax) (Ay) (Ao)"
-   break
- end
-
- $Nx = $1
- $Ny = $2
-
- mcreate tmpb $Nx $Ny
- set tmpx = xramp(tmpb)
- set tmpy = yramp(tmpb)
-
- set tmpX = (2*tmpx/$Nx) - 1
- set tmpY = (2*tmpy/$Ny) - 1
-
- set model = $3*tmpX^2 + $4*tmpY^2 + $5
- delete tmpb tmpx tmpy tmpX tmpY
-end
-
-macro mkshutter.image
- if ($0 != 4)
-   echo "USAGE: mkshutter.image (buffer) (exptime) (flux)"
-   break
- end
-
- set $1 = $3*($2 + model)
- 
- gaussdev noisev {$Nx*$Ny} 0.0 1.0
- dimenup noisev noisem $Nx $Ny
- set $1 = $1 + noisem*sqrt($1)
- keyword $1 EXPTIME -wf $2
-end
-
-macro mkshutter.pattern
- if ($0 != 3)
-   echo "USAGE: mkshutter.pattern (model) (pattern)"
-   break
- end
-
- set $2 = (20/$Nx)*xramp($1)
-end
-
-macro mkshutter.testdata
-  mkshutter.model 800 800 0.1 0.2 0.0
-
-  tv model 0 0.2
-  resize 800 800
-  center 400 400
-
-  mkshutter.image image 0.1 10000
-  wd image im.0.fits -bitpix -32 
-  stv image 0.2
-
-  mkshutter.image image 0.2 10000
-  wd image im.1.fits -bitpix -32 
-  stv image 0.2
-
-  mkshutter.image image 0.3 10000
-  wd image im.2.fits -bitpix -32 
-  stv image 0.2
-
-  mkshutter.image image 0.5 10000
-  wd image im.3.fits -bitpix -32 
-  stv image 0.2
-
-  mkshutter.image image 1.0 10000
-  wd image im.4.fits -bitpix -32 
-  stv image 0.2
-
-  mkshutter.image image 2.0 10000
-  wd image im.5.fits -bitpix -32 
-  stv image 0.2
-
-  mkshutter.image image 5.0 10000
-  wd image im.6.fits -bitpix -32 
-  stv image 0.2
-end
