IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 18, 2009, 5:46:54 PM (17 years ago)
Author:
eugene
Message:

add pxwarpGet/SetSearchArgv

File:
1 edited

Legend:

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

    r23383 r23418  
    191191
    192192    psMetadata *where = psMetadataAlloc();
    193     PXOPT_COPY_S64(config->args, where, "-fake_id", "fakeRun.fake_id", "==");
    194     PXOPT_COPY_S64(config->args, where, "-cam_id", "camRun.cam_id", "==");
    195     PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "==");
    196     PXOPT_COPY_S64(config->args, where, "-exp_id", "newExp.exp_id", "==");
    197     PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "==");
    198     PXOPT_COPY_STR(config->args, where, "-inst", "camera", "==");
    199     PXOPT_COPY_STR(config->args, where, "-telescope", "telescope", "==");
    200     PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "dateobs", ">=");
    201     PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "dateobs", "<=");
    202     PXOPT_COPY_STR(config->args, where, "-exp_tag", "exp_tag", "==");
    203     PXOPT_COPY_STR(config->args, where, "-exp_type", "exp_type", "==");
    204     PXOPT_COPY_STR(config->args, where, "-filelevel", "filelevel", "==");
    205     PXOPT_COPY_STR(config->args, where, "-reduction", "reduction", "==");
    206     PXOPT_COPY_STR(config->args, where, "-filter", "filter", "==");
    207     PXOPT_COPY_F64(config->args, where, "-airmass_min", "airmass", ">=");
    208     PXOPT_COPY_F64(config->args, where, "-airmass_max", "airmass", "<");
    209     PXOPT_COPY_F64(config->args, where, "-ra_min", "ra", ">=");
    210     PXOPT_COPY_F64(config->args, where, "-ra_max", "ra", "<");
    211     PXOPT_COPY_F64(config->args, where, "-decl_min", "decl", ">=");
    212     PXOPT_COPY_F64(config->args, where, "-decl_max", "decl", "<");
    213     PXOPT_COPY_F32(config->args, where, "-exp_time_min", "exp_time", ">=");
    214     PXOPT_COPY_F32(config->args, where, "-exp_time_max", "exp_time", "<");
    215     PXOPT_COPY_F32(config->args, where, "-sat_pixel_frac_min", "sat_pixel_frac", ">=");
    216     PXOPT_COPY_F32(config->args, where, "-sat_pixel_frac_max", "sat_pixel_frac", "<");
    217     PXOPT_COPY_F64(config->args, where, "-bg_min", "bt", ">=");
    218     PXOPT_COPY_F64(config->args, where, "-bg_max", "bt", "<");
    219     PXOPT_COPY_F64(config->args, where, "-bg_stdev_min", "bg_stdev", ">=");
    220     PXOPT_COPY_F64(config->args, where, "-bg_stdev_max", "bg_stdev", "<");
    221     PXOPT_COPY_F64(config->args, where, "-bg_mean_stdev_min", "bg_mean_stdev", ">=");
    222     PXOPT_COPY_F64(config->args, where, "-bg_mean_stdev_max", "bg_mean_stdev", "<");
    223     PXOPT_COPY_F64(config->args, where, "-alt_min", "alt", ">=");
    224     PXOPT_COPY_F64(config->args, where, "-alt_max", "alt", "<");
    225     PXOPT_COPY_F64(config->args, where, "-az_min", "az", ">=");
    226     PXOPT_COPY_F64(config->args, where, "-az_max", "az", "<");
    227     PXOPT_COPY_F32(config->args, where, "-ccd_temp_min", "ccd_temp", ">=");
    228     PXOPT_COPY_F32(config->args, where, "-ccd_temp_max", "ccd_temp", "<");
    229     PXOPT_COPY_F64(config->args, where, "-posang_min", "posang", ">=");
    230     PXOPT_COPY_F64(config->args, where, "-posang_max", "posang", "<");
    231     PXOPT_COPY_STR(config->args, where, "-object", "object", "==");
    232     PXOPT_COPY_F32(config->args, where, "-solang_min", "solang", ">=");
    233     PXOPT_COPY_F32(config->args, where, "-solang_max", "solang", "<");
    234     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     193    pxwarpGetSearchArgs (config, where);
     194    PXOPT_COPY_STR(config->args, where, "-reduction", "fakeRun.reduction", "==");
     195    PXOPT_COPY_STR(config->args, where, "-label",     "fakeRun.label",     "==");
    235196
    236197    if (!psListLength(where->list) &&
     
    338299
    339300    psMetadata *where = psMetadataAlloc();
    340     PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "==");
    341     PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "==");
    342     PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
    343     PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
    344     PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "==");
    345     PXOPT_COPY_STR(config->args, where, "-inst", "camera", "==");
    346     PXOPT_COPY_STR(config->args, where, "-telescope", "telescope", "==");
    347     PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "dateobs", ">=");
    348     PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "dateobs", "<=");
    349     PXOPT_COPY_STR(config->args, where, "-exp_tag", "exp_tag", "==");
    350     PXOPT_COPY_STR(config->args, where, "-exp_type", "exp_type", "==");
    351     PXOPT_COPY_STR(config->args, where, "-filelevel", "filelevel", "==");
    352     PXOPT_COPY_STR(config->args, where, "-reduction", "reduction", "==");
    353     PXOPT_COPY_STR(config->args, where, "-filter", "filter", "==");
    354     PXOPT_COPY_F32(config->args, where, "-airmass_min", "airmass", ">=");
    355     PXOPT_COPY_F32(config->args, where, "-airmass_max", "airmass", "<");
    356     PXOPT_COPY_F64(config->args, where, "-ra_min", "ra", ">=");
    357     PXOPT_COPY_F64(config->args, where, "-ra_max", "ra", "<");
    358     PXOPT_COPY_F64(config->args, where, "-decl_min", "decl", ">=");
    359     PXOPT_COPY_F64(config->args, where, "-decl_max", "decl", "<");
    360     PXOPT_COPY_F32(config->args, where, "-exp_time_min", "exp_time", ">=");
    361     PXOPT_COPY_F32(config->args, where, "-exp_time_max", "exp_time", "<");
    362     PXOPT_COPY_F32(config->args, where, "-sat_pixel_frac_min", "sat_pixel_frac", ">=");
    363     PXOPT_COPY_F32(config->args, where, "-sat_pixel_frac_max", "sat_pixel_frac", "<");
    364     PXOPT_COPY_F64(config->args, where, "-bg_min", "bt", ">=");
    365     PXOPT_COPY_F64(config->args, where, "-bg_max", "bt", "<");
    366     PXOPT_COPY_F64(config->args, where, "-bg_stdev_min", "bg_stdev", ">=");
    367     PXOPT_COPY_F64(config->args, where, "-bg_stdev_max", "bg_stdev", "<");
    368     PXOPT_COPY_F64(config->args, where, "-bg_mean_stdev_min", "bg_mean_stdev", ">=");
    369     PXOPT_COPY_F64(config->args, where, "-bg_mean_stdev_max", "bg_mean_stdev", "<");
    370     PXOPT_COPY_F64(config->args, where, "-alt_min", "alt", ">=");
    371     PXOPT_COPY_F64(config->args, where, "-alt_max", "alt", "<");
    372     PXOPT_COPY_F64(config->args, where, "-az_min", "az", ">=");
    373     PXOPT_COPY_F64(config->args, where, "-az_max", "az", "<");
    374     PXOPT_COPY_F64(config->args, where, "-ccd_temp_min", "ccd_temp", ">=");
    375     PXOPT_COPY_F64(config->args, where, "-ccd_temp_max", "ccd_temp", "<");
    376     PXOPT_COPY_F64(config->args, where, "-posang_min", "posang", ">=");
    377     PXOPT_COPY_F64(config->args, where, "-posang_max", "posang", "<");
    378     PXOPT_COPY_STR(config->args, where, "-object", "object", "==");
    379     PXOPT_COPY_F32(config->args, where, "-solang_min", "solang", ">=");
    380     PXOPT_COPY_F32(config->args, where, "-solang_max", "solang", "<");
     301    pxwarpGetSearchArgs (config, where);
     302    PXOPT_COPY_S64(config->args, where, "-warp_id",   "warpRun.warp_id",   "==");
     303    PXOPT_COPY_STR(config->args, where, "-reduction", "warpRun.reduction", "==");
     304    PXOPT_COPY_STR(config->args, where, "-label",     "warpRun.label",     "==");
     305    PXOPT_COPY_STR(config->args, where, "-state",     "warpRun.state",     "==");
    381306
    382307    if (!psListLength(where->list)
     
    388313    }
    389314
    390     PXOPT_LOOKUP_STR(state, config->args, "-state", false, false);
    391     PXOPT_LOOKUP_STR(label, config->args, "-label", false, false);
     315    PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false);
     316    PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
    392317
    393318    if ((!state) && (!label)) {
     
    11831108
    11841109    psMetadata *where = psMetadataAlloc();
    1185     PXOPT_COPY_S64(config->args, where, "-warp_id", "warpSkyfile.warp_id", "==");
     1110    pxwarpGetSearchArgs (config, where);
     1111    PXOPT_COPY_S64(config->args, where, "-warp_id",    "warpSkyfile.warp_id", "==");
    11861112    PXOPT_COPY_STR(config->args, where, "-skycell_id", "warpSkyfile.skycell_id", "==");
    1187     PXOPT_COPY_STR(config->args, where, "-tess_id", "warpSkyfile.tess_id", "==");
    1188     PXOPT_COPY_S64(config->args, where, "-fake_id", "fakeRun.fake_id", "==");
    1189     PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "==");
    1190     PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "==");
    1191 
    1192     PXOPT_COPY_STR(config->args, where, "-exp_name", "rawExp.exp_name", "==");
    1193     PXOPT_COPY_STR(config->args, where, "-label", "warpRun.label", "==");
    1194     PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.camera", "==");
    1195     PXOPT_COPY_STR(config->args, where, "-telescope", "rawExp.telescope", "==");
    1196     PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "rawExp.dateobs", ">=");
    1197     PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "rawExp.dateobs", "<=");
    1198     PXOPT_COPY_STR(config->args, where, "-exp_tag", "rawExp.exp_tag", "==");
    1199     PXOPT_COPY_STR(config->args, where, "-exp_type", "rawExp.exp_type", "==");
    1200     PXOPT_COPY_STR(config->args, where, "-filelevel", "rawExp.filelevel", "==");
    1201     PXOPT_COPY_STR(config->args, where, "-reduction", "rawExp.reduction", "==");
    1202     PXOPT_COPY_STR(config->args, where, "-filter", "rawExp.filter", "==");
    1203 
    1204     PXOPT_COPY_F32(config->args, where, "-airmass_min", "rawExp.airmass", ">=");
    1205     PXOPT_COPY_F32(config->args, where, "-airmass_max", "rawExp.airmass", "<");
    1206     PXOPT_COPY_F64(config->args, where, "-ra_min", "rawExp.ra", ">=");
    1207     PXOPT_COPY_F64(config->args, where, "-ra_max", "rawExp.ra", "<");
    1208     PXOPT_COPY_F64(config->args, where, "-decl_min", "rawExp.decl", ">=");
    1209     PXOPT_COPY_F64(config->args, where, "-decl_max", "rawExp.decl", "<");
    1210     PXOPT_COPY_F32(config->args, where, "-exp_time_min", "rawExp.exp_time", ">=");
    1211     PXOPT_COPY_F32(config->args, where, "-exp_time_max", "rawExp.exp_time", "<");
    1212     PXOPT_COPY_F32(config->args, where, "-sat_pixel_frac_min", "rawExp.sat_pixel_frac", ">=");
    1213     PXOPT_COPY_F32(config->args, where, "-sat_pixel_frac_max", "rawExp.sat_pixel_frac", "<");
    1214     PXOPT_COPY_F64(config->args, where, "-bg_min", "rawExp.bg", ">=");
    1215     PXOPT_COPY_F64(config->args, where, "-bg_max", "rawExp.bg", "<");
    1216     PXOPT_COPY_F64(config->args, where, "-bg_stdev_min", "rawExp.bg_stdev", ">=");
    1217     PXOPT_COPY_F64(config->args, where, "-bg_stdev_max", "rawExp.bg_stdev", "<");
    1218     PXOPT_COPY_F64(config->args, where, "-bg_mean_stdev_min", "rawExp.bg_mean_stdev", ">=");
    1219     PXOPT_COPY_F64(config->args, where, "-bg_mean_stdev_max", "rawExp.bg_mean_stdev", "<");
    1220     PXOPT_COPY_F64(config->args, where, "-alt_min", "rawExp.alt", ">=");
    1221     PXOPT_COPY_F64(config->args, where, "-alt_max", "rawExp.alt", "<");
    1222     PXOPT_COPY_F64(config->args, where, "-az_min", "rawExp.az", ">=");
    1223     PXOPT_COPY_F64(config->args, where, "-az_max", "rawExp.az", "<");
    1224     PXOPT_COPY_F64(config->args, where, "-ccd_temp_min", "rawExp.ccd_temp", ">=");
    1225     PXOPT_COPY_F64(config->args, where, "-ccd_temp_max", "rawExp.ccd_temp", "<");
    1226     PXOPT_COPY_F64(config->args, where, "-posang_min", "rawExp.posang", ">=");
    1227     PXOPT_COPY_F64(config->args, where, "-posang_max", "rawExp.posang", "<");
    1228     PXOPT_COPY_STR(config->args, where, "-object", "rawExp.object", "==");
    1229     PXOPT_COPY_F32(config->args, where, "-solang_min", "rawExp.solang", ">=");
    1230     PXOPT_COPY_F32(config->args, where, "-solang_max", "rawExp.solang", "<");
    1231     PXOPT_COPY_S16(config->args, where, "-code", "warpSkyfile.fault", "==");
     1113    PXOPT_COPY_STR(config->args, where, "-tess_id",    "warpSkyfile.tess_id", "==");
     1114    PXOPT_COPY_STR(config->args, where, "-reduction",  "rawExp.reduction", "==");
     1115    PXOPT_COPY_STR(config->args, where, "-label",      "warpRun.label", "==");
     1116    PXOPT_COPY_S16(config->args, where, "-code",       "warpSkyfile.fault", "==");
    12321117
    12331118    if (!psListLength(where->list)
     
    14641349    PS_ASSERT_PTR_NON_NULL(config, NULL);
    14651350
    1466     PXOPT_LOOKUP_S64(warp_id, config->args, "-warp_id", false, false);
     1351    PXOPT_LOOKUP_S64(warp_id, config->args, "-warp_id", true, false);
    14671352    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    14681353    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    14691354
    14701355    psMetadata *where = psMetadataAlloc();
    1471     if (warp_id) {
    1472         PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "==");
    1473     }
     1356    PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "==");
    14741357    PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
    14751358
     
    16261509
    16271510    // note only updates if warpRun.state = run_state
    1628     if (!p_psDBRunQueryF(config->dbh, query, data_state, warp_id, skycell_id, run_state)) {
     1511    // XXX note that we have removed this constraint for now
     1512    if (!p_psDBRunQueryF(config->dbh, query, data_state, warp_id, skycell_id)) {
    16291513        psError(PS_ERR_UNKNOWN, false, "database error");
    16301514        // rollback
Note: See TracChangeset for help on using the changeset viewer.