IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2009, 1:50:46 PM (17 years ago)
Author:
eugene
Message:

cleanup and fix use of pxcamGet/SetSearchArgs

File:
1 edited

Legend:

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

    r23310 r23590  
    109109    psMetadata *where = psMetadataAlloc();
    110110    pxcamGetSearchArgs (config, where);
    111     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     111    PXOPT_COPY_STR(config->args, where, "-label",     "chipRun.label",     "==");
     112    PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "==");
    112113
    113114    if (!psListLength(where->list)
     
    223224
    224225    psMetadata *where = psMetadataAlloc();
    225     PXOPT_COPY_S64(config->args, where, "-cam_id", "cam_id", "==");
    226226    pxcamGetSearchArgs (config, where);
    227     PXOPT_COPY_STR(config->args, where, "-label", "camRun.label", "==");
    228     PXOPT_COPY_STR(config->args, where, "-state", "camRun.state", "==");
     227    PXOPT_COPY_S64(config->args, where, "-cam_id",    "camRun.cam_id", "==");
     228    PXOPT_COPY_STR(config->args, where, "-label",     "camRun.label", "==");
     229    PXOPT_COPY_STR(config->args, where, "-state",     "camRun.state", "==");
     230    PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction", "==");
    229231
    230232    if (!psListLength(where->list)
     
    271273
    272274    psMetadata *where = psMetadataAlloc();
    273     PXOPT_COPY_S64(config->args, where, "-cam_id", "cam_id", "==");
    274275    pxcamGetSearchArgs (config, where);
    275     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     276    PXOPT_COPY_S64(config->args, where, "-cam_id",    "camRun.cam_id", "==");
     277    PXOPT_COPY_STR(config->args, where, "-label",     "camRun.label", "==");
     278    PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction", "==");
    276279
    277280    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     
    334337
    335338    psMetadata *where = psMetadataAlloc();
    336     PXOPT_COPY_S64(config->args, where, "-cam_id",   "cam_id",   "==");
    337     PXOPT_COPY_S64(config->args, where, "-chip_id",  "chip_id",  "==");
    338     PXOPT_COPY_STR(config->args, where, "-class",    "class",    "==");
    339     PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "==");
    340339    pxcamGetSearchArgs (config, where);
    341     PXOPT_COPY_STR(config->args, where, "-label", "camRun.label", "==");
     340    PXOPT_COPY_S64(config->args, where, "-cam_id",    "camRun.cam_id",                "==");
     341    PXOPT_COPY_STR(config->args, where, "-label",     "camRun.label",                 "==");
     342    PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction",             "==");
     343    PXOPT_COPY_S64(config->args, where, "-chip_id",   "chipRun.chip_id",              "==");
     344    PXOPT_COPY_STR(config->args, where, "-class_id",  "chipProcessedImfile.class_id", "==");
     345
     346    // XXX is this used? PXOPT_COPY_STR(config->args, where, "-class",    "class",         "==");
    342347
    343348    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     
    649654    // generate restrictions
    650655    psMetadata *where = psMetadataAlloc();
    651     PXOPT_COPY_S64(config->args, where, "-cam_id",   "cam_id",   "==");
    652656    pxcamGetSearchArgs (config, where);
    653     PXOPT_COPY_STR(config->args, where, "-label", "camRun.label", "==");
     657    PXOPT_COPY_S64(config->args, where, "-cam_id",    "camRun.cam_id",    "==");
     658    PXOPT_COPY_STR(config->args, where, "-label",     "camRun.label",     "==");
     659    PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction", "==");
    654660
    655661    psString query = pxDataGet("camtool_find_processedexp.sql");
     
    674680    }
    675681
     682    // order by cam_id so that the postage stamp parser can easliy find the 'latest' astrometry
     683    psStringAppend(&query, " ORDER BY cam_id");
     684
    676685    // treat limit == 0 as "no limit"
    677686    if (limit) {
     
    681690    }
    682691
    683     // order by cam_id so that the postage stamp parser can easliy find the 'latest' astrometry
    684     psStringAppend(&query, "\nORDER BY cam_id");
    685 
    686692    if (!p_psDBRunQuery(config->dbh, query)) {
    687693        psError(PS_ERR_UNKNOWN, false, "database error");
     
    720726
    721727    psMetadata *where = psMetadataAlloc();
    722     PXOPT_COPY_S64(config->args, where, "-cam_id", "camRun.cam_id", "==");
    723728    pxcamGetSearchArgs (config, where);
    724     PXOPT_COPY_STR(config->args, where, "-label", "camRun.label", "==");
    725     PXOPT_COPY_S16(config->args, where, "-code", "camProcessedExp.fault", "==");
     729    PXOPT_COPY_S64(config->args, where, "-cam_id",    "camRun.cam_id",         "==");
     730    PXOPT_COPY_STR(config->args, where, "-label",     "camRun.label",          "==");
     731    PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction",      "==");
     732    PXOPT_COPY_S16(config->args, where, "-code",      "camProcessedExp.fault", "==");
    726733
    727734    if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) {
Note: See TracChangeset for help on using the changeset viewer.