IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 25, 2012, 11:17:45 AM (14 years ago)
Author:
bills
Message:

various enhancements to staticskytool mostly to allow selection by
ra/dec and galactic coordinates

File:
1 edited

Legend:

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

    r33385 r33919  
    2929
    3030#include "pxtools.h"
     31#include "pxspace.h"
    3132#include "staticskytool.h"
    3233
     
    131132    pxAddLabelSearchArgs(config, whereMD, "-select_data_group",    "stackRun.data_group",       "LIKE");
    132133    pxAddLabelSearchArgs(config, whereMD, "-select_filter",        "stackRun.filter",           "LIKE");
     134    PXOPT_COPY_F32(config->args, whereMD, "-select_glat_min",      "skycell.glat",              ">=");
     135    PXOPT_COPY_F32(config->args, whereMD, "-select_glat_max",      "skycell.glat",              "<=");
    133136
    134137    // find the number of requested filters:
     
    390393
    391394    psMetadata *where = psMetadataAlloc();
    392     PXOPT_COPY_S64(config->args, where, "-sky_id",  "sky_id",   "==");
    393     PXOPT_COPY_STR(config->args, where, "-label",   "label",    "==");
    394     PXOPT_COPY_STR(config->args, where, "-state",   "state",    "==");
     395    PXOPT_COPY_S64(config->args, where, "-sky_id",      "sky_id",   "==");
     396    PXOPT_COPY_STR(config->args, where, "-label",       "staticskyRun.label",    "==");
     397    PXOPT_COPY_STR(config->args, where, "-state",       "staticskyRun.state",    "==");
     398    PXOPT_COPY_STR(config->args, where, "-tess_id",     "stackRun.tess_id",    "==");
     399    PXOPT_COPY_STR(config->args, where, "-skycell_id",  "stackRun.skycell_id",    "==");
     400    if (!pxskycellAddWhere(config, where)) {
     401        psError(PXTOOLS_ERR_CONFIG, false, "failed to add skycell search arguments");
     402        return false;
     403    }
    395404    if (!psListLength(where->list)) {
    396405        psFree(where);
     
    399408    }
    400409
    401     psString query = psStringCopy("UPDATE staticskyRun");
     410    psString query = psStringCopy("UPDATE staticskyRun JOIN staticskyInput USING(sky_id) JOIN stackRun using(stack_id) JOIN skycell USING(tess_id, skycell_id)");
    402411
    403412    // pxUpdateRun gets parameters from config->args and updates
     
    638647    PXOPT_COPY_STR(config->args, where, "-skycell_id", "stackRun.skycell_id", "LIKE");
    639648    PXOPT_COPY_S16(config->args, where, "-fault",      "staticskyResult.fault", "==");
     649    pxskycellAddWhere(config, where);
    640650    PXOPT_LOOKUP_S32(num_filters, config->args, "-num_filters", false, false);
    641651
Note: See TracChangeset for help on using the changeset viewer.