Index: /trunk/dbconfig/tasks.md
===================================================================
--- /trunk/dbconfig/tasks.md	(revision 15774)
+++ /trunk/dbconfig/tasks.md	(revision 15775)
@@ -1,3 +1,3 @@
-# $Id: tasks.md,v 1.142 2007-12-06 01:01:03 eugene Exp $
+# $Id: tasks.md,v 1.143 2007-12-08 03:17:56 eugene Exp $
 
 # this table records all exposure ID ever seen from the summit
@@ -118,4 +118,5 @@
     reduction   STR         64      # Reduction class
     filter      STR         64
+    comment     STR         80
     airmass     F32         0.0
     ra          F64         0.0
@@ -130,19 +131,25 @@
     ccd_temp    F32         0.0
     posang      F64         0.0 
-    M1_x        F32         0.0
-    M1_y        F32         0.0
-    M1_z        F32         0.0
-    M1_tip      F32         0.0
-    M1_tilt     F32         0.0
-    M2_x        F32         0.0
-    M2_y        F32         0.0
-    M2_z        F32         0.0
-    M2_tip      F32         0.0
-    M2_tilt     F32         0.0
-    env_temperature F32         0.0
-    env_humidity    F32         0.0
-    env_wind_speed  F32         0.0
-    env_wind_dir    F32         0.0
-    pon_time        F32         0.0
+    m1_x        F32         0.0
+    m1_y        F32         0.0
+    m1_z        F32         0.0
+    m1_tip      F32         0.0
+    m1_tilt     F32         0.0
+    m2_x        F32         0.0
+    m2_y        F32         0.0
+    m2_z        F32         0.0
+    m2_tip      F32         0.0
+    m2_tilt     F32         0.0
+    env_temperature F32     0.0
+    env_humidity    F32     0.0
+    env_wind_speed  F32     0.0
+    env_wind_dir    F32     0.0
+    teltemp_m1      F32     0.0
+    teltemp_m1cell  F32     0.0
+    teltemp_m2      F32     0.0
+    teltemp_spider  F32     0.0
+    teltemp_truss   F32     0.0
+    teltemp_extra   F32     0.0
+    pon_time        F32     0.0
     user_1      F64         0.0
     user_2      F64         0.0
@@ -170,4 +177,5 @@
     filelevel   STR         64 
     filter      STR         64
+    comment     STR         80
     airmass     F32         0.0
     ra          F64         0.0
@@ -182,19 +190,25 @@
     ccd_temp    F32         0.0
     posang      F64         0.0 
-    M1_x        F32         0.0
-    M1_y        F32         0.0
-    M1_z        F32         0.0
-    M1_tip      F32         0.0
-    M1_tilt     F32         0.0
-    M2_x        F32         0.0
-    M2_y        F32         0.0
-    M2_z        F32         0.0
-    M2_tip      F32         0.0
-    M2_tilt     F32         0.0
-    env_temperature F32         0.0
-    env_humidity    F32         0.0
-    env_wind_speed  F32         0.0
-    env_wind_dir    F32         0.0
-    pon_time        F32         0.0
+    m1_x        F32         0.0
+    m1_y        F32         0.0
+    m1_z        F32         0.0
+    m1_tip      F32         0.0
+    m1_tilt     F32         0.0
+    m2_x        F32         0.0
+    m2_y        F32         0.0
+    m2_z        F32         0.0
+    m2_tip      F32         0.0
+    m2_tilt     F32         0.0
+    env_temperature F32     0.0
+    env_humidity    F32     0.0
+    env_wind_speed  F32     0.0
+    env_wind_dir    F32     0.0
+    teltemp_m1      F32     0.0
+    teltemp_m1cell  F32     0.0
+    teltemp_m2      F32     0.0
+    teltemp_spider  F32     0.0
+    teltemp_truss   F32     0.0
+    teltemp_extra   F32     0.0
+    pon_time        F32     0.0
     user_1      F64         0.0
     user_2      F64         0.0
Index: /trunk/ippTools/src/regtool.c
===================================================================
--- /trunk/ippTools/src/regtool.c	(revision 15774)
+++ /trunk/ippTools/src/regtool.c	(revision 15775)
@@ -589,5 +589,5 @@
         }
         if (exp_id) {
-            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) {
+            if (!psMetadataAddStr(where, PS_LIST_TAIL, "T1.exp_id", 0, "==", exp_id)) {
                 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
                 psFree(where);
@@ -597,9 +597,10 @@
         }
 
-        psString whereClaus = psDBGenerateWhereSQL(where, NULL);
+
+        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
         psFree(where);
-        if (whereClaus) {
-            psStringAppend(&query, " %s", whereClaus);
-            psFree(whereClaus);
+        if (whereClause) {
+	    psStringAppend(&query, " AND %s", whereClause);
+	    psFree(whereClause);
         }
     }
@@ -1023,4 +1024,10 @@
     }
 
+    psString comment = psMetadataLookupStr(&status, config->args, "-comment");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -comment");
+        return false;
+    }
+
     psF32 airmass = psMetadataLookupF32(&status, config->args, "-airmass");
     if (!status) {
@@ -1095,53 +1102,53 @@
     }
 
-    psF32 M1_x = psMetadataLookupF32(&status, config->args, "-M1_x");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M1_x");
-        return false;
-    }
-    psF32 M1_y = psMetadataLookupF32(&status, config->args, "-M1_y");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M1_y");
-        return false;
-    }
-    psF32 M1_z = psMetadataLookupF32(&status, config->args, "-M1_z");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M1_z");
-        return false;
-    }
-    psF32 M1_tip = psMetadataLookupF32(&status, config->args, "-M1_tip");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M1_tip");
-        return false;
-    }
-    psF32 M1_tilt = psMetadataLookupF32(&status, config->args, "-M1_tilt");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M1_tilt");
-        return false;
-    }
-
-    psF32 M2_x = psMetadataLookupF32(&status, config->args, "-M2_x");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M2_x");
-        return false;
-    }
-    psF32 M2_y = psMetadataLookupF32(&status, config->args, "-M2_y");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M2_y");
-        return false;
-    }
-    psF32 M2_z = psMetadataLookupF32(&status, config->args, "-M2_z");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M2_z");
-        return false;
-    }
-    psF32 M2_tip = psMetadataLookupF32(&status, config->args, "-M2_tip");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M2_tip");
-        return false;
-    }
-    psF32 M2_tilt = psMetadataLookupF32(&status, config->args, "-M2_tilt");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M2_tilt");
+    psF32 m1_x = psMetadataLookupF32(&status, config->args, "-m1_x");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m1_x");
+        return false;
+    }
+    psF32 m1_y = psMetadataLookupF32(&status, config->args, "-m1_y");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m1_y");
+        return false;
+    }
+    psF32 m1_z = psMetadataLookupF32(&status, config->args, "-m1_z");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m1_z");
+        return false;
+    }
+    psF32 m1_tip = psMetadataLookupF32(&status, config->args, "-m1_tip");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m1_tip");
+        return false;
+    }
+    psF32 m1_tilt = psMetadataLookupF32(&status, config->args, "-m1_tilt");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m1_tilt");
+        return false;
+    }
+
+    psF32 m2_x = psMetadataLookupF32(&status, config->args, "-m2_x");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m2_x");
+        return false;
+    }
+    psF32 m2_y = psMetadataLookupF32(&status, config->args, "-m2_y");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m2_y");
+        return false;
+    }
+    psF32 m2_z = psMetadataLookupF32(&status, config->args, "-m2_z");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m2_z");
+        return false;
+    }
+    psF32 m2_tip = psMetadataLookupF32(&status, config->args, "-m2_tip");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m2_tip");
+        return false;
+    }
+    psF32 m2_tilt = psMetadataLookupF32(&status, config->args, "-m2_tilt");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m2_tilt");
         return false;
     }
@@ -1165,4 +1172,35 @@
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -env_wind_dir");
+        return false;
+    }
+
+    psF32 teltemp_m1 = psMetadataLookupF32(&status, config->args, "-teltemp_m1");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -teltemp_m1");
+        return false;
+    }
+    psF32 teltemp_m1cell = psMetadataLookupF32(&status, config->args, "-teltemp_m1cell");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -teltemp_m1cell");
+        return false;
+    }
+    psF32 teltemp_m2 = psMetadataLookupF32(&status, config->args, "-teltemp_m2");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -teltemp_m2");
+        return false;
+    }
+    psF32 teltemp_spider = psMetadataLookupF32(&status, config->args, "-teltemp_spider");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -teltemp_spider");
+        return false;
+    }
+    psF32 teltemp_truss = psMetadataLookupF32(&status, config->args, "-teltemp_truss");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -teltemp_truss");
+        return false;
+    }
+    psF32 teltemp_extra = psMetadataLookupF32(&status, config->args, "-teltemp_extra");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -teltemp_extra");
         return false;
     }
@@ -1240,4 +1278,5 @@
         reduction ? reduction : exp->reduction,
         filter,
+	comment,
         airmass,
         ra,
@@ -1252,18 +1291,24 @@
         ccd_temp,
         posang,
-	M1_x,
-	M1_y,
-	M1_z,
-	M1_tip,
-	M1_tilt,
-	M2_x,
-	M2_y,
-	M2_z,
-	M2_tip,
-	M2_tilt,
+	m1_x,
+	m1_y,
+	m1_z,
+	m1_tip,
+	m1_tilt,
+	m2_x,
+	m2_y,
+	m2_z,
+	m2_tip,
+	m2_tilt,
 	env_temp,
 	env_humid,
 	env_wind,
 	env_dir,
+	teltemp_m1,
+	teltemp_m1cell,
+	teltemp_m2,
+	teltemp_spider,
+	teltemp_truss,
+	teltemp_extra,
 	pon_time,
         user_1,
@@ -1361,4 +1406,10 @@
     }
 
+    psString comment = psMetadataLookupStr(&status, config->args, "-comment");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -comment");
+        return false;
+    }
+
     psF32 airmass = psMetadataLookupF32(&status, config->args, "-airmass");
     if (!status) {
@@ -1433,53 +1484,53 @@
     }
 
-    psF32 M1_x = psMetadataLookupF32(&status, config->args, "-M1_x");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M1_x");
-        return false;
-    }
-    psF32 M1_y = psMetadataLookupF32(&status, config->args, "-M1_y");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M1_y");
-        return false;
-    }
-    psF32 M1_z = psMetadataLookupF32(&status, config->args, "-M1_z");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M1_z");
-        return false;
-    }
-    psF32 M1_tip = psMetadataLookupF32(&status, config->args, "-M1_tip");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M1_tip");
-        return false;
-    }
-    psF32 M1_tilt = psMetadataLookupF32(&status, config->args, "-M1_tilt");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M1_tilt");
-        return false;
-    }
-
-    psF32 M2_x = psMetadataLookupF32(&status, config->args, "-M2_x");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M2_x");
-        return false;
-    }
-    psF32 M2_y = psMetadataLookupF32(&status, config->args, "-M2_y");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M2_y");
-        return false;
-    }
-    psF32 M2_z = psMetadataLookupF32(&status, config->args, "-M2_z");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M2_z");
-        return false;
-    }
-    psF32 M2_tip = psMetadataLookupF32(&status, config->args, "-M2_tip");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M2_tip");
-        return false;
-    }
-    psF32 M2_tilt = psMetadataLookupF32(&status, config->args, "-M2_tilt");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -M2_tilt");
+    psF32 m1_x = psMetadataLookupF32(&status, config->args, "-m1_x");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m1_x");
+        return false;
+    }
+    psF32 m1_y = psMetadataLookupF32(&status, config->args, "-m1_y");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m1_y");
+        return false;
+    }
+    psF32 m1_z = psMetadataLookupF32(&status, config->args, "-m1_z");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m1_z");
+        return false;
+    }
+    psF32 m1_tip = psMetadataLookupF32(&status, config->args, "-m1_tip");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m1_tip");
+        return false;
+    }
+    psF32 m1_tilt = psMetadataLookupF32(&status, config->args, "-m1_tilt");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m1_tilt");
+        return false;
+    }
+
+    psF32 m2_x = psMetadataLookupF32(&status, config->args, "-m2_x");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m2_x");
+        return false;
+    }
+    psF32 m2_y = psMetadataLookupF32(&status, config->args, "-m2_y");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m2_y");
+        return false;
+    }
+    psF32 m2_z = psMetadataLookupF32(&status, config->args, "-m2_z");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m2_z");
+        return false;
+    }
+    psF32 m2_tip = psMetadataLookupF32(&status, config->args, "-m2_tip");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m2_tip");
+        return false;
+    }
+    psF32 m2_tilt = psMetadataLookupF32(&status, config->args, "-m2_tilt");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -m2_tilt");
         return false;
     }
@@ -1503,4 +1554,35 @@
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -env_wind_dir");
+        return false;
+    }
+
+    psF32 teltemp_m1 = psMetadataLookupF32(&status, config->args, "-teltemp_m1");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -teltemp_m1");
+        return false;
+    }
+    psF32 teltemp_m1cell = psMetadataLookupF32(&status, config->args, "-teltemp_m1cell");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -teltemp_m1cell");
+        return false;
+    }
+    psF32 teltemp_m2 = psMetadataLookupF32(&status, config->args, "-teltemp_m2");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -teltemp_m2");
+        return false;
+    }
+    psF32 teltemp_spider = psMetadataLookupF32(&status, config->args, "-teltemp_spider");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -teltemp_spider");
+        return false;
+    }
+    psF32 teltemp_truss = psMetadataLookupF32(&status, config->args, "-teltemp_truss");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -teltemp_truss");
+        return false;
+    }
+    psF32 teltemp_extra = psMetadataLookupF32(&status, config->args, "-teltemp_extra");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -teltemp_extra");
         return false;
     }
@@ -1577,4 +1659,5 @@
         filelevel,
         filter,
+	comment,
         airmass,
         ra,
@@ -1589,18 +1672,24 @@
         ccd_temp,
         posang,
-	M1_x,
-	M1_y,
-	M1_z,
-	M1_tip,
-	M1_tilt,
-	M2_x,
-	M2_y,
-	M2_z,
-	M2_tip,
-	M2_tilt,
+	m1_x,
+	m1_y,
+	m1_z,
+	m1_tip,
+	m1_tilt,
+	m2_x,
+	m2_y,
+	m2_z,
+	m2_tip,
+	m2_tilt,
 	env_temp,
 	env_humid,
 	env_wind,
 	env_dir,
+	teltemp_m1,
+	teltemp_m1cell,
+	teltemp_m2,
+	teltemp_spider,
+	teltemp_truss,
+	teltemp_extra,
 	pon_time,
         user_1,
Index: /trunk/ippTools/src/regtoolConfig.c
===================================================================
--- /trunk/ippTools/src/regtoolConfig.c	(revision 15774)
+++ /trunk/ippTools/src/regtoolConfig.c	(revision 15775)
@@ -79,4 +79,6 @@
     psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-filter",  0,
         "define filter ", NULL);
+    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-comment",  0,
+        "define comment ", NULL);
     psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-airmass",  0,
         "define airmass", NAN);
@@ -103,23 +105,23 @@
     psMetadataAddF64(addprocessedimfileArgs, PS_LIST_TAIL, "-posang",  0,
         "define rotator position angle", NAN);
-    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-M1_x",  0,
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-m1_x",  0,
             "define M1 X position", NAN);
-    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-M1_y",  0,
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-m1_y",  0,
             "define M1 Y position", NAN);
-    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-M1_z",  0,
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-m1_z",  0,
             "define M1 Z position", NAN);
-    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-M1_tip",  0,
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-m1_tip",  0,
             "define M1 TIP position", NAN);
-    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-M1_tilt",  0,
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-m1_tilt",  0,
             "define M1 TILT position", NAN);
-    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-M2_x",  0,
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-m2_x",  0,
             "define M2 X position", NAN);
-    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-M2_y",  0,
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-m2_y",  0,
             "define M2 Y position", NAN);
-    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-M2_z",  0,
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-m2_z",  0,
             "define M2 Z position", NAN);
-    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-M2_tip",  0,
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-m2_tip",  0,
             "define M2 TIP position", NAN);
-    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-M2_tilt",  0,
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-m2_tilt",  0,
             "define M2 TILT position", NAN);
     psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-env_temperature",  0,
@@ -131,4 +133,16 @@
     psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-env_wind_dir",  0,
             "define Environmental Wind Direction", NAN);
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-teltemp_m1",  0,
+            "define Telescope Temperature : M1", NAN);
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-teltemp_m1cell",  0,
+            "define Telescope Temperature : M1 Cell", NAN);
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-teltemp_m2",  0,
+            "define Telescope Temperature : M2", NAN);
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-teltemp_spider",  0,
+            "define Telescope Temperature : Spider", NAN);
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-teltemp_truss",  0,
+            "define Telescope Temperature : Truss", NAN);
+    psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-teltemp_extra",  0,
+            "define Telescope Temperature : Extra", NAN);
     psMetadataAddF32(addprocessedimfileArgs, PS_LIST_TAIL, "-pon_time",  0,
             "define time to last Power On", NAN);
@@ -222,4 +236,6 @@
     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-filter",  0,
         "define filter ", NULL);
+    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-comment",  0,
+        "define comment ", NULL);
     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-airmass",  0,
         "define airmass", NAN);
@@ -246,23 +262,23 @@
     psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-posang",  0,
         "define rotator position angle", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-M1_x",  0,
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m1_x",  0,
             "define M1 X position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-M1_y",  0,
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m1_y",  0,
             "define M1 Y position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-M1_z",  0,
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m1_z",  0,
             "define M1 Z position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-M1_tip",  0,
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m1_tip",  0,
             "define M1 TIP position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-M1_tilt",  0,
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m1_tilt",  0,
             "define M1 TILT position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-M2_x",  0,
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m2_x",  0,
             "define M2 X position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-M2_y",  0,
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m2_y",  0,
             "define M2 Y position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-M2_z",  0,
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m2_z",  0,
             "define M2 Z position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-M2_tip",  0,
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m2_tip",  0,
             "define M2 TIP position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-M2_tilt",  0,
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m2_tilt",  0,
             "define M2 TILT position", NAN);
     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-env_temperature",  0,
@@ -274,4 +290,16 @@
     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-env_wind_dir",  0,
             "define Environmental Wind Direction", NAN);
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-teltemp_m1",  0,
+            "define Telescope Temperature : M1", NAN);
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-teltemp_m1cell",  0,
+            "define Telescope Temperature : M1 Cell", NAN);
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-teltemp_m2",  0,
+            "define Telescope Temperature : M2", NAN);
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-teltemp_spider",  0,
+            "define Telescope Temperature : Spider", NAN);
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-teltemp_truss",  0,
+            "define Telescope Temperature : Truss", NAN);
+    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-teltemp_extra",  0,
+            "define Telescope Temperature : Extra", NAN);
     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-pon_time",  0,
             "define time to last Power On", NAN);
Index: /trunk/ippconfig/gpc1/format_raw.config
===================================================================
--- /trunk/ippconfig/gpc1/format_raw.config	(revision 15774)
+++ /trunk/ippconfig/gpc1/format_raw.config	(revision 15775)
@@ -2,25 +2,25 @@
 
 # How to identify this type
-RULE	METADATA
-#	TELESCOP	STR	PS1
-#	DETECTOR	STR	GPC1
-	CONTROLR	STR	STARGRASP
-	EXTEND		BOOL	T
-	NEXTEND		S32	64
-	NAMPS		S32	64
+RULE    METADATA
+#       TELESCOP        STR     PS1
+#       DETECTOR        STR     GPC1
+        CONTROLR        STR     STARGRASP
+        EXTEND          BOOL    T
+        NEXTEND         S32     64
+        NAMPS           S32     64
 END
 
 # How to read this data
-FILE	METADATA
-	PHU		STR	CHIP	   # The FITS file represents a single chip
-	EXTENSIONS	STR	CELL	   # The extensions represent cells
-	FPA.NAME	STR	CONTROLR   # A PHU keyword for unique identifier within the hierarchy level
-	CONTENT	        STR     DETECTOR   # How to determine content of FITS file
-	CONTENT.RULE	STR	{CHIP.ID}  # How to derive the CONTENT when writing
+FILE    METADATA
+        PHU             STR     CHIP       # The FITS file represents a single chip
+        EXTENSIONS      STR     CELL       # The extensions represent cells
+        FPA.NAME        STR     CONTROLR   # A PHU keyword for unique identifier within the hierarchy level
+        CONTENT         STR     DETECTOR   # How to determine content of FITS file
+        CONTENT.RULE    STR     {CHIP.ID}  # How to derive the CONTENT when writing
 END
 
 # What's in the FITS file?
-CONTENTS	METADATA
-	# CONTENT      =    chip name : type
+CONTENTS        METADATA
+        # CONTENT      =    chip name : type
         CCID58-2-15a1  STR  XY01:GPCChip
         CCID58-2-18a1  STR  XY02:GPCChip
@@ -86,86 +86,86 @@
 
 CHIPS   METADATA
-	GPCChip		METADATA
-		# Extension name, cellName:cellType
-		xy00   STR  xy00:GPCCell
-		xy10   STR  xy10:GPCCell
-		xy20   STR  xy20:GPCCell
-		xy30   STR  xy30:GPCCell
-		xy40   STR  xy40:GPCCell
-		xy50   STR  xy50:GPCCell
-		xy60   STR  xy60:GPCCell
-		xy70   STR  xy70:GPCCell
-		xy01   STR  xy01:GPCCell
-		xy11   STR  xy11:GPCCell
-		xy21   STR  xy21:GPCCell
-		xy31   STR  xy31:GPCCell
-		xy41   STR  xy41:GPCCell
-		xy51   STR  xy51:GPCCell
-		xy61   STR  xy61:GPCCell
-		xy71   STR  xy71:GPCCell
-		xy02   STR  xy02:GPCCell
-		xy12   STR  xy12:GPCCell
-		xy22   STR  xy22:GPCCell
-		xy32   STR  xy32:GPCCell
-		xy42   STR  xy42:GPCCell
-		xy52   STR  xy52:GPCCell
-		xy62   STR  xy62:GPCCell
-		xy72   STR  xy72:GPCCell
-		xy03   STR  xy03:GPCCell
-		xy13   STR  xy13:GPCCell
-		xy23   STR  xy23:GPCCell
-		xy33   STR  xy33:GPCCell
-		xy43   STR  xy43:GPCCell
-		xy53   STR  xy53:GPCCell
-		xy63   STR  xy63:GPCCell
-		xy73   STR  xy73:GPCCell
-		xy04   STR  xy04:GPCCell
-		xy14   STR  xy14:GPCCell
-		xy24   STR  xy24:GPCCell
-		xy34   STR  xy34:GPCCell
-		xy44   STR  xy44:GPCCell
-		xy54   STR  xy54:GPCCell
-		xy64   STR  xy64:GPCCell
-		xy74   STR  xy74:GPCCell
-		xy05   STR  xy05:GPCCell
-		xy15   STR  xy15:GPCCell
-		xy25   STR  xy25:GPCCell
-		xy35   STR  xy35:GPCCell
-		xy45   STR  xy45:GPCCell
-		xy55   STR  xy55:GPCCell
-		xy65   STR  xy65:GPCCell
-		xy75   STR  xy75:GPCCell
-		xy06   STR  xy06:GPCCell
-		xy16   STR  xy16:GPCCell
-		xy26   STR  xy26:GPCCell
-		xy36   STR  xy36:GPCCell
-		xy46   STR  xy46:GPCCell
-		xy56   STR  xy56:GPCCell
-		xy66   STR  xy66:GPCCell
-		xy76   STR  xy76:GPCCell
-		xy07   STR  xy07:GPCCell
-		xy17   STR  xy17:GPCCell
-		xy27   STR  xy27:GPCCell
-		xy37   STR  xy37:GPCCell
-		xy47   STR  xy47:GPCCell
-		xy57   STR  xy57:GPCCell
-		xy67   STR  xy67:GPCCell
-		xy77   STR  xy77:GPCCell
-	END
+        GPCChip         METADATA
+                # Extension name, cellName:cellType
+                xy00   STR  xy00:GPCCell
+                xy10   STR  xy10:GPCCell
+                xy20   STR  xy20:GPCCell
+                xy30   STR  xy30:GPCCell
+                xy40   STR  xy40:GPCCell
+                xy50   STR  xy50:GPCCell
+                xy60   STR  xy60:GPCCell
+                xy70   STR  xy70:GPCCell
+                xy01   STR  xy01:GPCCell
+                xy11   STR  xy11:GPCCell
+                xy21   STR  xy21:GPCCell
+                xy31   STR  xy31:GPCCell
+                xy41   STR  xy41:GPCCell
+                xy51   STR  xy51:GPCCell
+                xy61   STR  xy61:GPCCell
+                xy71   STR  xy71:GPCCell
+                xy02   STR  xy02:GPCCell
+                xy12   STR  xy12:GPCCell
+                xy22   STR  xy22:GPCCell
+                xy32   STR  xy32:GPCCell
+                xy42   STR  xy42:GPCCell
+                xy52   STR  xy52:GPCCell
+                xy62   STR  xy62:GPCCell
+                xy72   STR  xy72:GPCCell
+                xy03   STR  xy03:GPCCell
+                xy13   STR  xy13:GPCCell
+                xy23   STR  xy23:GPCCell
+                xy33   STR  xy33:GPCCell
+                xy43   STR  xy43:GPCCell
+                xy53   STR  xy53:GPCCell
+                xy63   STR  xy63:GPCCell
+                xy73   STR  xy73:GPCCell
+                xy04   STR  xy04:GPCCell
+                xy14   STR  xy14:GPCCell
+                xy24   STR  xy24:GPCCell
+                xy34   STR  xy34:GPCCell
+                xy44   STR  xy44:GPCCell
+                xy54   STR  xy54:GPCCell
+                xy64   STR  xy64:GPCCell
+                xy74   STR  xy74:GPCCell
+                xy05   STR  xy05:GPCCell
+                xy15   STR  xy15:GPCCell
+                xy25   STR  xy25:GPCCell
+                xy35   STR  xy35:GPCCell
+                xy45   STR  xy45:GPCCell
+                xy55   STR  xy55:GPCCell
+                xy65   STR  xy65:GPCCell
+                xy75   STR  xy75:GPCCell
+                xy06   STR  xy06:GPCCell
+                xy16   STR  xy16:GPCCell
+                xy26   STR  xy26:GPCCell
+                xy36   STR  xy36:GPCCell
+                xy46   STR  xy46:GPCCell
+                xy56   STR  xy56:GPCCell
+                xy66   STR  xy66:GPCCell
+                xy76   STR  xy76:GPCCell
+                xy07   STR  xy07:GPCCell
+                xy17   STR  xy17:GPCCell
+                xy27   STR  xy27:GPCCell
+                xy37   STR  xy37:GPCCell
+                xy47   STR  xy47:GPCCell
+                xy57   STR  xy57:GPCCell
+                xy67   STR  xy67:GPCCell
+                xy77   STR  xy77:GPCCell
+        END
 END
 
 # Specify the cell data
-CELLS	METADATA
-	GPCCell		METADATA
-		CELL.TRIMSEC.SOURCE	STR	HEADER
-		CELL.TRIMSEC		STR	DATASEC
-		CELL.BIASSEC.SOURCE	STR	HEADER
-		CELL.BIASSEC		STR	BIASSEC
-	END
+CELLS   METADATA
+        GPCCell         METADATA
+                CELL.TRIMSEC.SOURCE     STR     HEADER
+                CELL.TRIMSEC            STR     DATASEC
+                CELL.BIASSEC.SOURCE     STR     HEADER
+                CELL.BIASSEC            STR     BIASSEC
+        END
 END
 
 
 # How to translate PS concepts into FITS headers
-TRANSLATION	METADATA
+TRANSLATION     METADATA
         FPA.FILTERID    STR     FILTERID
         FPA.FILTER      STR     FILTERID
@@ -173,53 +173,63 @@
         FPA.DEC         STR     DEC
         FPA.RADECSYS    STR     RADECSYS
-	FPA.OBSTYPE     STR     OBSTYPE
-	FPA.OBJECT	STR	OBJECT
-	FPA.AIRMASS	STR	AIRMASS
-	FPA.POSANGLE	STR	POSANGLE
-	FPA.FOCUS	STR	M2Z
-	FPA.TIME	STR	MJD-OBS
-	FPA.ALT		STR	ALT
-	FPA.AZ		STR	AZ
-	FPA.TEMP	STR	DETTEM
-	FPA.M1X         STR     M1X
-	FPA.M1Y         STR     M1Y   
-	FPA.M1Z         STR     M1Z   
-	FPA.M1TIP       STR     M1TIP 
-	FPA.M1TILT      STR     M1TILT
-	FPA.M2X         STR     M2X
-	FPA.M2Y         STR     M2Y   
-	FPA.M2Z         STR     M2Z   
-	FPA.M2TIP       STR     M2TIP 
-	FPA.M2TILT      STR     M2TILT
-	FPA.ENV.TEMP    STR     ENVTEM
-	FPA.ENV.HUMID   STR     ENVHUM
-	FPA.ENV.WIND    STR     ENVWIN
-	FPA.ENV.DIR     STR     ENVDIR
-	FPA.PON.TIME    STR     PONTIME
-	CHIP.ID         STR	DETECTOR
-	CELL.XBIN	STR	CCDSUM
-	CELL.YBIN	STR	CCDSUM
-	CELL.X0		STR	IMNPIX1
-	CELL.Y0		STR	IMNPIX2
- 	CELL.XPARITY	STR	LTM1_1
-	CELL.YPARITY	STR	LTM2_2
-#	CELL.SATURATION	STR	SATURATE
-	CHIP.TEMP	STR	DETTEM
-	FPA.EXPOSURE	STR	EXPREQ		# Requested exposure time, presumably camera exposure time
-	CELL.EXPOSURE	STR	EXPTIME		# Exposure time measured by shutter
-	CELL.DARKTIME	STR	DARKTIME	# Exposure time for camera
+        FPA.OBSTYPE     STR     OBSTYPE
+        FPA.OBJECT      STR     OBJECT
+        FPA.COMMENT     STR     CMMTOBS
+        FPA.AIRMASS     STR     AIRMASS
+        FPA.POSANGLE    STR     POSANGLE
+        FPA.FOCUS       STR     M2Z
+        FPA.TIME        STR     MJD-OBS
+        FPA.ALT         STR     ALT
+        FPA.AZ          STR     AZ
+        FPA.TEMP        STR     DETTEM
+        FPA.M1X         STR     M1X
+        FPA.M1Y         STR     M1Y   
+        FPA.M1Z         STR     M1Z   
+        FPA.M1TIP       STR     M1TIP 
+        FPA.M1TILT      STR     M1TILT
+        FPA.M2X         STR     M2X
+        FPA.M2Y         STR     M2Y   
+        FPA.M2Z         STR     M2Z   
+        FPA.M2TIP       STR     M2TIP 
+        FPA.M2TILT      STR     M2TILT
+        FPA.ENV.TEMP    STR     ENVTEM
+        FPA.ENV.HUMID   STR     ENVHUM
+        FPA.ENV.WIND    STR     ENVWIN
+        FPA.ENV.DIR     STR     ENVDIR
+
+        FPA.TELTEMP.M1     STR  TELTEMM1 # Primary mirror temps (C) 
+        FPA.TELTEMP.M1CELL STR  TELTEMMS # Primary mirror support temps (C)   
+        FPA.TELTEMP.M2     STR  TELTEMM2 # Secondary mirror temps (C
+        FPA.TELTEMP.SPIDER STR  TELTEMSP # Spider temperatures (C)  
+        FPA.TELTEMP.TRUSS  STR  TELTEMTR # Mid truss temperatures (C
+        FPA.TELTEMP.EXTRA  STR  TELTEMEX # Miscellaneous temperatures (C)     
+
+        FPA.PON.TIME    STR     PONTIME
+
+        CHIP.ID         STR     DETECTOR
+        CELL.XBIN       STR     CCDSUM
+        CELL.YBIN       STR     CCDSUM
+        CELL.X0         STR     IMNPIX1
+        CELL.Y0         STR     IMNPIX2
+        CELL.XPARITY    STR     LTM1_1
+        CELL.YPARITY    STR     LTM2_2
+#       CELL.SATURATION STR     SATURATE
+        CHIP.TEMP       STR     DETTEM
+        FPA.EXPOSURE    STR     EXPREQ          # Requested exposure time, presumably camera exposure time
+        CELL.EXPOSURE   STR     EXPTIME         # Exposure time measured by shutter
+        CELL.DARKTIME   STR     DARKTIME        # Exposure time for camera
 END
 
 # Default PS concepts that may be specified by value
-DEFAULTS	METADATA
-	FPA.TELESCOPE	STR	PS1
-	FPA.INSTRUMENT	STR	GPC1
-	FPA.DETECTOR	STR	GPC1
-	FPA.NAME	S32	12345
-	FPA.TIMESYS	STR	UTC
-	CHIP.XPARITY	S32	1
-	CHIP.YPARITY	S32	1
-	CHIP.X0.DEPEND		STR	CHIP.NAME
-	CHIP.X0		METADATA
+DEFAULTS        METADATA
+        FPA.TELESCOPE   STR     PS1
+        FPA.INSTRUMENT  STR     GPC1
+        FPA.DETECTOR    STR     GPC1
+        FPA.NAME        S32     12345
+        FPA.TIMESYS     STR     UTC
+        CHIP.XPARITY    S32     1
+        CHIP.YPARITY    S32     1
+        CHIP.X0.DEPEND          STR     CHIP.NAME
+        CHIP.X0         METADATA
           XY01  S32     4971
           XY02  S32     4971
@@ -282,7 +292,7 @@
           XY75  S32     34954
           XY76  S32     34954
-	END
-	CHIP.Y0.DEPEND		STR	CHIP.NAME
-	CHIP.Y0		METADATA
+        END
+        CHIP.Y0.DEPEND          STR     CHIP.NAME
+        CHIP.Y0         METADATA
           XY01  S32     10286
           XY02  S32     15429
@@ -346,6 +356,6 @@
           XY76  S32     31164
         END
-	CHIP.XPARITY.DEPEND	STR	CHIP.NAME
-	CHIP.XPARITY	METADATA
+        CHIP.XPARITY.DEPEND     STR     CHIP.NAME
+        CHIP.XPARITY    METADATA
           XY01  S32     -1
           XY02  S32     -1
@@ -408,7 +418,7 @@
           XY75  S32     1
           XY76  S32     1
-	END
-	CHIP.YPARITY.DEPEND	STR	CHIP.NAME
-	CHIP.YPARITY	METADATA
+        END
+        CHIP.YPARITY.DEPEND     STR     CHIP.NAME
+        CHIP.YPARITY    METADATA
           XY01  S32     -1
           XY02  S32     -1
@@ -471,19 +481,19 @@
           XY75  S32     1
           XY76  S32     1
-	END
-	CELL.GAIN	F32	1.0
-	CELL.READNOISE	F32	0.0
-	CELL.READDIR	S32	1
-	CELL.BAD	S32	0
-#	CELL.TIME	STR	MJD-OBS
-#	CELL.TIMESYS	STR	TIMESYS
-	CELL.SATURATION	STR	40000
+        END
+        CELL.GAIN       F32     1.0
+        CELL.READNOISE  F32     0.0
+        CELL.READDIR    S32     1
+        CELL.BAD        S32     0
+#       CELL.TIME       STR     MJD-OBS
+#       CELL.TIMESYS    STR     TIMESYS
+        CELL.SATURATION STR     40000
 END
 
 # How to translation PS concepts into database lookups
-DATABASE	METADATA
-	TYPE		dbEntry		TABLE		COLUMN		GIVENDBCOL	GIVENPS
-#	CELL.GAIN	dbEntry		Camera		gain		chipId,cellId	CHIP,CELL
-#	CELL.READNOISE	dbEntry		Camera		readNoise	chipId,cellId	CHIP,CELL
+DATABASE        METADATA
+        TYPE            dbEntry         TABLE           COLUMN          GIVENDBCOL      GIVENPS
+#       CELL.GAIN       dbEntry         Camera          gain            chipId,cellId   CHIP,CELL
+#       CELL.READNOISE  dbEntry         Camera          readNoise       chipId,cellId   CHIP,CELL
 
 # A database entry refers to a particular column (COLUMN) in a
@@ -495,23 +505,23 @@
 
 # Where there might be some ambiguity, specify the format
-FORMATS		METADATA
-	FPA.RA		STR	DEGREES
-	FPA.DEC		STR	DEGREES
-	FPA.TIME	STR	MJD
-	CELL.TIME	STR	MJD
-	CELL.BINNING	STR	TOGETHER
-	CELL.X0		STR	FORTRAN
-	CELL.Y0		STR	FORTRAN
+FORMATS         METADATA
+        FPA.RA          STR     DEGREES
+        FPA.DEC         STR     DEGREES
+        FPA.TIME        STR     MJD
+        CELL.TIME       STR     MJD
+        CELL.BINNING    STR     TOGETHER
+        CELL.X0         STR     FORTRAN
+        CELL.Y0         STR     FORTRAN
 END
  
 # Recipe options
-RECIPES		METADATA
+RECIPES         METADATA
 END
  
 # How to get the supplementary stuff: mask and weight
-SUPPLEMENTARY	METADATA
-	MASK.SOURCE	STR	FILE		# Source type for mask: EXT | FILE
-	MASK.NAME	STR	%a_mask.fits	# Name for mask extension or filename
-	WEIGHT.SOURCE	STR	FILE		# Source type for weight: EXT | FILE
-	WEIGHT.NAME	STR	%a_weight.fits	# Name for weight extension or filename
-END
+SUPPLEMENTARY   METADATA
+        MASK.SOURCE     STR     FILE            # Source type for mask: EXT | FILE
+        MASK.NAME       STR     %a_mask.fits    # Name for mask extension or filename
+        WEIGHT.SOURCE   STR     FILE            # Source type for weight: EXT | FILE
+        WEIGHT.NAME     STR     %a_weight.fits  # Name for weight extension or filename
+END
