IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 13, 2007, 5:44:48 PM (19 years ago)
Author:
jhoblitt
Message:

update chiptool -queue

File:
1 edited

Legend:

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

    r14120 r14214  
    9393}
    9494
    95 #define ADDRENAMEPARAMSTR(from, to, oldname, newname) \
     95#define ADDRENAMEPARAMSTR(from, to, oldname, newname, comment) \
    9696{ \
    9797    bool status = false; \
     
    102102    } \
    103103    if (str) { \
    104         if (!psMetadataAddStr(to, PS_LIST_TAIL, newname, 0, "==", str)) { \
     104        if (!psMetadataAddStr(to, PS_LIST_TAIL, newname, PS_META_DUPLICATE_OK, comment, str)) { \
    105105            psError(PS_ERR_UNKNOWN, false, "failed to add item " newname); \
    106106            psFree(to); \
     
    110110}
    111111
    112 #define ADDPARAMSTR(from, to, name) ADDRENAMEPARAMSTR(from, to, name, name)
    113 
    114 #define ADDPARAMF(from, to, type, name) \
     112#define ADDPARAMSTR(from, to, name) \
     113  ADDRENAMEPARAMSTR(from, to, name, name, "==")
     114
     115#define ADDRENAMEPARAMF(from, to, type, oldname, newname, comment) \
    115116{ \
    116117    bool status = false; \
    117     ps##type var = psMetadataLookup##type(&status, from, "-" name); \
     118    ps##type var = psMetadataLookup##type(&status, from, "-" oldname); \
    118119    if (!status) { \
    119         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -" name); \
     120        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -" oldname); \
    120121        return false; \
    121122    } \
    122123    if (!isnan(var)) { \
    123         if (!psMetadataAdd##type(to, PS_LIST_TAIL, #name, 0, "==", var)) { \
    124             psError(PS_ERR_UNKNOWN, false, "failed to add item " name); \
     124        if (!psMetadataAdd##type(to, PS_LIST_TAIL, newname, PS_META_DUPLICATE_OK, comment, var)) { \
     125            psError(PS_ERR_UNKNOWN, false, "failed to add item " newname); \
    125126            psFree(to); \
    126127            return false; \
     
    129130}
    130131
     132#define ADDPARAMF(from, to, type, name) \
     133  ADDRENAMEPARAMF(from, to, type, name, name, "==")
     134
    131135static bool queueMode(pxConfig *config)
    132136{
     
    134138
    135139    psMetadata *where = psMetadataAlloc();
    136     ADDPARAMSTR(config->args, where, "exp_id");
     140    // convert exp_id into a psS64
     141{
     142    bool status = false;
     143    psString var = psMetadataLookupStr(&status, config->args, "-exp_id");
     144    if (!status) {
     145        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
     146        return false;
     147    }
     148    if (var) {
     149        if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(var))) {
     150            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
     151            psFree(where);
     152            return false;
     153        }
     154    }
     155}
    137156    ADDPARAMSTR(config->args, where, "exp_name");
    138     ADDRENAMEPARAMSTR(config->args, where, "inst", "camera");
     157    ADDRENAMEPARAMSTR(config->args, where, "inst", "camera", "==");
    139158    ADDPARAMSTR(config->args, where, "telescope");
    140     ADDPARAMSTR(config->args, where, "dateobs");
     159    ADDPARAMSTR(config->args, where, "dateobs_begin");
     160    ADDPARAMSTR(config->args, where, "dateobs_end");
     161    ADDPARAMSTR(config->args, where, "exp_tag");
    141162    ADDPARAMSTR(config->args, where, "exp_type");
    142     ADDPARAMSTR(config->args, where, "imfiles");
    143     ADDPARAMSTR(config->args, where, "workdir");
     163    ADDPARAMSTR(config->args, where, "filelevel");
     164    ADDPARAMSTR(config->args, where, "reduction");
    144165    ADDPARAMSTR(config->args, where, "filter");
    145     ADDPARAMF(config->args, where, F32, "airmass");
    146     ADDPARAMF(config->args, where, F32, "ra");
    147     ADDPARAMF(config->args, where, F32, "decl");
    148     ADDPARAMF(config->args, where, F32, "exp_time");
    149     ADDPARAMF(config->args, where, F32, "bg");
    150     ADDPARAMF(config->args, where, F32, "bg_stdev");
    151     ADDPARAMF(config->args, where, F32, "bg_mean_stdev");
    152     ADDPARAMF(config->args, where, F64, "alt");
    153     ADDPARAMF(config->args, where, F64, "az");
    154     ADDPARAMF(config->args, where, F32, "ccd_temp");
    155     ADDPARAMF(config->args, where, F64, "posang");
     166    ADDRENAMEPARAMF(config->args, where, F64, "airmass_min", "airmass", ">=");
     167    ADDRENAMEPARAMF(config->args, where, F64, "airmass_max", "airmass", "<");
     168    ADDRENAMEPARAMF(config->args, where, F64, "ra_min", "ra", ">=");
     169    ADDRENAMEPARAMF(config->args, where, F64, "ra_max", "ra", "<");
     170    ADDRENAMEPARAMF(config->args, where, F64, "decl_min", "decl", ">=");
     171    ADDRENAMEPARAMF(config->args, where, F64, "decl_max", "decl", "<");
     172    ADDRENAMEPARAMF(config->args, where, F32, "exp_time_min", "exp_time", ">=");
     173    ADDRENAMEPARAMF(config->args, where, F32, "exp_time_max", "exp_time", "<");
     174    ADDRENAMEPARAMF(config->args, where, F32, "sat_pixel_frac_min", "sat_pixel_frac", ">=");
     175    ADDRENAMEPARAMF(config->args, where, F32, "sat_pixel_frac_max", "sat_pixel_frac", "<");
     176    ADDRENAMEPARAMF(config->args, where, F64, "bg_min", "bt", ">=");
     177    ADDRENAMEPARAMF(config->args, where, F64, "bg_max", "bt", "<");
     178    ADDRENAMEPARAMF(config->args, where, F64, "bg_stdev_min", "bg_stdev", ">=");
     179    ADDRENAMEPARAMF(config->args, where, F64, "bg_stdev_max", "bg_stdev", "<");
     180    ADDRENAMEPARAMF(config->args, where, F64, "bg_mean_stdev_min", "bg_mean_stdev", ">=");
     181    ADDRENAMEPARAMF(config->args, where, F64, "bg_mean_stdev_max", "bg_mean_stdev", "<");
     182    ADDRENAMEPARAMF(config->args, where, F64, "alt_min", "alt", ">=");
     183    ADDRENAMEPARAMF(config->args, where, F64, "alt_max", "alt", "<");
     184    ADDRENAMEPARAMF(config->args, where, F64, "az_min", "az", ">=");
     185    ADDRENAMEPARAMF(config->args, where, F64, "az_max", "az", "<");
     186    ADDRENAMEPARAMF(config->args, where, F32, "ccd_temp_min", "ccd_temp", ">=");
     187    ADDRENAMEPARAMF(config->args, where, F32, "ccd_temp_max", "ccd_temp", "<");
     188    ADDRENAMEPARAMF(config->args, where, F64, "posang_min", "posang", ">=");
     189    ADDRENAMEPARAMF(config->args, where, F64, "posang_max", "posang", "<");
    156190    ADDPARAMSTR(config->args, where, "object");
     191    ADDRENAMEPARAMF(config->args, where, F32, "solang_min", "solang", ">=");
     192    ADDRENAMEPARAMF(config->args, where, F32, "solang_max", "solang", "<");
    157193
    158194    if (where->list->n < 1) {
     
    236272        psMetadata *md = output->data[i];
    237273
    238         psString exp_id = psMetadataLookupStr(&status, md, "exp_id");
     274        psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id");
    239275        if (!status) {
    240276            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id");
     
    249285            }
    250286            psError(PS_ERR_UNKNOWN, false,
    251                     "failed to trying to queue exp_id: %s", exp_id);
     287                    "failed to trying to queue exp_id: %" PRId64, exp_id);
    252288            psFree(output);
    253289            return false;
Note: See TracChangeset for help on using the changeset viewer.