IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 16, 2008, 1:01:47 PM (18 years ago)
Author:
Paul Price
Message:

Fixing buggy query to get list of warps and stacks. It would return a row for every stack that exists, rather than a row for every skycell/filter combination. Completely re-crafted the query so that it returns a single row for each skycell/filter combination, with the number of warps available to be stacked and the number of warps in the biggest stack. It's a bit complicated, and I'm not entirely sure it's 100% correct, but it seems to work on the simtest (though that's only a single skycell).

File:
1 edited

Legend:

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

    r18578 r18579  
    125125    PXOPT_LOOKUP_S32(randomLimit, config->args, "-random", false, false);
    126126
    127     PXOPT_COPY_S32(config->args, having, "-min_num", "num_avail", ">=");
    128     PXOPT_COPY_S32(config->args, having, "-min_new", "(num_avail - num_extant)", ">=");
     127    PXOPT_COPY_S32(config->args, having, "-min_num", "num_warp", ">=");
     128    PXOPT_COPY_S32(config->args, having, "-min_new", "(num_warp - num_stack)", ">=");
    129129
    130130    PXOPT_LOOKUP_F32(min_frac, config->args, "-min_frac", false, false);
     
    144144    PXOPT_COPY_F32(config->args, whereWSF, "-select_good_frac_min", "good_frac", ">=");
    145145
    146     psString select = pxDataGet("stacktool_definebyquery_select.sql");
     146    psString select = pxDataGet("stacktool_definebyquery_part1.sql");
    147147    if (!select) {
    148148        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     
    164164    psFree(whereWSF);
    165165
    166     psString groupby = pxDataGet("stacktool_definebyquery_groupby.sql");
     166    psString groupby = pxDataGet("stacktool_definebyquery_part2.sql");
    167167    if (!groupby) {
    168168        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     
    185185            psStringAppend(&select, " HAVING");
    186186        }
    187         psStringAppend(&select, " num_avail >= %f * num_extant", (double)min_frac);
     187        psStringAppend(&select, " num_warp >= %f * num_stack", (double)min_frac);
    188188    }
    189189
Note: See TracChangeset for help on using the changeset viewer.