IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 10, 2010, 3:52:15 PM (16 years ago)
Author:
eugene
Message:

various updates from trunk (mostly magic state handling, dqstats)

Location:
branches/eam_branches/20091201/ippTools/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/ippTools/src

    • Property svn:ignore
      •  

        old new  
        1616difftool
        1717disttool
         18dqstatstool
        1819faketool
        1920flatcorr
         
        3637stamp-h1
        3738warptool
         39
  • branches/eam_branches/20091201/ippTools/src/warptool.c

    r25935 r26857  
    11931193    PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "rawExp.dateobs",  ">=");
    11941194    PXOPT_COPY_TIME(config->args, where, "-dateobs_end",   "rawExp.dateobs",  "<=");
    1195     PXOPT_COPY_STR(config->args, where, "-filter",    "rawExp.filter", "==");
     1195    PXOPT_COPY_STR(config->args, where, "-filter",    "rawExp.filter", "LIKE");
    11961196    PXOPT_COPY_S64(config->args, where, "-magicked", "warpSkyfile.magicked", "==");
    11971197    pxAddLabelSearchArgs (config, where, "-label",   "warpRun.label", "LIKE");
     1198    pxAddLabelSearchArgs (config, where, "-data_group",   "warpRun.data_group", "LIKE");
    11981199
    11991200    PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
     
    16461647    }
    16471648
    1648     // note only updates if warpRun.state = run_state
    1649     // XXX note that we have removed this constraint for now
    1650     if (!p_psDBRunQueryF(config->dbh, query, data_state, warp_id, skycell_id)) {
     1649    char *set_magicked_skyfile = "";
     1650    char *set_magicked_run = "";
     1651    if (!strcmp(data_state, "full")) {
     1652        set_magicked_skyfile = "\n , warpSkyfile.magicked = IF((warpSkyfile.magicked < 0 AND chipRun.magicked = 0), warpSkyfile.magicked, chipRun.magicked)";
     1653        set_magicked_run = "\n,  warpRun.magicked = IF((warpRun.magicked < 0 AND chipRun.magicked = 0), warpRun.magicked, chipRun.magicked)";
     1654
     1655    } else if (!strcmp(data_state, "cleaned") || !strcmp(data_state, "purged")) {
     1656        set_magicked_skyfile = "\n, warpSkyfile.magicked = IF(warpSkyfile.magicked = 0, 0, -1)";
     1657        set_magicked_run = "\n, warpRun.magicked = IF(warpRun.magicked = 0, 0, -1)";
     1658    }
     1659
     1660    if (!p_psDBRunQueryF(config->dbh, query, data_state, set_magicked_skyfile, warp_id, skycell_id)) {
    16511661        psError(PS_ERR_UNKNOWN, false, "database error");
    16521662        // rollback
     
    16601670
    16611671    query = pxDataGet("warptool_change_run_state.sql");
    1662     if (!p_psDBRunQueryF(config->dbh, query, data_state, warp_id, data_state)) {
     1672    if (!p_psDBRunQueryF(config->dbh, query, data_state, set_magicked_run, warp_id, data_state)) {
    16631673        // rollback
    16641674        if (!psDBRollback(config->dbh)) {
Note: See TracChangeset for help on using the changeset viewer.