IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37974


Ignore:
Timestamp:
Mar 12, 2015, 3:57:12 PM (11 years ago)
Author:
watersc1
Message:

Yet another change to difftool -definewarpstack that is needed to fix problems in the query process. This corrects the problem requeuing a warp_id/stack_id combination that already has an entry in diffInputSkyfile. The results match what was created in the previous version, but are now not blocked when the diffRun.label is changed, and now respects the -rerun (if you really want to do something twice with the same label). This also corrects an issue where filter was ambiguous in the query, preventing that from being used.

Location:
trunk/ippTools
Files:
2 edited

Legend:

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

    r35192 r37974  
    22-- and check results against existing diffs
    33SELECT
     4   exp_id,
     5   warp_id,
     6   filter,
     7   warpLabel,
     8   warpDataGroup,
     9   Inputs.tess_id,
     10   Inputs.skycell_id,
     11   stack_id,
     12   stackLabel,
     13   stackDataGroup,
     14   diff_id,
     15   diffLabel
     16FROM
     17(
     18SELECT
    419   exp_id,
    520   warp_id,
     
    1126   MAX(stack_id) AS stack_id,
    1227   stackRun.label AS stackLabel,
    13    stackRun.data_group AS stackDataGroup,
    14    diff_id,
    15    diffRun.label AS diffLabel
     28   stackRun.data_group AS stackDataGroup
    1629FROM warpRun
    1730     JOIN fakeRun USING(fake_id)
     
    2538        stackRun.tess_id    = warpRun.tess_id)
    2639     JOIN stackSumSkyfile USING(stack_id)
    27      LEFT JOIN diffInputSkyfile ON
    28        (warp_id = diffInputSkyfile.warp1 AND
    29         stack_id = diffInputSkyfile.stack2 AND
    30         diffInputSkyfile.skycell_id = stackRun.skycell_id AND
    31         diffInputSkyfile.tess_id = stackRun.tess_id)
    32      LEFT JOIN diffRun USING(diff_id)
    3340WHERE
    3441     warpRun.state = 'full'
     
    4148-- %s
    4249GROUP BY exp_id,warp_id,skycell_id
     50) AS Inputs
     51LEFT JOIN
     52(
     53SELECT
     54diff_id,
     55diffRun.label AS diffLabel,
     56warp1,
     57stack2,
     58skycell_id,
     59diffInputSkyfile.tess_id
     60FROM
     61diffRun JOIN diffInputSkyfile USING(diff_id,tess_id)
     62WHERE
     63diff_mode = 2
     64-- %s
     65) AS Diffs ON
     66       (warp_id = warp1 AND
     67        stack_id = stack2 AND
     68        Diffs.skycell_id = Inputs.skycell_id AND
     69        Diffs.tess_id = Inputs.tess_id)
     70WHERE
     711
     72-- %s
     73
  • trunk/ippTools/src/difftool.c

    r37947 r37974  
    12351235
    12361236  PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
    1237   PXOPT_COPY_STR(config->args, where, "-filter", "filter", "==");
     1237  PXOPT_COPY_STR(config->args, where, "-filter", "rawExp.filter", "==");
    12381238  PXOPT_COPY_STR(config->args, where, "-comment", "comment", "LIKE");
    12391239  PXOPT_COPY_S64(config->args, where, "-warp_id", "warpRun.warp_id", "==");
     
    12841284
    12851285  psString whereClause = psDBGenerateWhereConditionSQL(where,NULL);
     1286  psString diffWhereClause = psStringCopy("");
     1287  psString joinWhereClause = psStringCopy("");
    12861288 
    12871289  // Don't queue things that already have diffs.
    12881290  if (! (reRun || newTemplates) ) {
    1289     psStringAppend(&whereClause, "\nAND diff_id IS NULL\n");
     1291    psStringAppend(&joinWhereClause, "\nAND diff_id IS NULL\n");
    12901292  }
    12911293  // Append diff qualifiers, if we have them
    12921294  if (label) {
    1293     psStringAppend(&whereClause, "\nAND ((diffRun.label = '%s') OR (diffRun.label IS NULL))",label);
     1295    psStringAppend(&diffWhereClause, "\nAND ((diffRun.label = '%s') OR (diffRun.label IS NULL))",label);
    12941296  }
    12951297  if (data_group) {
    1296     psStringAppend(&whereClause, "\nAND ((diffRun.data_group = '%s') OR (diffRun.data_group IS NULL))",data_group);
     1298    psStringAppend(&diffWhereClause, "\nAND ((diffRun.data_group = '%s') OR (diffRun.data_group IS NULL))",data_group);
    12971299  }
    12981300  if (reduction) {
    1299     psStringAppend(&whereClause, "\nAND ((diffRun.reduction = '%s') OR (diffRun.reduction IS NULL))",reduction);
     1301    psStringAppend(&diffWhereClause, "\nAND ((diffRun.reduction = '%s') OR (diffRun.reduction IS NULL))",reduction);
    13001302  }
    13011303
     
    13051307
    13061308  // This is just a simple query, so we don't need to do a transaction
    1307   if (!p_psDBRunQueryF(config->dbh, query, whereClauseString)) {
     1309  if (!p_psDBRunQueryF(config->dbh, query, whereClauseString, diffWhereClause,joinWhereClause)) {
    13081310    psError(PS_ERR_UNKNOWN, false, "database error");
    13091311    psFree(query);
Note: See TracChangeset for help on using the changeset viewer.