IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 30, 2009, 1:41:16 PM (17 years ago)
Author:
bills
Message:

for -diffskyfile mode added new arguments for selecting on exposure paramters
-filter -dateobs_begin -dateobs_end and -template to select whether those (and exp_id and exp_name)
apply to the input image (default) or the template.
Added arguments to select on whether the diffSkyfiles have been destreaked or not
and by the value of the magicked column (magic_ds_id for the corresponding magicDSRun)

File:
1 edited

Legend:

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

    r25571 r25690  
    665665    PXOPT_COPY_S64(config->args, where,  "-diff_id", "diffSkyfile.diff_id", "==");
    666666    PXOPT_COPY_STR(config->args, where, "-skycell_id", "diffInputSkyfile.skycell_id", "==");
    667     PXOPT_COPY_S64(config->args, where,  "-diff_skyfile_id", "diffInputSkyfile.diff_skyfile_id", "==");
     667    PXOPT_COPY_S64(config->args, where, "-diff_skyfile_id", "diffInputSkyfile.diff_skyfile_id", "==");
    668668    PXOPT_COPY_STR(config->args, where, "-tess_id", "diffRun.tess_id", "==");
    669669    PXOPT_COPY_S16(config->args, where, "-fault", "diffSkyfile.fault", "==");
    670     PXOPT_COPY_S64(config->args, where, "-exp_id", "rawInput.exp_id", "==");
    671     PXOPT_COPY_STR(config->args, where, "-exp_name", "rawInput.exp_name", "==");
    672     PXOPT_COPY_STR(config->args, where, "-warp_id", "warpInput.warp_id", "==");
    673 
     670    PXOPT_COPY_S64(config->args, where,  "-magicked", "diffSkyfile.magicked", "==");
     671
     672    PXOPT_LOOKUP_BOOL(template, config->args, "-template", false);
     673    if (!template) {
     674        PXOPT_COPY_S64(config->args, where, "-exp_id", "rawInput.exp_id", "==");
     675        PXOPT_COPY_STR(config->args, where, "-exp_name", "rawInput.exp_name", "==");
     676        PXOPT_COPY_STR(config->args, where, "-warp_id", "warpInput.warp_id", "==");
     677        PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "rawInput.dateobs",  ">=");
     678        PXOPT_COPY_TIME(config->args, where, "-dateobs_end",   "rawInput.dateobs",  "<=");
     679        PXOPT_COPY_STR(config->args, where, "-filter",     "rawInput.filter", "==");
     680    } else {
     681        PXOPT_COPY_S64(config->args, where, "-exp_id", "rawTemplate.exp_id", "==");
     682        PXOPT_COPY_STR(config->args, where, "-exp_name", "rawTemplate.exp_name", "==");
     683        PXOPT_COPY_STR(config->args, where, "-warp_id", "warpTemplate.warp_id", "==");
     684        PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "rawTemplate.dateobs",  ">=");
     685        PXOPT_COPY_TIME(config->args, where, "-dateobs_end",   "rawTemplate.dateobs",  "<=");
     686        PXOPT_COPY_STR(config->args, where, "-filter",     "rawTemplate.filter", "==");
     687    }
     688
     689    PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
    674690    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    675691    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     692
     693    PXOPT_LOOKUP_U64(magicked, config->args,        "-magicked", false, false);
     694    PXOPT_LOOKUP_BOOL(destreaked, config->args,     "-destreaked", false);
     695    PXOPT_LOOKUP_BOOL(not_destreaked, config->args, "-not_destreaked", false);
    676696
    677697    psString query = pxDataGet("difftool_skyfile.sql");
     
    685705        psStringAppend(&query, " WHERE %s", whereClause);
    686706        psFree(whereClause);
     707    } else if (!all) {
     708        psError(PXTOOLS_ERR_DATA, true, "search parameters or -all are required");
    687709    }
    688710    psFree(where);
     711
     712    if (not_destreaked) {
     713        if (destreaked) {
     714            psError(PXTOOLS_ERR_DATA, true, "providing -not_destreaked and -destreaked makes no sense");
     715            return false;
     716        }
     717        if (magicked) {
     718            psError(PXTOOLS_ERR_DATA, true, "providing -not_destreaked and -magicked makes no sense");
     719            return false;
     720        }
     721        psStringAppend(&query, " AND diffSkyfile.magicked = 0");
     722    }
     723    if (destreaked) {
     724        psStringAppend(&query, " AND diffSkyfile.magicked != 0");
     725    }
     726
    689727
    690728    // treat limit == 0 as "no limit"
Note: See TracChangeset for help on using the changeset viewer.