Index: trunk/ippdb/tests/Makefile.am
===================================================================
--- trunk/ippdb/tests/Makefile.am	(revision 9307)
+++ trunk/ippdb/tests/Makefile.am	(revision 9423)
@@ -51,9 +51,6 @@
     droptable \
     insert \
-    pop \
     insertobject \
-    popobject \
     insertfits \
-    popfits \
     selectrowsfits \
     metadatafromobject \
Index: trunk/ippdb/tests/alloc.c
===================================================================
--- trunk/ippdb/tests/alloc.c	(revision 9307)
+++ trunk/ippdb/tests/alloc.c	(revision 9423)
@@ -1022,10 +1022,14 @@
         detRunRow       *object;
 
-        object = detRunRowAlloc(-32, "a string", "a string"    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
+        object = detRunRowAlloc(-32, -32, "a string", "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->det_id == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
         if (!object->iteration == -32) {
             psFree(object);
Index: trunk/ippdb/tests/insert.c
===================================================================
--- trunk/ippdb/tests/insert.c	(revision 9307)
+++ trunk/ippdb/tests/insert.c	(revision 9423)
@@ -358,5 +358,5 @@
         }
 
-        if (!detRunInsert(dbh, -32, "a string", "a string")) {
+        if (!detRunInsert(dbh, -32, -32, "a string", "a string")) {
             exit(EXIT_FAILURE);
         }
Index: trunk/ippdb/tests/insertobject.c
===================================================================
--- trunk/ippdb/tests/insertobject.c	(revision 9307)
+++ trunk/ippdb/tests/insertobject.c	(revision 9423)
@@ -520,5 +520,5 @@
         }
 
-        object = detRunRowAlloc(-32, "a string", "a string");
+        object = detRunRowAlloc(-32, -32, "a string", "a string");
         if (!object) {
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/metadatafromobject.c
===================================================================
--- trunk/ippdb/tests/metadatafromobject.c	(revision 9307)
+++ trunk/ippdb/tests/metadatafromobject.c	(revision 9423)
@@ -1208,5 +1208,5 @@
         bool            status;
 
-        object = detRunRowAlloc(-32, "a string", "a string");
+        object = detRunRowAlloc(-32, -32, "a string", "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -1220,4 +1220,8 @@
         psFree(object);
 
+        if (!psMetadataLookupS32(&status, md, "det_id") == -32) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
         if (!psMetadataLookupS32(&status, md, "iteration") == -32) {
             psFree(md);
Index: trunk/ippdb/tests/objectfrommetadata.c
===================================================================
--- trunk/ippdb/tests/objectfrommetadata.c	(revision 9307)
+++ trunk/ippdb/tests/objectfrommetadata.c	(revision 9423)
@@ -1851,4 +1851,8 @@
 
         md = psMetadataAlloc();
+        if (!psMetadataAddS32(md, PS_LIST_TAIL, "det_id", 0, NULL, -32)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
         if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, -32)) {
             psFree(md);
@@ -1872,4 +1876,8 @@
         psFree(md);
 
+        if (!object->det_id == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
         if (!object->iteration == -32) {
             psFree(object);
Index: trunk/ippdb/tests/pop.c
===================================================================
--- trunk/ippdb/tests/pop.c	(revision 9307)
+++ 	(revision )
@@ -1,814 +1,0 @@
-#include <pslib.h>
-#include <ippdb.h>
-#include <stdlib.h>
-
-int main ()
-{
-    {
-        psDB            *dbh;
-        psF32           temp01;
-        psF32           humi01;
-        psF32           temp02;
-        psF32           humi02;
-        psF32           temp03;
-        psF32           humi03;
-        psF32           pressure;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!weatherPop(dbh, &temp01, &humi01, &temp02, &humi02, &temp03, &humi03, &pressure)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            filter[256];
-        psF64           trans;
-        psS32           nstars;
-        psF64           ra;
-        psF64           decl;
-        psF32           exptime;
-        psF64           sky_bright;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!skyp_transparencyPop(dbh, (char **)&filter, &trans, &nstars, &ra, &decl, &exptime, &sky_bright)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            disperser_id[256];
-        psF32           atmcomp1;
-        psF32           atmcomp2;
-        psF32           atmcomp3;
-        psS32           nstars;
-        psF64           ra;
-        psF64           decl;
-        psF32           exptime;
-        psF64           sky_bright;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!skyp_absorptionPop(dbh, (char **)&disperser_id, &atmcomp1, &atmcomp2, &atmcomp3, &nstars, &ra, &decl, &exptime, &sky_bright)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            disperser_id[256];
-        psF32           atmcomp1;
-        psF32           atmcomp2;
-        psF32           atmcomp3;
-        psF32           continuum;
-        psF32           exptime;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!skyp_emissionPop(dbh, (char **)&disperser_id, &atmcomp1, &atmcomp2, &atmcomp3, &continuum, &exptime)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psF32           sigmax;
-        psF32           sigmay;
-        psF32           fwhm;
-        psF64           ra;
-        psF64           decl;
-        psF32           expttime;
-        char            telescope_id[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!dimmPop(dbh, &sigmax, &sigmay, &fwhm, &ra, &decl, &expttime, (char **)&telescope_id)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psF64           sky_bright;
-        psF64           sky_var;
-        psF64           ra;
-        psF64           decl;
-        psF32           fov_x;
-        psF32           fov_y;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!skyp_irPop(dbh, &sky_bright, &sky_var, &ra, &decl, &fov_x, &fov_y)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psF32           az;
-        bool            open;
-        bool            light;
-        bool            track;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!domePop(dbh, &az, &open, &light, &track)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            guide[256];
-        psF32           alt;
-        psF32           az;
-        psF64           ra;
-        psF64           decl;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!telescopePop(dbh, (char **)&guide, &alt, &az, &ra, &decl)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_id[256];
-        char            camera[256];
-        char            telescope[256];
-        char            exp_type[256];
-        char            uri[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!summitExpPop(dbh, (char **)&exp_id, (char **)&camera, (char **)&telescope, (char **)&exp_type, (char **)&uri)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_id[256];
-        char            camera[256];
-        char            telescope[256];
-        char            exp_type[256];
-        psS32           imfiles;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!pzPendingExpPop(dbh, (char **)&exp_id, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_id[256];
-        char            camera[256];
-        char            telescope[256];
-        psS32           bytes;
-        char            md5sum[256];
-        char            class[256];
-        char            class_id[256];
-        char            uri[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!pzPendingImfilePop(dbh, (char **)&exp_id, (char **)&camera, (char **)&telescope, &bytes, (char **)&md5sum, (char **)&class, (char **)&class_id, (char **)&uri)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_tag[256];
-        char            exp_id[256];
-        char            camera[256];
-        char            telescope[256];
-        char            exp_type[256];
-        psS32           imfiles;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!newExpPop(dbh, (char **)&exp_tag, (char **)&exp_id, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_tag[256];
-        char            class[256];
-        char            class_id[256];
-        char            uri[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!newImfilePop(dbh, (char **)&exp_tag, (char **)&class, (char **)&class_id, (char **)&uri)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_tag[256];
-        char            camera[256];
-        char            telescope[256];
-        char            exp_type[256];
-        psS32           imfiles;
-        char            filter[256];
-        psF32           airmass;
-        psF64           ra;
-        psF64           decl;
-        psF32           exp_time;
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-        psF64           alt;
-        psF64           az;
-        psF32           ccd_temp;
-        psF64           posang;
-        char            object[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!rawDetrendExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&object)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_tag[256];
-        char            camera[256];
-        char            telescope[256];
-        char            exp_type[256];
-        psS32           imfiles;
-        char            filter[256];
-        psF32           airmass;
-        psF64           ra;
-        psF64           decl;
-        psF32           exp_time;
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-        psF64           alt;
-        psF64           az;
-        psF32           ccd_temp;
-        psF64           posang;
-        char            object[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!rawScienceExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&object)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_tag[256];
-        char            class[256];
-        char            class_id[256];
-        char            uri[256];
-        char            exp_type[256];
-        char            filter[256];
-        psF32           airmass;
-        psF64           ra;
-        psF64           decl;
-        psF32           exp_time;
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-        psF64           alt;
-        psF64           az;
-        psF32           ccd_temp;
-        psF64           posang;
-        char            object[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!rawImfilePop(dbh, (char **)&exp_tag, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&exp_type, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&object)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_tag[256];
-        char            recipe[256];
-        psS32           p1_version;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p1PendingExpPop(dbh, (char **)&exp_tag, (char **)&recipe, &p1_version)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_tag[256];
-        char            recipe[256];
-        psS32           p1_version;
-        psS32           p2_version;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p2PendingExpPop(dbh, (char **)&exp_tag, (char **)&recipe, &p1_version, &p2_version)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_tag[256];
-        char            class_id[256];
-        char            uri[256];
-        char            recipe[256];
-        psS32           p1_version;
-        psS32           p2_version;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p2PendingImfilePop(dbh, (char **)&exp_tag, (char **)&class_id, (char **)&uri, (char **)&recipe, &p1_version, &p2_version)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_tag[256];
-        psS32           p1_version;
-        psS32           p2_version;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p2ProcessedExpPop(dbh, (char **)&exp_tag, &p1_version, &p2_version)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_tag[256];
-        char            class_id[256];
-        char            uri[256];
-        char            recipe[256];
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-        char            b1_uri[256];
-        char            b2_uri[256];
-        psS32           p1_version;
-        psS32           p2_version;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p2ProcessedImfilePop(dbh, (char **)&exp_tag, (char **)&class_id, (char **)&uri, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev, (char **)&b1_uri, (char **)&b2_uri, &p1_version, &p2_version)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_tag[256];
-        psS32           p2_version;
-        psS32           p3_version;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p3PendingExpPop(dbh, (char **)&exp_tag, &p2_version, &p3_version)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        char            exp_tag[256];
-        char            uri[256];
-        char            recipe[256];
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-        psF32           sigma_ra;
-        psF32           sigma_dec;
-        psS32           nastro;
-        char            b1_uri[256];
-        char            b2_uri[256];
-        psF32           zp_mean;
-        psF32           zp_stdev;
-        psS32           p2_version;
-        psS32           p3_version;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p3ProcessedExpPop(dbh, (char **)&exp_tag, (char **)&uri, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev, &sigma_ra, &sigma_dec, &nastro, (char **)&b1_uri, (char **)&b2_uri, &zp_mean, &zp_stdev, &p2_version, &p3_version)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           iteration;
-        char            det_type[256];
-        char            state[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detRunPop(dbh, &iteration, (char **)&det_type, (char **)&state)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           det_id;
-        psS32           iteration;
-        char            exp_tag[256];
-        bool            include;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detInputExpPop(dbh, &det_id, &iteration, (char **)&exp_tag, &include)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           det_id;
-        char            exp_tag[256];
-        char            class_id[256];
-        char            uri[256];
-        char            recipe[256];
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-        char            b1_uri[256];
-        char            b2_uri[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detProcessedImfilePop(dbh, &det_id, (char **)&exp_tag, (char **)&class_id, (char **)&uri, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev, (char **)&b1_uri, (char **)&b2_uri)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           det_id;
-        char            exp_tag[256];
-        char            recipe[256];
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-        char            b1_uri[256];
-        char            b2_uri[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detProcessedExpPop(dbh, &det_id, (char **)&exp_tag, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev, (char **)&b1_uri, (char **)&b2_uri)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           det_id;
-        psS32           iteration;
-        char            class_id[256];
-        char            uri[256];
-        char            recipe[256];
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detStackedImfilePop(dbh, &det_id, &iteration, (char **)&class_id, (char **)&uri, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           det_id;
-        psS32           iteration;
-        char            class_id[256];
-        psF32           norm;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detNormalizedStatImfilePop(dbh, &det_id, &iteration, (char **)&class_id, &norm)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           det_id;
-        psS32           iteration;
-        char            class_id[256];
-        char            uri[256];
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-        char            b1_uri[256];
-        char            b2_uri[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detNormalizedImfilePop(dbh, &det_id, &iteration, (char **)&class_id, (char **)&uri, &bg, &bg_stdev, &bg_mean_stdev, (char **)&b1_uri, (char **)&b2_uri)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           det_id;
-        psS32           iteration;
-        char            recipe[256];
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-        char            b1_uri[256];
-        char            b2_uri[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detNormalizedExpPop(dbh, &det_id, &iteration, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev, (char **)&b1_uri, (char **)&b2_uri)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           det_id;
-        psS32           iteration;
-        char            comment[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detMasterFramePop(dbh, &det_id, &iteration, (char **)&comment)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           det_id;
-        char            class_id[256];
-        char            uri[256];
-        char            recipe[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detMasterImfilePop(dbh, &det_id, (char **)&class_id, (char **)&uri, (char **)&recipe)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           det_id;
-        psS32           iteration;
-        char            exp_tag[256];
-        char            class_id[256];
-        char            uri[256];
-        char            recipe[256];
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-        char            b1_uri[256];
-        char            b2_uri[256];
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detResidImfilePop(dbh, &det_id, &iteration, (char **)&exp_tag, (char **)&class_id, (char **)&uri, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev, (char **)&b1_uri, (char **)&b2_uri)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           det_id;
-        psS32           iteration;
-        char            exp_tag[256];
-        char            recipe[256];
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-        char            b1_uri[256];
-        char            b2_uri[256];
-        bool            accept;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detResidExpPop(dbh, &det_id, &iteration, (char **)&exp_tag, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev, (char **)&b1_uri, (char **)&b2_uri, &accept)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psS32           det_id;
-        psS32           iteration;
-        psF64           bg;
-        psF64           bg_stdev;
-        psF64           bg_mean_stdev;
-        bool            accept;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detRunSummaryPop(dbh, &det_id, &iteration, &bg, &bg_stdev, &bg_mean_stdev, &accept)) { 
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    exit(EXIT_SUCCESS);
-}
Index: trunk/ippdb/tests/popfits.c
===================================================================
--- trunk/ippdb/tests/popfits.c	(revision 9307)
+++ 	(revision )
@@ -1,948 +1,0 @@
-#include <pslib.h>
-#include <ippdb.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#define TMP_FILENAME "./blargh"
-
-int main ()
-{
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!weatherPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!skyp_transparencyPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!skyp_absorptionPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!skyp_emissionPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!dimmPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!skyp_irPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!domePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!telescopePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!summitExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!pzPendingExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!pzPendingImfilePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!newExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!newImfilePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!rawDetrendExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!rawScienceExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!rawImfilePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p1PendingExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p2PendingExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p2PendingImfilePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p2ProcessedExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p2ProcessedImfilePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p3PendingExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p3ProcessedExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detRunPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detInputExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detProcessedImfilePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detProcessedExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detStackedImfilePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detNormalizedStatImfilePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detNormalizedImfilePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detNormalizedExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detMasterFramePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detMasterImfilePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detResidImfilePopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detResidExpPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        psFits          *fits;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        // allocate a temp
-        fits = psFitsOpen(TMP_FILENAME, "w");
-        if (!fits) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detRunSummaryPopFits(dbh, fits, 1)) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!psFitsClose(fits)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    exit(EXIT_SUCCESS);
-}
Index: trunk/ippdb/tests/popobject.c
===================================================================
--- trunk/ippdb/tests/popobject.c	(revision 9307)
+++ 	(revision )
@@ -1,656 +1,0 @@
-#include <pslib.h>
-#include <ippdb.h>
-#include <stdlib.h>
-
-int main ()
-{
-    {
-        psDB            *dbh;
-        weatherRow      *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = weatherPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        skyp_transparencyRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = skyp_transparencyPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        skyp_absorptionRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = skyp_absorptionPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        skyp_emissionRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = skyp_emissionPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        dimmRow         *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = dimmPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        skyp_irRow      *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = skyp_irPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        domeRow         *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = domePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        telescopeRow    *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = telescopePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        summitExpRow    *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = summitExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        pzPendingExpRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = pzPendingExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        pzPendingImfileRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = pzPendingImfilePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        newExpRow       *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = newExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        newImfileRow    *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = newImfilePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        rawDetrendExpRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = rawDetrendExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        rawScienceExpRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = rawScienceExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        rawImfileRow    *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = rawImfilePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        p1PendingExpRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = p1PendingExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        p2PendingExpRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = p2PendingExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        p2PendingImfileRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = p2PendingImfilePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        p2ProcessedExpRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = p2ProcessedExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        p2ProcessedImfileRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = p2ProcessedImfilePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        p3PendingExpRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = p3PendingExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        p3ProcessedExpRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = p3ProcessedExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detRunRow       *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detRunPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detInputExpRow  *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detInputExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detProcessedImfileRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detProcessedImfilePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detProcessedExpRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detProcessedExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detStackedImfileRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detStackedImfilePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detNormalizedStatImfileRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detNormalizedStatImfilePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detNormalizedImfileRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detNormalizedImfilePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detNormalizedExpRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detNormalizedExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detMasterFrameRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detMasterFramePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detMasterImfileRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detMasterImfilePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detResidImfileRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detResidImfilePopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detResidExpRow  *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detResidExpPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-        detRunSummaryRow *object;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        object = detRunSummaryPopObject(dbh);
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
-        psFree(object);
-        psDBCleanup(dbh);
-    }
-
-    exit(EXIT_SUCCESS);
-}
Index: trunk/ippdb/tests/testsuite.at
===================================================================
--- trunk/ippdb/tests/testsuite.at	(revision 9307)
+++ trunk/ippdb/tests/testsuite.at	(revision 9423)
@@ -60,16 +60,4 @@
 
 ###
-AT_SETUP([Pop()])
-AT_KEYWORDS([Pop])
-
-AT_CHECK([dbsetup])
-# run insert so there is a row in the table
-AT_CHECK([insert])
-AT_CHECK([pop])
-AT_CHECK([dbcleanup])
-
-AT_CLEANUP
-
-###
 AT_SETUP([InsertObject()])
 AT_KEYWORDS([InsertObject])
@@ -77,16 +65,4 @@
 AT_CHECK([dbsetup])
 AT_CHECK([insertobject])
-AT_CHECK([dbcleanup])
-
-AT_CLEANUP
-
-###
-AT_SETUP([PopObject()])
-AT_KEYWORDS([PopObject])
-
-AT_CHECK([dbsetup])
-# run insert so there is a row in the table
-AT_CHECK([insert])
-AT_CHECK([popobject])
 AT_CHECK([dbcleanup])
 
@@ -101,21 +77,6 @@
 AT_CHECK([insert])
 # run popfis so there is afits file to read
-AT_CHECK([popfits])
+AT_CHECK([selectrowsfits])
 AT_CHECK([insertfits])
-AT_CHECK([dbcleanup])
-if [ test -f "blargh" ] ; then
-    rm -f "blargh"
-fi
-
-AT_CLEANUP
-
-###
-AT_SETUP([PopFits()])
-AT_KEYWORDS([PopFits])
-
-AT_CHECK([dbsetup])
-# run insert so there is a row in the table
-AT_CHECK([insert])
-AT_CHECK([popfits])
 AT_CHECK([dbcleanup])
 if [ test -f "blargh" ] ; then
