Index: trunk/ippTools/src/regtoolConfig.c
===================================================================
--- trunk/ippTools/src/regtoolConfig.c	(revision 18561)
+++ trunk/ippTools/src/regtoolConfig.c	(revision 19686)
@@ -62,4 +62,7 @@
     ADD_OPT(Str,  addprocessedimfileArgs, "-class_id",       "define class ID (required)",         NULL);
     ADD_OPT(Str,  addprocessedimfileArgs, "-uri",            "define URI (required)",             NULL);
+
+    ADD_OPT(F32,  addprocessedimfileArgs, "-longitude",      "specify the observatory longitude (NOTE: not saved in db)", NAN);
+    ADD_OPT(F32,  addprocessedimfileArgs, "-latitude",       "specify the observatory latitude (NOTE: not saved in db)", NAN);
 
     ADD_OPT(Str,  addprocessedimfileArgs, "-exp_type",       "define exposure type",             NULL);
@@ -108,4 +111,9 @@
     ADD_OPT(F64,  addprocessedimfileArgs, "-user_5",         "define user statistic (5)",         NAN);
     ADD_OPT(Str,  addprocessedimfileArgs, "-object",         "define exposure object",             NULL);
+    ADD_OPT(F32,  addprocessedimfileArgs, "-sun_angle",      "define angle to sun",             NAN);
+    ADD_OPT(F32,  addprocessedimfileArgs, "-sun_alt",        "define sun altitude (neg = below horizon)", NAN);
+    ADD_OPT(F32,  addprocessedimfileArgs, "-moon_angle",     "define angle to moon",             NAN);
+    ADD_OPT(F32,  addprocessedimfileArgs, "-moon_alt",       "define moon altitude (neg = below horizon)", NAN);
+    ADD_OPT(F32,  addprocessedimfileArgs, "-moon_phase",     "define moon phase (0.0 = new)",   NAN);
     ADD_OPT(Time, addprocessedimfileArgs, "-dateobs",        "define observation time",         NULL);
     ADD_OPT(Str,  addprocessedimfileArgs, "-hostname",       "define host name",                NULL);
@@ -114,10 +122,10 @@
     // -processedimfile
     psMetadata *processedimfileArgs = psMetadataAlloc();
-   ADD_OPT(S64,  processedimfileArgs, "-exp_id",    "search by exposure ID",                 0);
-   ADD_OPT(Str,  processedimfileArgs, "-exp_name",  "search by exposure name",               NULL);
-   ADD_OPT(Str,  processedimfileArgs, "-class_id",  "search by class ID",                    NULL);
-   ADD_OPT(U64,  processedimfileArgs, "-limit",     "limit result set to N items",           0);
-   ADD_OPT(Bool, processedimfileArgs, "-faulted",   "only return imfiles with a fault status set", false);
-   ADD_OPT(Bool, processedimfileArgs, "-simple",    "use the simple output format",          false);
+    ADD_OPT(S64,  processedimfileArgs, "-exp_id",    "search by exposure ID",                 0);
+    ADD_OPT(Str,  processedimfileArgs, "-exp_name",  "search by exposure name",               NULL);
+    ADD_OPT(Str,  processedimfileArgs, "-class_id",  "search by class ID",                    NULL);
+    ADD_OPT(U64,  processedimfileArgs, "-limit",     "limit result set to N items",           0);
+    ADD_OPT(Bool, processedimfileArgs, "-faulted",   "only return imfiles with a fault status set", false);
+    ADD_OPT(Bool, processedimfileArgs, "-simple",    "use the simple output format",          false);
 
     // -revertprocessedimfile
@@ -148,55 +156,63 @@
     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-filelevel",        0,        "define the data partitioning level of this file (required)", NULL);
 
-    psMetadataAddTime(addprocessedexpArgs, PS_LIST_TAIL, "-dateobs",         0,        "define observation time", NULL);
-    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_type",         0,        "define exposure type", NULL);
-    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-workdir",          0,        "define the \"default\" workdir for this exposure", NULL);
-    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-dvodb",            0,        "define the dvodb for the next processing step", NULL);
-    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-tess_id",          0,        "define the tess_id for the next processing step", NULL);
-    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-end_stage",        0,        "define the end goal processing step", NULL);
-    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-reduction",        0,        "define the \"default\" reduction class for this exposure", NULL);
-    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);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-ra",               0,        "define RA", NAN);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-decl",             0,        "define DEC", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-exp_time",         0,        "define exposure time", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-sat_pixel_frac",   0,        "define fraction of saturated pixels", NAN);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-bg",               0,        "define exposue background", NAN);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-bg_stdev",         0,        "define exposue background stdev", NAN);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-bg_mean_stdev",    0,        "define exposue background mean stdev", NAN);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-alt",              0,        "define altitute", NAN);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-az",               0,        "define azimuth", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-ccd_temp",         0,        "define ccd tempature", NAN);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-posang",           0,        "define rotator position angle", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m1_x",             0,        "define M1 X position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m1_y",             0,        "define M1 Y position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m1_z",             0,        "define M1 Z position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m1_tip",           0,        "define M1 TIP position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m1_tilt",          0,        "define M1 TILT position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m2_x",             0,        "define M2 X position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m2_y",             0,        "define M2 Y position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m2_z",             0,        "define M2 Z position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m2_tip",           0,        "define M2 TIP position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-m2_tilt",          0,        "define M2 TILT position", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-env_temperature",  0,        "define Environmental Temperature", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-env_humidity",     0,        "define Environmental Humidity", NAN);
-    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-env_wind_speed",   0,        "define Environmental Wind Speed", NAN);
-    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);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-user_1",           0,        "define user statistic (1)", NAN);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-user_2",           0,        "define user statistic (2)", NAN);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-user_3",           0,        "define user statistic (3)", NAN);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-user_4",           0,        "define user statistic (4)", NAN);
-    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-user_5",           0,        "define user statistic (5)", NAN);
-    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-object",           0,        "define exposure object", NULL);
-    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-label",            0,        "define label for chip stage (non-detrend data only)", NULL);
-    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-hostname",         0,        "define host name", NULL);
-    psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-code",             0,        "set fault code", 0);
+    ADD_OPT(F32,  addprocessedexpArgs, "-longitude", 	    "specify the observatory longitude (NOTE: not saved in db)", 0.0);
+    ADD_OPT(F32,  addprocessedexpArgs, "-latitude",  	    "specify the observatory latitude (NOTE: not saved in db)", 0.0);
+
+    ADD_OPT(Time, addprocessedexpArgs, "-dateobs",          "define observation time", NULL);
+    ADD_OPT(Str,  addprocessedexpArgs, "-exp_type",         "define exposure type", NULL);
+    ADD_OPT(Str,  addprocessedexpArgs, "-workdir",          "define the \"default\" workdir for this exposure", NULL);
+    ADD_OPT(Str,  addprocessedexpArgs, "-dvodb",            "define the dvodb for the next processing step", NULL);
+    ADD_OPT(Str,  addprocessedexpArgs, "-tess_id",          "define the tess_id for the next processing step", NULL);
+    ADD_OPT(Str,  addprocessedexpArgs, "-end_stage",        "define the end goal processing step", NULL);
+    ADD_OPT(Str,  addprocessedexpArgs, "-reduction",        "define the \"default\" reduction class for this exposure", NULL);
+    ADD_OPT(Str,  addprocessedexpArgs, "-filter",           "define filter ", NULL);
+    ADD_OPT(Str,  addprocessedexpArgs, "-comment",          "define comment ", NULL);
+    ADD_OPT(F32,  addprocessedexpArgs, "-airmass",          "define airmass", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-ra",               "define RA", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-decl",             "define DEC", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-exp_time",         "define exposure time", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-sat_pixel_frac",   "define fraction of saturated pixels", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-bg",               "define exposue background", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-bg_stdev",         "define exposue background stdev", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-bg_mean_stdev",    "define exposue background mean stdev", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-alt",              "define altitute", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-az",               "define azimuth", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-ccd_temp",         "define ccd tempature", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-posang",           "define rotator position angle", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-m1_x",             "define M1 X position", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-m1_y",             "define M1 Y position", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-m1_z",             "define M1 Z position", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-m1_tip",           "define M1 TIP position", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-m1_tilt",          "define M1 TILT position", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-m2_x",             "define M2 X position", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-m2_y",             "define M2 Y position", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-m2_z",             "define M2 Z position", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-m2_tip",           "define M2 TIP position", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-m2_tilt",          "define M2 TILT position", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-env_temperature",  "define Environmental Temperature", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-env_humidity",     "define Environmental Humidity", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-env_wind_speed",   "define Environmental Wind Speed", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-env_wind_dir",     "define Environmental Wind Direction", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-teltemp_m1",       "define Telescope Temperature : M1", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-teltemp_m1cell",   "define Telescope Temperature : M1 Cell", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-teltemp_m2",       "define Telescope Temperature : M2", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-teltemp_spider",   "define Telescope Temperature : Spider", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-teltemp_truss",    "define Telescope Temperature : Truss", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-teltemp_extra",    "define Telescope Temperature : Extra", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-pon_time",         "define time to last Power On", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-user_1",           "define user statistic (1)", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-user_2",           "define user statistic (2)", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-user_3",           "define user statistic (3)", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-user_4",           "define user statistic (4)", NAN);
+    ADD_OPT(F64,  addprocessedexpArgs, "-user_5",           "define user statistic (5)", NAN);
+    ADD_OPT(Str,  addprocessedexpArgs, "-object",           "define exposure object", NULL);
+    ADD_OPT(F32,  addprocessedexpArgs, "-sun_angle",        "define angle to sun",             NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-sun_alt",          "define sun altitude (neg = below horizon)", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-moon_angle",       "define angle to moon",             NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-moon_alt",         "define moon altitude (neg = below horizon)", NAN);
+    ADD_OPT(F32,  addprocessedexpArgs, "-moon_phase",       "define moon phase (0.0 = new)",   NAN);
+    ADD_OPT(Str,  addprocessedexpArgs, "-label",            "define label for chip stage (non-detrend data only)", NULL);
+    ADD_OPT(Str,  addprocessedexpArgs, "-hostname",         "define host name", NULL);
+    ADD_OPT(S16,  addprocessedexpArgs, "-code",             "set fault code", 0);
 
     // -processedexp
