IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 15, 2008, 10:30:59 AM (18 years ago)
Author:
eugene
Message:

completely deprecate config->where; make all command-line handling consistent; move nearly all sql into share/*.sql; ensure consistency between args supplied and used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/camtoolConfig.c

    r18453 r18561  
    4747
    4848    // -definebyquery
     49    // XXX need to allow multiple chip_ids
     50    // XXX need to allow multiple exp_ids
    4951    psMetadata *definebydefinebyqueryArgs = psMetadataAlloc();
     52    psMetadataAddS64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-chip_id",            0, "search by chip_id", 0);
     53    psMetadataAddS64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-exp_id",             0, "search by exp_id", 0);
     54    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-exp_name",           0, "search by exp_name", NULL);
     55    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-inst",               0, "search for camera", NULL);
     56    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-telescope",          0, "search for telescope", NULL);
     57    psMetadataAddTime(definebydefinebyqueryArgs, PS_LIST_TAIL, "-dateobs_begin",     0, "search for exposures by time (>=)", NULL);
     58    psMetadataAddTime(definebydefinebyqueryArgs, PS_LIST_TAIL, "-dateobs_end",       0, "search for exposures by time (<)", NULL);
     59    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-exp_tag",            0, "search by exp_tag", NULL);
     60    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-exp_type",           0, "search by exp_type", NULL);
     61    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-filelevel",          0, "search by filelevel", NULL);
     62    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-reduction",          0, "search by reduction class", NULL);
     63    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-filter",             0, "search for filter", NULL);
     64    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-airmass_min",        0, "define min airmass", NAN);
     65    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-airmass_max",        0, "define max airmass", NAN);
     66    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-ra_min",             0, "define min", NAN);
     67    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-ra_max",             0, "define max", NAN);
     68    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-decl_min",           0, "define min", NAN);
     69    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-decl_max",           0, "define max", NAN);
     70    psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-exp_time_min",       0, "define min", NAN);
     71    psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-exp_time_max",       0, "define max", NAN);
     72    psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-sat_pixel_frac_min", 0, "define max fraction of saturated pixels", NAN);
     73    psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-sat_pixel_frac_max", 0, "define min fraction of saturated pixels", NAN);
     74    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-bg_min",             0, "define max", NAN);
     75    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-bg_max",             0, "define max", NAN);
     76    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-bg_stdev_min",       0, "define max", NAN);
     77    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-bg_stdev_max",       0, "define max", NAN);
     78    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-bg_mean_stdev_min",  0, "define max", NAN);
     79    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-bg_mean_stdev_max",  0, "define max", NAN);
     80    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-alt_min",            0, "define min", NAN);
     81    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-alt_max",            0, "define max", NAN);
     82    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-az_min",             0, "define min", NAN);
     83    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-az_max",             0, "define max", NAN);
     84    psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-ccd_temp_min",       0, "define min ccd tempature", NAN);
     85    psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-ccd_temp_max",       0, "define max ccd tempature", NAN);
     86    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-posang_min",         0, "define min rotator position angle", NAN);
     87    psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-posang_max",         0, "define max rotator position angle", NAN);
     88    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-object",             0, "search by exposure object", NULL);
     89    psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-solang_min",         0, "define min solar angle", NAN);
     90    psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-solang_max",         0, "define max solar angle", NAN);
     91
     92    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_workdir",        0, "define workdir", NULL);
     93    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_label",          0, "define label", NULL);
     94    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_reduction",      0, "define reduction class", NULL);
     95    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_expgroup",       0, "define exposure group", NULL);
     96    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_dvodb",          0, "define DVO db", NULL);
     97    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_tess_id",        0, "define tess ID", NULL);
     98    psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_end_stage",      0, "define end stage", NULL);
     99    psMetadataAddBool(definebydefinebyqueryArgs, PS_LIST_TAIL, "-all",               0, "allow everything to be queued without search terms", false);
     100
     101    // -updaterun
     102    // XXX need to allow multiple cam_ids
    50103    // XXX need to allow multiple chip_ids
    51     psMetadataAddS64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-chip_id",  0,
    52             "search by chip_id", 0);
    53104    // XXX need to allow multiple exp_ids
    54     psMetadataAddS64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-exp_id",  0,
    55             "search by exp_id", 0);
    56     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-exp_name",  0,
    57             "search by exp_name", NULL);
    58     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-inst",  0,
    59             "search for camera", NULL);
    60     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-telescope",  0,
    61             "search for telescope", NULL);
    62     psMetadataAddTime(definebydefinebyqueryArgs, PS_LIST_TAIL, "-dateobs_begin", 0,
    63             "search for exposures by time (>=)", NULL);
    64     psMetadataAddTime(definebydefinebyqueryArgs, PS_LIST_TAIL, "-dateobs_end", 0,
    65             "search for exposures by time (<)", NULL);
    66     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-exp_tag",  0,
    67             "search by exp_tag", NULL);
    68     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-exp_type",  0,
    69             "search by exp_type", NULL);
    70     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-filelevel",  0,
    71             "search by filelevel", NULL);
    72     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-reduction",  0,
    73             "search by reduction class", NULL);
    74     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-filter",  0,
    75             "search for filter", NULL);
    76     psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-airmass_min",  0,
    77             "define min airmass", NAN);
    78     psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-airmass_max",  0,
    79             "define max airmass", NAN);
    80     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-ra_min",  0,
    81             "define min", NAN);
    82     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-ra_max",  0,
    83             "define max", NAN);
    84     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-decl_min",  0,
    85             "define min", NAN);
    86     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-decl_max",  0,
    87             "define max", NAN);
    88     psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-exp_time_min",  0,
    89             "define min", NAN);
    90     psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-exp_time_max",  0,
    91             "define max", NAN);
    92     psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-sat_pixel_frac_min",  0,
    93             "define max fraction of saturated pixels", NAN);
    94     psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-sat_pixel_frac_max",  0,
    95             "define min fraction of saturated pixels", NAN);
    96     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-bg_min",  0,
    97             "define max", NAN);
    98     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-bg_max",  0,
    99             "define max", NAN);
    100     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-bg_stdev_min",  0,
    101             "define max", NAN);
    102     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-bg_stdev_max",  0,
    103             "define max", NAN);
    104     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-bg_mean_stdev_min",  0,
    105             "define max", NAN);
    106     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-bg_mean_stdev_max",  0,
    107             "define max", NAN);
    108     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-alt_min",  0,
    109             "define min", NAN);
    110     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-alt_max",  0,
    111             "define max", NAN);
    112     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-az_min",  0,
    113             "define min", NAN);
    114     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-az_max",  0,
    115             "define max", NAN);
    116     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-ccd_temp_min",  0,
    117             "define min ccd tempature", NAN);
    118     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-ccd_temp_max",  0,
    119             "define max ccd tempature", NAN);
    120     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-posang_min",  0,
    121             "define min rotator position angle", NAN);
    122     psMetadataAddF64(definebydefinebyqueryArgs, PS_LIST_TAIL, "-posang_max",  0,
    123             "define max rotator position angle", NAN);
    124     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-object",  0,
    125             "search by exposure object", NULL);
    126     psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-solang_min",  0,
    127             "define min solar angle", NAN);
    128     psMetadataAddF32(definebydefinebyqueryArgs, PS_LIST_TAIL, "-solang_max",  0,
    129             "define max solar angle", NAN);
    130     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_workdir",  0,
    131             "define workdir", NULL);
    132     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_label",  0,
    133             "define label", NULL);
    134     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_reduction",  0,
    135             "define reduction class", NULL);
    136     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_expgroup",  0,
    137             "define exposure group", NULL);
    138     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_dvodb",  0,
    139             "define DVO db", NULL);
    140     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_tess_id",  0,
    141             "define tess ID", NULL);
    142     psMetadataAddStr(definebydefinebyqueryArgs, PS_LIST_TAIL, "-set_end_stage",  0,
    143             "define end stage", NULL);
    144     psMetadataAddBool(definebydefinebyqueryArgs, PS_LIST_TAIL, "-all",  0,
    145             "allow everything to be queued without search terms", false);
    146 
    147     // -updaterun
    148105    psMetadata *updaterunArgs = psMetadataAlloc();
    149     // XXX need to allow multiple cam_ids
    150     psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-cam_id",  0,
    151             "search by cam_id", 0);
    152     // XXX need to allow multiple chip_ids
    153     psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-chip_id",  0,
    154             "search by chip_id", 0);
    155     // XXX need to allow multiple exp_ids
    156     psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-exp_id",  0,
    157             "search by exp_id", 0);
    158     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-exp_name",  0,
    159             "search by exp_name", NULL);
    160     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-inst",  0,
    161             "search for camera", NULL);
    162     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-telescope",  0,
    163             "search for telescope", NULL);
    164     psMetadataAddTime(updaterunArgs, PS_LIST_TAIL, "-dateobs_begin", 0,
    165             "search for exposures by time (>=)", NULL);
    166     psMetadataAddTime(updaterunArgs, PS_LIST_TAIL, "-dateobs_end", 0,
    167             "search for exposures by time (<)", NULL);
    168     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-exp_tag",  0,
    169             "search by exp_tag", NULL);
    170     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-exp_type",  0,
    171             "search by exp_type", NULL);
    172     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-filelevel",  0,
    173             "search by filelevel", NULL);
    174     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-reduction",  0,
    175             "search by reduction class", NULL);
    176     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-filter",  0,
    177             "search for filter", NULL);
    178     psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-airmass_min",  0,
    179             "define min airmass", NAN);
    180     psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-airmass_max",  0,
    181             "define max airmass", NAN);
    182     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-ra_min",  0,
    183             "define min", NAN);
    184     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-ra_max",  0,
    185             "define max", NAN);
    186     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-decl_min",  0,
    187             "define min", NAN);
    188     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-decl_max",  0,
    189             "define max", NAN);
    190     psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-exp_time_min",  0,
    191             "define min", NAN);
    192     psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-exp_time_max",  0,
    193             "define max", NAN);
    194     psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-sat_pixel_frac_min",  0,
    195             "define max fraction of saturated pixels", NAN);
    196     psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-sat_pixel_frac_max",  0,
    197             "define min fraction of saturated pixels", NAN);
    198     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-bg_min",  0,
    199             "define max", NAN);
    200     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-bg_max",  0,
    201             "define max", NAN);
    202     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-bg_stdev_min",  0,
    203             "define max", NAN);
    204     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-bg_stdev_max",  0,
    205             "define max", NAN);
    206     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-bg_mean_stdev_min",  0,
    207             "define max", NAN);
    208     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-bg_mean_stdev_max",  0,
    209             "define max", NAN);
    210     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-alt_min",  0,
    211             "define min", NAN);
    212     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-alt_max",  0,
    213             "define max", NAN);
    214     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-az_min",  0,
    215             "define min", NAN);
    216     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-az_max",  0,
    217             "define max", NAN);
    218     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-ccd_temp_min",  0,
    219             "define min ccd tempature", NAN);
    220     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-ccd_temp_max",  0,
    221             "define max ccd tempature", NAN);
    222     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-posang_min",  0,
    223             "define min rotator position angle", NAN);
    224     psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-posang_max",  0,
    225             "define max rotator position angle", NAN);
    226     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-object",  0,
    227             "search by exposure object", NULL);
    228     psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-solang_min",  0,
    229             "define min solar angle", NAN);
    230     psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-solang_max",  0,
    231             "define max solar angle", NAN);
    232 
    233     psMetadataAddBool(updaterunArgs, PS_LIST_TAIL, "-all",  0,
    234             "allow everything to be queued without search terms", false);
    235     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-state", 0,
    236             "set state", NULL);
    237     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-label", 0,
    238             "set label", NULL);
    239 
     106    psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-cam_id",             0, "search by cam_id", 0);
     107    psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-chip_id",            0, "search by chip_id", 0);
     108    psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-exp_id",             0, "search by exp_id", 0);
     109    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-exp_name",           0, "search by exp_name", NULL);
     110    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-inst",               0, "search for camera", NULL);
     111    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-telescope",          0, "search for telescope", NULL);
     112    psMetadataAddTime(updaterunArgs, PS_LIST_TAIL, "-dateobs_begin",     0, "search for exposures by time (>=)", NULL);
     113    psMetadataAddTime(updaterunArgs, PS_LIST_TAIL, "-dateobs_end",       0, "search for exposures by time (<)", NULL);
     114    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-exp_tag",            0, "search by exp_tag", NULL);
     115    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-exp_type",           0, "search by exp_type", NULL);
     116    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-filelevel",          0, "search by filelevel", NULL);
     117    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-reduction",          0, "search by reduction class", NULL);
     118    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-filter",             0, "search for filter", NULL);
     119    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-airmass_min",        0, "define min airmass", NAN);
     120    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-airmass_max",        0, "define max airmass", NAN);
     121    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-ra_min",             0, "define min", NAN);
     122    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-ra_max",             0, "define max", NAN);
     123    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-decl_min",           0, "define min", NAN);
     124    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-decl_max",           0, "define max", NAN);
     125    psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-exp_time_min",       0, "define min", NAN);
     126    psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-exp_time_max",       0, "define max", NAN);
     127    psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-sat_pixel_frac_min", 0, "define max fraction of saturated pixels", NAN);
     128    psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-sat_pixel_frac_max", 0, "define min fraction of saturated pixels", NAN);
     129    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-bg_min",             0, "define max", NAN);
     130    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-bg_max",             0, "define max", NAN);
     131    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-bg_stdev_min",       0, "define max", NAN);
     132    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-bg_stdev_max",       0, "define max", NAN);
     133    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-bg_mean_stdev_min",  0, "define max", NAN);
     134    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-bg_mean_stdev_max",  0, "define max", NAN);
     135    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-alt_min",            0, "define min", NAN);
     136    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-alt_max",            0, "define max", NAN);
     137    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-az_min",             0, "define min", NAN);
     138    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-az_max",             0, "define max", NAN);
     139    psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-ccd_temp_min",       0, "define min ccd tempature", NAN);
     140    psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-ccd_temp_max",       0, "define max ccd tempature", NAN);
     141    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-posang_min",         0, "define min rotator position angle", NAN);
     142    psMetadataAddF64(updaterunArgs, PS_LIST_TAIL, "-posang_max",         0, "define max rotator position angle", NAN);
     143    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-object",             0, "search by exposure object", NULL);
     144    psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-solang_min",         0, "define min solar angle", NAN);
     145    psMetadataAddF32(updaterunArgs, PS_LIST_TAIL, "-solang_max",         0, "define max solar angle", NAN);
     146
     147    psMetadataAddBool(updaterunArgs, PS_LIST_TAIL, "-all",               0, "allow everything to be queued without search terms", false);
     148    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-state",              0, "set state", NULL);
     149    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-label",              0, "set label", NULL);
    240150
    241151    // -pendingexp
    242152    psMetadata *pendingexpArgs = psMetadataAlloc();
    243     psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-cam_id", 0,
    244             "search by camtool ID", 0);
    245     psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-chip_id", 0,
    246             "search by chiptool ID", 0);
    247     psMetadataAddU64(pendingexpArgs, PS_LIST_TAIL, "-limit",  0,
    248             "limit result set to N items", 0);
    249     psMetadataAddBool(pendingexpArgs, PS_LIST_TAIL, "-simple", 0,
    250             "use the simple output format", false);
    251 
     153    psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-cam_id",            0, "search by camtool ID", 0);
     154    psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-chip_id",           0, "search by chiptool ID", 0);
     155    psMetadataAddU64(pendingexpArgs, PS_LIST_TAIL, "-limit",             0, "limit result set to N items", 0);
     156    psMetadataAddBool(pendingexpArgs, PS_LIST_TAIL, "-simple",           0, "use the simple output format", false);
    252157
    253158    // -pendingimfile
    254159    psMetadata *pendingimfileArgs = psMetadataAlloc();
    255     psMetadataAddS64(pendingimfileArgs, PS_LIST_TAIL, "-cam_id", 0,
    256             "search by camtool ID", 0);
    257     psMetadataAddS64(pendingimfileArgs, PS_LIST_TAIL, "-chip_id", 0,
    258             "search by chiptool ID", 0);
    259     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class", 0,
    260             "search by class", NULL);
    261     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class_id", 0,
    262             "search by class ID", NULL);
    263     psMetadataAddBool(pendingimfileArgs, PS_LIST_TAIL, "-simple", 0,
    264             "use the simple output format", false);
    265 
     160    psMetadataAddS64(pendingimfileArgs, PS_LIST_TAIL, "-cam_id", 0,            "search by camtool ID", 0);
     161    psMetadataAddS64(pendingimfileArgs, PS_LIST_TAIL, "-chip_id", 0,            "search by chiptool ID", 0);
     162    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class", 0,            "search by class", NULL);
     163    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class_id", 0,            "search by class ID", NULL);
     164    psMetadataAddBool(pendingimfileArgs, PS_LIST_TAIL, "-simple", 0,            "use the simple output format", false);
    266165
    267166    // -addprocessedexp
    268167    psMetadata *addprocessedexpArgs = psMetadataAlloc();
    269     psMetadataAddS64(addprocessedexpArgs, PS_LIST_TAIL, "-cam_id", 0,
    270             "define camtool ID (required)", 0);
    271     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-uri", 0,
    272             "define URI (required)", NULL);
    273     psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-bg", 0,
    274             "define exposure background", NAN);
    275     psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-bg_stdev", 0,
    276             "define exposure background stdev", NAN);
    277     psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-bg_mean_stdev", 0,
    278             "define exposure background mean stdev", NAN);
    279     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-bias",  0,
    280             "define bias", NAN);
    281     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-bias_stdev",  0,
    282             "define bias stdev", NAN);
    283     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-fringe_0",  0,
    284             "define fringe term 0", NAN);
    285     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-fringe_1",  0,
    286             "define fringe term 1", NAN);
    287     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-fringe_2",  0,
    288             "define fringe term 2", NAN);
    289     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-sigma_ra", 0,
    290             "define exposure E ra", NAN);
    291     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-sigma_dec", 0,
    292             "define exposure E dec", NAN);
    293     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-ap_resid",  0,
    294             "define aperture residual", NAN);
    295     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-ap_resid_stdev",  0,
    296             "define aperture residual stdev", NAN);
    297     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-zp_mean", 0,
    298             "define zero point mean", NAN);
    299     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-zp_stdev", 0,
    300             "define zero point stdev", NAN);
    301     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-fwhm_major", 0,
    302             "define FWHM (major axis; arcsec)", NAN);
    303     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-fwhm_minor", 0,
    304             "define FWHM (minor axis; arcsec)", NAN);
    305     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-dtime_detrend", 0,
    306             "define elapsed detrend processing time (seconds)", NAN);
    307     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-dtime_photom", 0,
    308             "define elapsed photometry processing time (seconds)", NAN);
    309     psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-dtime_astrom", 0,
    310             "define elapsed astrometry processing time (seconds)", NAN);
    311     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-hostname", 0,
    312             "define hostname", NULL);
    313     psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-n_stars", 0,
    314             "define number of stars", 0);
    315     psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-n_extended", 0,
    316             "define number of extended objects", 0);
    317     psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-n_cr", 0,
    318             "define number of cosmic rays", 0);
    319     psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-n_astrom", 0,
    320             "define number of astrometry reference objects", 0);
    321     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-path_base", 0,
    322             "define base output location", NULL);
    323     psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-code",  0,
    324             "set fault code", 0);
    325     psMetadataAddBool(addprocessedexpArgs, PS_LIST_TAIL, "-faulted",  0,
    326             "only return imfiles with a fault status set", false);
     168    psMetadataAddS64(addprocessedexpArgs, PS_LIST_TAIL, "-cam_id", 0,            "define camtool ID (required)", 0);
     169    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-uri", 0,            "define URI (required)", NULL);
     170    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-bg", 0,            "define exposure background", NAN);
     171    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-bg_stdev", 0,            "define exposure background stdev", NAN);
     172    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-bg_mean_stdev", 0,            "define exposure background mean stdev", NAN);
     173    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-bias",  0,            "define bias", NAN);
     174    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-bias_stdev",  0,            "define bias stdev", NAN);
     175    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-fringe_0",  0,            "define fringe term 0", NAN);
     176    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-fringe_1",  0,            "define fringe term 1", NAN);
     177    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-fringe_2",  0,            "define fringe term 2", NAN);
     178    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-sigma_ra", 0,            "define exposure E ra", NAN);
     179    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-sigma_dec", 0,            "define exposure E dec", NAN);
     180    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-ap_resid",  0,            "define aperture residual", NAN);
     181    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-ap_resid_stdev",  0,            "define aperture residual stdev", NAN);
     182    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-zp_mean", 0,            "define zero point mean", NAN);
     183    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-zp_stdev", 0,            "define zero point stdev", NAN);
     184    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-fwhm_major", 0,            "define FWHM (major axis; arcsec)", NAN);
     185    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-fwhm_minor", 0,            "define FWHM (minor axis; arcsec)", NAN);
     186    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-dtime_detrend", 0,            "define elapsed detrend processing time (seconds)", NAN);
     187    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-dtime_photom", 0,            "define elapsed photometry processing time (seconds)", NAN);
     188    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-dtime_astrom", 0,            "define elapsed astrometry processing time (seconds)", NAN);
     189    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-hostname", 0,            "define hostname", NULL);
     190    psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-n_stars", 0,            "define number of stars", 0);
     191    psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-n_extended", 0,            "define number of extended objects", 0);
     192    psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-n_cr", 0,            "define number of cosmic rays", 0);
     193    psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-n_astrom", 0,            "define number of astrometry reference objects", 0);
     194    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-path_base", 0,            "define base output location", NULL);
     195    psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-code",  0,            "set fault code", 0);
     196    psMetadataAddBool(addprocessedexpArgs, PS_LIST_TAIL, "-faulted",  0,            "only return imfiles with a fault status set", false);
    327197
    328198    // -processedexp
    329199    psMetadata *processedexpArgs = psMetadataAlloc();
    330     psMetadataAddS64(processedexpArgs, PS_LIST_TAIL, "-cam_id", 0,
    331             "search by camtool ID", 0);
    332     psMetadataAddS64(processedexpArgs, PS_LIST_TAIL, "-chip_id", 0,
    333             "search by chiptool ID", 0);
    334     psMetadataAddU64(processedexpArgs, PS_LIST_TAIL, "-limit",  0,
    335             "limit result set to N items", 0);
    336     psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-simple", 0,
    337             "use the simple output format", false);
    338     psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-faulted",  0,
    339             "only return imfiles with a fault status set", false);
     200    psMetadataAddS64(processedexpArgs, PS_LIST_TAIL, "-cam_id", 0,            "search by camtool ID", 0);
     201    psMetadataAddS64(processedexpArgs, PS_LIST_TAIL, "-chip_id", 0,            "search by chiptool ID", 0);
     202    psMetadataAddU64(processedexpArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
     203    psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-simple", 0,            "use the simple output format", false);
     204    psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-faulted",  0,            "only return imfiles with a fault status set", false);
    340205
    341206    // -revertprocessedexp
     207    // XXX need to allow multiple cam_ids
     208    // XXX need to allow multiple chip_ids
     209    // XXX need to allow multiple exp_ids
    342210    psMetadata *revertprocessedexpArgs = psMetadataAlloc();
    343     // XXX need to allow multiple cam_ids
    344     psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-cam_id",  0,
    345             "search by cam_id", 0);
    346     // XXX need to allow multiple chip_ids
    347     psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-chip_id",  0,
    348             "search by chip_id", 0);
    349     // XXX need to allow multiple exp_ids
    350     psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_id",  0,
    351             "search by exp_id", 0);
    352     psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_name",  0,
    353             "search by exp_name", NULL);
    354     psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-inst",  0,
    355             "search for camera", NULL);
    356     psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-telescope",  0,
    357             "search for telescope", NULL);
    358     psMetadataAddTime(revertprocessedexpArgs, PS_LIST_TAIL, "-dateobs_begin", 0,
    359             "search for exposures by time (>=)", NULL);
    360     psMetadataAddTime(revertprocessedexpArgs, PS_LIST_TAIL, "-dateobs_end", 0,
    361             "search for exposures by time (<)", NULL);
    362     psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
    363             "search by exp_tag", NULL);
    364     psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_type",  0,
    365             "search by exp_type", NULL);
    366     psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-filelevel",  0,
    367             "search by filelevel", NULL);
    368     psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-reduction",  0,
    369             "search by reduction class", NULL);
    370     psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-filter",  0,
    371             "search for filter", NULL);
    372     psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-airmass_min",  0,
    373             "define min airmass", NAN);
    374     psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-airmass_max",  0,
    375             "define max airmass", NAN);
    376     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-ra_min",  0,
    377             "define min", NAN);
    378     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-ra_max",  0,
    379             "define max", NAN);
    380     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-decl_min",  0,
    381             "define min", NAN);
    382     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-decl_max",  0,
    383             "define max", NAN);
    384     psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_time_min",  0,
    385             "define min", NAN);
    386     psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_time_max",  0,
    387             "define max", NAN);
    388     psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-sat_pixel_frac_min",  0,
    389             "define max fraction of saturated pixels", NAN);
    390     psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-sat_pixel_frac_max",  0,
    391             "define min fraction of saturated pixels", NAN);
    392     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-bg_min",  0,
    393             "define max", NAN);
    394     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-bg_max",  0,
    395             "define max", NAN);
    396     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-bg_stdev_min",  0,
    397             "define max", NAN);
    398     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-bg_stdev_max",  0,
    399             "define max", NAN);
    400     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-bg_mean_stdev_min",  0,
    401             "define max", NAN);
    402     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-bg_mean_stdev_max",  0,
    403             "define max", NAN);
    404     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-alt_min",  0,
    405             "define min", NAN);
    406     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-alt_max",  0,
    407             "define max", NAN);
    408     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-az_min",  0,
    409             "define min", NAN);
    410     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-az_max",  0,
    411             "define max", NAN);
    412     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-ccd_temp_min",  0,
    413             "define min ccd tempature", NAN);
    414     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-ccd_temp_max",  0,
    415             "define max ccd tempature", NAN);
    416     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-posang_min",  0,
    417             "define min rotator position angle", NAN);
    418     psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-posang_max",  0,
    419             "define max rotator position angle", NAN);
    420     psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-object",  0,
    421             "search by exposure object", NULL);
    422     psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-solang_min",  0,
    423             "define min solar angle", NAN);
    424     psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-solang_max",  0,
    425             "define max solar angle", NAN);
    426 
    427     psMetadataAddBool(revertprocessedexpArgs, PS_LIST_TAIL, "-all",  0,
    428             "allow everything to be queued without search terms", false);
    429     psMetadataAddS16(revertprocessedexpArgs, PS_LIST_TAIL, "-code",  0,
    430             "search by fault code", 0);
     211    psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-cam_id",  0,            "search by cam_id", 0);
     212    psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-chip_id",  0,            "search by chip_id", 0);
     213    psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_id",  0,            "search by exp_id", 0);
     214    psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_name",  0,            "search by exp_name", NULL);
     215    psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-inst",  0,            "search for camera", NULL);
     216    psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-telescope",  0,            "search for telescope", NULL);
     217    psMetadataAddTime(revertprocessedexpArgs, PS_LIST_TAIL, "-dateobs_begin", 0,            "search for exposures by time (>=)", NULL);
     218    psMetadataAddTime(revertprocessedexpArgs, PS_LIST_TAIL, "-dateobs_end", 0,            "search for exposures by time (<)", NULL);
     219    psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,            "search by exp_tag", NULL);
     220    psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_type",  0,            "search by exp_type", NULL);
     221    psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-filelevel",  0,            "search by filelevel", NULL);
     222    psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-reduction",  0,            "search by reduction class", NULL);
     223    psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-filter",  0,            "search for filter", NULL);
     224    psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-airmass_min",  0,            "define min airmass", NAN);
     225    psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-airmass_max",  0,            "define max airmass", NAN);
     226    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-ra_min",  0,            "define min", NAN);
     227    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-ra_max",  0,            "define max", NAN);
     228    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-decl_min",  0,            "define min", NAN);
     229    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-decl_max",  0,            "define max", NAN);
     230    psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_time_min",  0,            "define min", NAN);
     231    psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_time_max",  0,            "define max", NAN);
     232    psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-sat_pixel_frac_min",  0,            "define max fraction of saturated pixels", NAN);
     233    psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-sat_pixel_frac_max",  0,            "define min fraction of saturated pixels", NAN);
     234    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-bg_min",  0,            "define max", NAN);
     235    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-bg_max",  0,            "define max", NAN);
     236    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-bg_stdev_min",  0,            "define max", NAN);
     237    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-bg_stdev_max",  0,            "define max", NAN);
     238    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-bg_mean_stdev_min",  0,            "define max", NAN);
     239    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-bg_mean_stdev_max",  0,            "define max", NAN);
     240    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-alt_min",  0,            "define min", NAN);
     241    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-alt_max",  0,            "define max", NAN);
     242    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-az_min",  0,            "define min", NAN);
     243    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-az_max",  0,            "define max", NAN);
     244    psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-ccd_temp_min",  0,            "define min ccd tempature", NAN);
     245    psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-ccd_temp_max",  0,            "define max ccd tempature", NAN);
     246    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-posang_min",  0,            "define min rotator position angle", NAN);
     247    psMetadataAddF64(revertprocessedexpArgs, PS_LIST_TAIL, "-posang_max",  0,            "define max rotator position angle", NAN);
     248    psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-object",  0,            "search by exposure object", NULL);
     249    psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-solang_min",  0,            "define min solar angle", NAN);
     250    psMetadataAddF32(revertprocessedexpArgs, PS_LIST_TAIL, "-solang_max",  0,            "define max solar angle", NAN);
     251
     252    psMetadataAddBool(revertprocessedexpArgs, PS_LIST_TAIL, "-all",  0,            "allow everything to be queued without search terms", false);
     253    psMetadataAddS16(revertprocessedexpArgs, PS_LIST_TAIL, "-code",  0,            "search by fault code", 0);
    431254
    432255
    433256    // -updateprocessedexp
    434257    psMetadata *updateprocessedexpArgs = psMetadataAlloc();
    435     psMetadataAddS64(updateprocessedexpArgs, PS_LIST_TAIL, "-cam_id", 0,
    436             "search by camtool ID", 0);
    437     psMetadataAddS64(updateprocessedexpArgs, PS_LIST_TAIL, "-chip_id",  0,
    438             "search by chiptool ID", 0);
    439     psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-class",  0,
    440             "search by class", NULL);
    441     psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-class_id",  0,
    442             "search by class ID", NULL);
    443     psMetadataAddS16(updateprocessedexpArgs, PS_LIST_TAIL, "-code",  0,
    444             "set fault code (required)", INT16_MAX);
     258    psMetadataAddS64(updateprocessedexpArgs, PS_LIST_TAIL, "-cam_id", 0,            "search by camtool ID", 0);
     259    psMetadataAddS64(updateprocessedexpArgs, PS_LIST_TAIL, "-chip_id",  0,            "search by chiptool ID", 0);
     260    psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-class",  0,            "search by class", NULL);
     261    psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-class_id",  0,            "search by class ID", NULL);
     262    psMetadataAddS16(updateprocessedexpArgs, PS_LIST_TAIL, "-code",  0,            "set fault code (required)", INT16_MAX);
    445263
    446264    // -block
    447265    psMetadata *blockArgs = psMetadataAlloc();
    448     psMetadataAddStr(blockArgs, PS_LIST_TAIL, "-label",  0,
    449             "name of a label to mask out (required)", NULL);
     266    psMetadataAddStr(blockArgs, PS_LIST_TAIL, "-label",  0,            "name of a label to mask out (required)", NULL);
    450267
    451268    // -masked
    452269    psMetadata *maskedArgs = psMetadataAlloc();
    453     psMetadataAddBool(maskedArgs, PS_LIST_TAIL, "-simple",  0,
    454             "use the simple output format", false);
     270    psMetadataAddBool(maskedArgs, PS_LIST_TAIL, "-simple",  0,            "use the simple output format", false);
    455271
    456272    // -unblock
    457273    psMetadata *unblockArgs = psMetadataAlloc();
    458     psMetadataAddStr(unblockArgs, PS_LIST_TAIL, "-label",  0,
    459             "name of a label to unmask (required)", NULL);
     274    psMetadataAddStr(unblockArgs, PS_LIST_TAIL, "-label",  0,            "name of a label to unmask (required)", NULL);
    460275
    461276    psMetadata *argSets = psMetadataAlloc();
     
    485300    psFree(modes);
    486301
    487     // setup search criterion
    488 #define addWhereStr(name) \
    489 { \
    490     psString str = NULL; \
    491     bool status = false; \
    492     if ((str = psMetadataLookupStr(&status, config->args, "-" #name))) { \
    493         if (!psMetadataAddStr(config->where, PS_LIST_TAIL, #name, 0, "==", str)) {\
    494             psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \
    495             psFree(config); \
    496             return NULL; \
    497         } \
    498     } \
    499 }
    500 
    501     // generate SQL where clause
    502     config->where = psMetadataAlloc();
    503 
    504 {
    505     psS64 cam_id = -1;
    506     bool status = false;
    507     if ((cam_id = psMetadataLookupS64(&status, config->args, "-cam_id"))) {
    508         if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "cam_id", 0, "==", cam_id)) {
    509             psError(PS_ERR_UNKNOWN, false, "failed to add item cam_id");
    510             psFree(config);
    511             return NULL;
    512         }
    513     }
    514 }
    515 
    516 {
    517     psString str = NULL;
    518     bool status = false;
    519     if ((str = psMetadataLookupStr(&status, config->args, "-chip_id"))) {
    520         if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(str))) {
    521             psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");
    522             psFree(config);
    523             return NULL;
    524         }
    525     }
    526 }
    527 
    528     // convert '-inst' to 'camera'
    529     {
    530         psString str = NULL;
    531         bool status = false;
    532         if ((str = psMetadataLookupStr(&status, config->args, "-inst"))) {
    533             if (!psMetadataAddStr(config->where, PS_LIST_TAIL, "camera", 0, "==", str)) {
    534                 psError(PS_ERR_UNKNOWN, false, "failed to add item camera");
    535                 psFree(config);
    536                 return NULL;
    537             }
    538         }
    539     }
    540     addWhereStr(telescope);
    541     addWhereStr(exp_type);
    542     {
    543         int imfiles = 0;
    544         bool status = false;
    545         if ((imfiles = psMetadataLookupS32(&status, config->args, "-imfiles"))) {
    546             if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "imfiles", 0, "==", imfiles)) {
    547                 psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles");
    548                 psFree(config);
    549                 return NULL;
    550             }
    551         }
    552     }
    553     addWhereStr(class_id);
    554     addWhereStr(filter);
    555 
    556     // convert '-code' to 'fault'
    557     {
    558         psS16 fault = 0;
    559         bool status = false;
    560         if ((fault = psMetadataLookupS16(&status, config->args, "-code"))) {
    561             if (!psMetadataAddS16(config->where, PS_LIST_TAIL, "fault", 0, "==", fault)) {
    562                 psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    563                 psFree(config);
    564                 return NULL;
    565             }
    566         }
    567     }
    568 
    569     if (psListLength(config->where->list) < 1) {
    570         psFree(config->where);
    571         config->where = NULL;
    572     }
    573 
    574 
    575302    // define Database handle, if used
    576303    config->dbh = psMemIncrRefCounter(pmConfigDB(config->modules));
Note: See TracChangeset for help on using the changeset viewer.