IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 27, 2011, 2:03:15 PM (15 years ago)
Author:
bills
Message:

Add the ability to set quality in warptool -updateskyfile

File:
1 edited

Legend:

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

    r30729 r31719  
    20942094
    20952095    // warp_id, skycell_id, fault are required
    2096     PXOPT_LOOKUP_S64(warp_id, config->args, "-warp_id", true, false);
    2097     PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false);
    2098     PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
    20992096    PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false);
    21002097
    21012098    if (!state) {
    2102       psString query = pxDataGet("warptool_updateskyfile.sql");
    2103 
    2104       if (!p_psDBRunQueryF(config->dbh, query, fault, warp_id, skycell_id)) {
    2105         psError(PS_ERR_UNKNOWN, false, "database error");
     2099      psMetadata *where = psMetadataAlloc();
     2100      PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "==");
     2101      PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "==");
     2102      if (psListLength(where->list) == 0) {
     2103        // this won't happen because warptoolConfig requires these arguments
     2104        psError(PS_ERR_UNKNOWN, true, "search parameters are required");
     2105        psFree(where);
    21062106        return false;
    21072107      }
    2108       psFree(query);
     2108 
     2109      PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false);
     2110      PXOPT_LOOKUP_S16(quality, config->args, "-set_quality", false, false);
     2111
     2112      if (!pxSetFaultCode(config->dbh, "warpSkyfile", where, fault, quality)) {
     2113        psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
     2114        psFree(where);
     2115        return false;
     2116      }
     2117      psFree(where);
    21092118    }
    21102119    else {
Note: See TracChangeset for help on using the changeset viewer.