Index: trunk/ippToPsps/src/ippToPspsBatchDetection.c
===================================================================
--- trunk/ippToPsps/src/ippToPspsBatchDetection.c	(revision 29317)
+++ trunk/ippToPsps/src/ippToPspsBatchDetection.c	(revision 29318)
@@ -51,10 +51,8 @@
 
     // FrameMeta values
-    fits_write_col(this->fitsOut, TLONG, FRAMEMETA_FRAMEID, 1, 1, 1, &this->expId, &status);
+    fits_write_col(this->fitsOut, TLONG, FRAMEMETA_FRAMEID, 1, 1, 1, &this->id, &status);
     fits_write_col(this->fitsOut, TSTRING, FRAMEMETA_FRAMENAME, 1, 1, 1, &this->expName, &status);
 
-    int8_t surveyID = -1;
-    if (!ippToPspsConfig_getSurveyId(this->config, this->surveyType, &surveyID)) {return PS_EXIT_DATA_ERROR;}
-    fits_write_col(this->fitsOut, TBYTE, FRAMEMETA_SURVEYID, 1, 1, 1, &surveyID, &status);
+    fits_write_col(this->fitsOut, TBYTE, FRAMEMETA_SURVEYID, 1, 1, 1, &this->surveyID, &status);
 
     int8_t filterID = -1;
@@ -83,11 +81,4 @@
 
     // stuff for detections table
-    time_t now;
-    struct tm *ts;
-    char timeStr[12];
-    now = time(NULL);
-    ts = gmtime(&now); // TODO should be UTC
-    strftime(timeStr, sizeof(timeStr), "%Y-%m-%d", ts);
-
     uint32_t s,d, invalidDvoRows, smfJumps, unmatched, totalDetections = 0;
 
@@ -114,6 +105,6 @@
 
         filterIDs[s] = filterID;
-        surveyIDs[s] = surveyID;
-        strcpy(assocDate[s], timeStr);
+        surveyIDs[s] = this->surveyID;
+        strcpy(assocDate[s], this->todaysDate);
     }
 
@@ -178,5 +169,5 @@
 
             // create unique int from 'frameID' (aka exposure ID) and ccd number
-            pspsImageId = (this->expId*100) + image->ccdnum;
+            pspsImageId = (this->id*100) + image->ccdnum;
 
             // now get DVO detections
@@ -192,5 +183,5 @@
             imageFlags = (uint64_t)image->flags;
             fits_write_col(this->fitsOut, TLONGLONG, IMAGEMETA_IMAGEID, 1, 1, 1, &pspsImageId, &status);
-            fits_write_col(this->fitsOut, TLONG, IMAGEMETA_FRAMEID, 1, 1, 1, &this->expId, &status);
+            fits_write_col(this->fitsOut, TLONG, IMAGEMETA_FRAMEID, 1, 1, 1, &this->id, &status);
             fits_write_col(this->fitsOut, TSHORT, IMAGEMETA_CCDID, 1, 1, 1, &image->ccdnum, &status);
             fits_write_col(this->fitsOut, TLONG, IMAGEMETA_PHOTOCALID, 1, 1, 1, &image->photcode, &status);
Index: trunk/ippToPsps/src/ippToPspsBatchTest.c
===================================================================
--- trunk/ippToPsps/src/ippToPspsBatchTest.c	(revision 29317)
+++ trunk/ippToPsps/src/ippToPspsBatchTest.c	(revision 29318)
@@ -45,5 +45,5 @@
 
     // FrameMeta values
-//    fits_write_col(this->fitsOut, TLONG, FRAMEMETA_FRAMEID, 1, 1, 1, &this->expId, &status);
+//    fits_write_col(this->fitsOut, TLONG, FRAMEMETA_FRAMEID, 1, 1, 1, &this->id, &status);
 
     int8_t filterID = -1;
@@ -177,5 +177,5 @@
 
             // create unique int from 'frameID' (aka exposure ID) and ccd number
-            pspsImageId = (this->expId*100) + pImage->ccdnum;
+            pspsImageId = (this->id*100) + pImage->ccdnum;
 
             // now get DVO detections
