IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 12, 2010, 2:07:51 PM (16 years ago)
Author:
bills
Message:

Make update processing compatible with magic. Fix some bugs in update for the warp stage
Make script changes to implement update for diff stage.
Change value of 'magicked' in the various runs and files to contain the value
the magic_id of the magicRun that corresponds to the streaks file used for desreaking.

File:
1 edited

Legend:

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

    r26381 r26567  
    5555static bool topurgedskyfileMode(pxConfig *config);
    5656static bool toscrubbedskyfileMode(pxConfig *config);
     57static bool tofullskyfileMode(pxConfig *config);
    5758
    5859
     
    9495        MODECASE(DIFFTOOL_MODE_EXPORTRUN,             exportrunMode);
    9596        MODECASE(DIFFTOOL_MODE_IMPORTRUN,             importrunMode);
    96         MODECASE(DIFFTOOL_MODE_TOCLEANEDSKYFILE,   tocleanedskyfileMode);
    97         MODECASE(DIFFTOOL_MODE_TOPURGEDSKYFILE,    topurgedskyfileMode);
    98         MODECASE(DIFFTOOL_MODE_TOSCRUBBEDSKYFILE,  toscrubbedskyfileMode);
     97        MODECASE(DIFFTOOL_MODE_TOCLEANEDSKYFILE,      tocleanedskyfileMode);
     98        MODECASE(DIFFTOOL_MODE_TOPURGEDSKYFILE,       topurgedskyfileMode);
     99        MODECASE(DIFFTOOL_MODE_TOSCRUBBEDSKYFILE,     toscrubbedskyfileMode);
     100        MODECASE(DIFFTOOL_MODE_TOFULLSKYFILE,         tofullskyfileMode);
    99101
    100102        default:
     
    20362038  PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false);
    20372039
     2040
     2041  psS64 magicked = 0;
     2042  if (!strcmp(data_state, "full")) {
     2043      PXOPT_LOOKUP_S64(set_magicked, config->args, "-magicked", 0, false);
     2044      magicked = set_magicked;
     2045  }
     2046
    20382047  psString query = pxDataGet("difftool_change_skyfile_data_state.sql");
    20392048
     
    20432052  }
    20442053
     2054  psString set_magicked_skyfile = psStringCopy("");
     2055  psString set_magicked_run = psStringCopy("");
     2056  if (magicked != 0 && !strcmp(data_state, "full")) {
     2057    psStringAppend(&set_magicked_skyfile,  "\n , diffSkyfile.magicked = %" PRId64, magicked);
     2058    psStringAppend(&set_magicked_run,      "\n , diffRun.magicked = %" PRId64, magicked);
     2059
     2060  } else if (!strcmp(data_state, "cleaned") || !strcmp(data_state, "purged")) {
     2061    psStringAppend(&set_magicked_skyfile, "\n, diffSkyfile.magicked = IF(diffSkyfile.magicked = 0, 0, -1)");
     2062    psStringAppend(&set_magicked_run, "\n, diffRun.magicked = IF(diffRun.magicked = 0, 0, -1)");
     2063  }
     2064
    20452065  // Uses the unconstrained (diffRun.state [NEED NOT EQUAL] run_state) version from warptool.c
    20462066
    2047   if (!p_psDBRunQueryF(config->dbh, query, data_state, diff_id, skycell_id)) {
     2067  if (!p_psDBRunQueryF(config->dbh, query, data_state, set_magicked_skyfile, diff_id, skycell_id)) {
    20482068    psError(PS_ERR_UNKNOWN, false, "database error");
    20492069    // rollback
     
    20522072    }
    20532073    psError(PS_ERR_UNKNOWN, false, "database error");
     2074    psFree(set_magicked_skyfile);
    20542075    return(false);
    20552076  }
     2077  psFree(set_magicked_skyfile);
    20562078  psFree(query);
    20572079
    20582080  query = pxDataGet("difftool_change_run_state.sql");
    2059   if (!p_psDBRunQueryF(config->dbh, query, data_state, diff_id, data_state)) {
     2081  if (!p_psDBRunQueryF(config->dbh, query, data_state, set_magicked_run, diff_id, data_state)) {
    20602082    // rollback
    20612083    if (!psDBRollback(config->dbh)) {
     
    20632085    }
    20642086    psError(PS_ERR_UNKNOWN, false, "database error");
     2087    psFree(set_magicked_run);
    20652088    return(false);
    20662089  }
     
    20682091  if (!psDBCommit(config->dbh)) {
    20692092    psError(PS_ERR_UNKNOWN, false, "database error");
     2093    psFree(set_magicked_run);
    20702094    return(false);
    20712095  }
     2096  psFree(set_magicked_run);
    20722097
    20732098  return(true);
     
    20822107static bool toscrubbedskyfileMode(pxConfig *config) {
    20832108  return change_skyfile_data_state(config, "scrubbed", "goto_scrubbed");
     2109}
     2110static bool tofullskyfileMode(pxConfig *config) {
     2111  return change_skyfile_data_state(config, "full", "update");
    20842112}
    20852113
Note: See TracChangeset for help on using the changeset viewer.