Index: trunk/psModules/src/detrend/pmDetrendDB.c
===================================================================
--- trunk/psModules/src/detrend/pmDetrendDB.c	(revision 11687)
+++ trunk/psModules/src/detrend/pmDetrendDB.c	(revision 11876)
@@ -24,4 +24,7 @@
 
     psFree (options->camera);
+    psFree (options->filter);
+    psFree (options->dettype);
+    psFree (options->version);
 
     return;
@@ -41,7 +44,16 @@
 
     // these other options depend on the type of detrend data
-    options->filter = NULL;  //
-    options->exptime = -1.0; // the undefined value (safe since exptime >= 0)
-    options->airmass = -1.0; // the undefined value (safe since airmass >= 1)
+    options->filter   = NULL;
+    options->version  = NULL;
+    options->dettype  = NULL;
+    options->exptime  = 0.0; 
+    options->airmass  = 0.0; 
+    options->dettemp  = 0.0; 
+    options->twilight = 0.0; 
+
+    options->exptimeSet  = false; // not selected
+    options->airmassSet  = false; // not selected
+    options->dettempSet  = false; // not selected
+    options->twilightSet = false; // not selected
 
     return options;
@@ -105,5 +117,11 @@
     psString line = NULL;
     char *time = psTimeToISO (&options->time);
-    char *type = pmDetrendTypeToString (options->type);
+
+    char *type = NULL;
+    if (options->dettype) {
+	type = psMemIncrRefCounter (options->dettype);
+    } else {
+	type = pmDetrendTypeToString (options->type);
+    }
     unsigned int nFail;
 
@@ -114,9 +132,18 @@
         psStringAppend(&line, " -filter %s", options->filter);
     }
-    if (options->exptime > -1.0) {
+    if (options->version) {
+        psStringAppend(&line, " -version %s", options->version);
+    }
+    if (options->exptimeSet) {
         psStringAppend(&line, " -exp_time %f", options->exptime);
     }
-    if (options->airmass > -1.0) {
+    if (options->airmassSet) {
         psStringAppend(&line, " -airmass %f", options->airmass);
+    }
+    if (options->dettempSet) {
+        psStringAppend(&line, " -airmass %f", options->dettemp);
+    }
+    if (options->twilightSet) {
+        psStringAppend(&line, " -airmass %f", options->twilight);
     }
 
Index: trunk/psModules/src/detrend/pmDetrendDB.h
===================================================================
--- trunk/psModules/src/detrend/pmDetrendDB.h	(revision 11687)
+++ trunk/psModules/src/detrend/pmDetrendDB.h	(revision 11876)
@@ -9,6 +9,6 @@
  * @author EAM, IfA
  *
- * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- * @date $Date: 2007-01-31 00:35:24 $
+ * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2007-02-18 21:03:20 $
  * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
  */
@@ -37,10 +37,19 @@
 typedef struct
 {
-    char *camera;   // name of camera
-    psTime time;   // time of input data
-    pmDetrendType type;   // type of detrend data
-    char *filter;   // name of filter
-    float exptime;   // exposure time (for dark, maybe flat & fringe)
-    float airmass;   // for fringe
+    char *camera;			// name of camera
+    char *version;			// optional version string
+    char *filter;			// name of filter
+    char *dettype;			// actual detrend type name
+    float exptime;			// exposure time (for dark, maybe flat & fringe)
+    float airmass;			// for fringe
+    float dettemp;			// for fringe
+    float twilight;			// hours (or seconds?) since/before nearest twilight
+    psTime time;			// time of input data
+    pmDetrendType type;			// type of detrend data
+
+    bool  exptimeSet;
+    bool  airmassSet;
+    bool  dettempSet;
+    bool  twilightSet;
 }
 pmDetrendSelectOptions;
