IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33384 for trunk/ippTools


Ignore:
Timestamp:
Feb 29, 2012, 7:39:44 AM (14 years ago)
Author:
bills
Message:

Fix bug in staticskytool -result. It was listing the filter in the
output which causes num_filters entries when a staticskyRun has
multiple filters. Change the sql to group by sky_id and list num_filters
instead. Also allow selection by tess_id and skycell_id

Location:
trunk/ippTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/staticskytool_result.sql

    r28959 r33384  
    1 SELECT DISTINCT
     1SELECT
    22    staticskyResult.*,
    33    staticskyRun.state,
     
    66    stackRun.tess_id,
    77    stackRun.skycell_id,
    8     stackRun.filter
     8    count(stackRun.filter) AS num_filters
    99FROM staticskyRun
    1010JOIN staticskyResult USING(sky_id)
  • trunk/ippTools/src/staticskytool.c

    r33043 r33384  
    635635    PXOPT_COPY_STR(config->args, where, "-label",      "staticskyRun.label", "==");
    636636    PXOPT_COPY_STR(config->args, where, "-data_group", "staticskyRun.data_group", "LIKE");
     637    PXOPT_COPY_STR(config->args, where, "-tess_id", "stackRun.tess_id", "LIKE");
     638    PXOPT_COPY_STR(config->args, where, "-skycell_id", "stackRun.skycell_id", "LIKE");
    637639    PXOPT_COPY_S16(config->args, where, "-fault",      "staticskyResult.fault", "==");
    638640
     
    659661    psFree(where);
    660662
     663    psStringAppend(&query, "\nGROUP BY sky_id");
     664
    661665    // treat limit == 0 as "no limit"
    662666    if (limit) {
    663667        psString limitString = psDBGenerateLimitSQL(limit);
    664         psStringAppend(&query, " %s", limitString);
     668        psStringAppend(&query, "\n%s", limitString);
    665669        psFree(limitString);
    666670    }
  • trunk/ippTools/src/staticskytoolConfig.c

    r32962 r33384  
    108108    psMetadata *resultArgs= psMetadataAlloc();
    109109    psMetadataAddS64(resultArgs, PS_LIST_TAIL, "-sky_id", 0, "search by staticsky ID", 0);
    110     // psMetadataAddStr(resultArgs, PS_LIST_TAIL, "-tess_id", 0, "search by tess ID", 0);
    111     // psMetadataAddStr(resultArgs, PS_LIST_TAIL, "-skycell_id", 0, "search by skycell ID", 0);
     110    psMetadataAddStr(resultArgs, PS_LIST_TAIL, "-tess_id", 0, "search by tess ID (LIKE comparison)", 0);
     111    psMetadataAddStr(resultArgs, PS_LIST_TAIL, "-skycell_id", 0, "search by skycell ID (LIKE comparison)", 0);
    112112    psMetadataAddStr(resultArgs, PS_LIST_TAIL, "-label", 0, "search by label", NULL);
    113113    psMetadataAddStr(resultArgs, PS_LIST_TAIL, "-data_group", 0, "search by data_group (LIKE comparison)", NULL);
Note: See TracChangeset for help on using the changeset viewer.