IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 12, 2013, 11:01:10 AM (13 years ago)
Author:
bills
Message:

further progress on releasetool including -listrelstack

File:
1 edited

Legend:

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

    r35358 r35397  
    975975    psMetadata *where = psMetadataAlloc();
    976976
     977    PXOPT_COPY_S64(config->args, where, "-relstack_id", "relStack.relstack_id", "==");
     978    PXOPT_COPY_S64(config->args, where, "-stack_id",    "relStack.stack_id", "==");
     979    PXOPT_COPY_S64(config->args, where, "-skycal_id",   "relStack.skycal_id", "==");
     980    PXOPT_COPY_S64(config->args, where, "-relstack_id", "relStack.relstack_id", "==");
    977981    PXOPT_COPY_STR(config->args, where, "-release_name", "ippRelease.release_name", "LIKE");
    978982    pxAddLabelSearchArgs(config, where, "-release_state","ippRelease.state", "==");
    979     PXOPT_COPY_STR(config->args, where, "-state",       "relExp.state", "==");
    980     PXOPT_COPY_STR(config->args, where, "-filter",      "rawExp.filter", "LIKE");
    981     PXOPT_COPY_TIME(config->args, where, "-dateobs_begin","rawExp.dateobs", ">=");
    982     PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "rawExp.dateobs", "<=");
    983     PXOPT_COPY_F32(config->args, where, "-fwhm_min",    "skycalResult.fwhm_major", ">=");
     983    PXOPT_COPY_STR(config->args, where, "-state",       "relStack.state", "==");
     984    PXOPT_COPY_STR(config->args, where, "-filter",      "relStack.filter", "LIKE");
     985    PXOPT_COPY_F32(config->args, where, "-mjd_min",    "stackSumSkyfile.mjd_obs", ">=");
     986    PXOPT_COPY_F32(config->args, where, "-mjd_max",    "stackSumSkyfile.mjd_obs", "<=");
     987    PXOPT_COPY_F32(config->args, where, "-fwhm_min",    "skycalResult.fwhm_minor", ">=");
    984988    PXOPT_COPY_F32(config->args, where, "-fwhm_max",    "skycalresult.fwhm_major", "<=");
    985     PXOPT_COPY_STR(config->args, where, "-exp_name",    "rawExp.exp_ame", "==");
    986     PXOPT_COPY_S64(config->args, where, "-exp_id",      "relExp.exp_id", "==");
    987     PXOPT_COPY_S64(config->args, where, "-chip_id",     "relExp.chip_id", "==");
    988     PXOPT_COPY_S64(config->args, where, "-cam_id",      "relExp.cam_id", "==");
    989     PXOPT_COPY_S64(config->args, where, "-warp_id",     "warpRun.warp_id", "==");
    990     PXOPT_COPY_STR(config->args, where, "-chip_data_group", "chipRun.data_group", "LIKE");
    991     PXOPT_COPY_STR(config->args, where, "-cam_data_group",  "camRun.data_group", "LIKE");
    992     PXOPT_COPY_STR(config->args, where, "-warp_data_group", "warpRun.data_group", "LIKE");
     989    PXOPT_COPY_STR(config->args, where, "-tess_id",     "relStack.tess_id", "==");
     990    PXOPT_COPY_STR(config->args, where, "-skycell_id",  "relStack.skycell_id", "LIKE");
     991    PXOPT_COPY_STR(config->args, where, "-stack_data_group",  "stackRun.data_group", "LIKE");
     992    PXOPT_COPY_STR(config->args, where, "-skycal_data_group", "skycalRun.data_group", "LIKE");
    993993
    994994    PXOPT_COPY_STR(config->args, where, "-surveyName",  "survey.surveyName", "LIKE");
    995995    PXOPT_COPY_S32(config->args, where, "-rel_id",      "relExp.rel_id", "==");
     996    pxskycellAddWhere(config, where);
    996997
    997998    PXOPT_LOOKUP_BOOL(priority_order, config->args, "-priority_order", false);
     
    10001001    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    10011002
    1002     psString query = pxDataGet("releasetool_listrelexp.sql");
     1003    psString query = pxDataGet("releasetool_listrelstack.sql");
    10031004    if (!query) {
    10041005        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    1005         return false;
    1006     }
    1007 
    1008     psString where2 = NULL;
    1009     if (!pxspaceAddWhere(config, &where2, "rawExp")) {
    1010         psError(psErrorCodeLast(), false, "pxspaceAddWhere failed");
    10111006        return false;
    10121007    }
     
    10161011        psStringAppend(&query, "\nWHERE %s", whereClause);
    10171012        psFree(whereClause);
    1018     } else if (where2) {
    1019         psStringAppend(&query, "\nWHERE ");
    10201013    } else {
    10211014        psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required\n");
     
    10241017    }
    10251018
    1026     if (where2) {
    1027         psStringAppend(&query, "\n%s", where2);
    1028         psFree(where2);
    1029     }
    1030 
    10311019    if (priority_order) {
    1032         psStringAppend(&query, "\nAND priority > 0 order by exp_id, priority");
     1020        psStringAppend(&query, "\nAND priority > 0 order by stack_id, priority");
    10331021    }
    10341022
     
    10581046    }
    10591047
    1060     if (!ippdbPrintMetadatas(stdout, output, "relExp", !simple)) {
     1048    if (!ippdbPrintMetadatas(stdout, output, "relStack", !simple)) {
    10611049        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    10621050        psFree(output);
Note: See TracChangeset for help on using the changeset viewer.