IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 30, 2009, 2:52:04 PM (17 years ago)
Author:
Paul Price
Message:

Fixing warptool -definebyquery search terms.

File:
1 edited

Legend:

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

    r23459 r23613  
    3030#include "pxtools.h"
    3131#include "warptool.h"
    32 #include "pxwarp.h"
    3332
    3433static psS64 definerunMode(pxConfig *config);
     
    191190
    192191    psMetadata *where = psMetadataAlloc();
    193     pxwarpGetSearchArgs (config, where);
     192    PXOPT_COPY_S64(config->args, where, "-fake_id",            "fakeRun.fake_id",       "==");
     193    PXOPT_COPY_S64(config->args, where, "-cam_id",             "camRun.cam_id",         "==");
     194    PXOPT_COPY_S64(config->args, where, "-chip_id",            "chipRun.chip_id",       "==");
     195    PXOPT_COPY_S64(config->args, where, "-exp_id",             "rawExp.exp_id",         "==");
     196    PXOPT_COPY_STR(config->args, where, "-exp_name",           "rawExp.exp_name",       "==");
     197    PXOPT_COPY_STR(config->args, where, "-inst",               "rawExp.camera",         "==");
     198    PXOPT_COPY_STR(config->args, where, "-telescope",          "rawExp.telescope",      "==");
     199    PXOPT_COPY_TIME(config->args, where, "-dateobs_begin",     "rawExp.dateobs",        ">=");
     200    PXOPT_COPY_TIME(config->args, where, "-dateobs_end",       "rawExp.dateobs",        "<=");
     201    PXOPT_COPY_STR(config->args, where, "-exp_tag",            "rawExp.exp_tag",        "==");
     202    PXOPT_COPY_STR(config->args, where, "-exp_type",           "rawExp.exp_type",       "==");
     203    PXOPT_COPY_STR(config->args, where, "-filelevel",          "rawExp.filelevel",      "==");
     204    PXOPT_COPY_STR(config->args, where, "-filter",             "rawExp.filter",         "==");
     205    PXOPT_COPY_F64(config->args, where, "-airmass_min",        "rawExp.airmass",        ">=");
     206    PXOPT_COPY_F64(config->args, where, "-airmass_max",        "rawExp.airmass",        "<");
     207    PXOPT_COPY_F64(config->args, where, "-ra_min",             "rawExp.ra",             ">=");
     208    PXOPT_COPY_F64(config->args, where, "-ra_max",             "rawExp.ra",             "<");
     209    PXOPT_COPY_F64(config->args, where, "-decl_min",           "rawExp.decl",           ">=");
     210    PXOPT_COPY_F64(config->args, where, "-decl_max",           "rawExp.decl",           "<");
     211    PXOPT_COPY_F32(config->args, where, "-exp_time_min",       "rawExp.exp_time",       ">=");
     212    PXOPT_COPY_F32(config->args, where, "-exp_time_max",       "rawExp.exp_time",       "<");
     213    PXOPT_COPY_F32(config->args, where, "-sat_pixel_frac_min", "rawExp.sat_pixel_frac", ">=");
     214    PXOPT_COPY_F32(config->args, where, "-sat_pixel_frac_max", "rawExp.sat_pixel_frac", "<");
     215    PXOPT_COPY_F64(config->args, where, "-bg_min",             "rawExp.bg",             ">=");
     216    PXOPT_COPY_F64(config->args, where, "-bg_max",             "rawExp.bg",             "<");
     217    PXOPT_COPY_F64(config->args, where, "-bg_stdev_min",       "rawExp.bg_stdev",       ">=");
     218    PXOPT_COPY_F64(config->args, where, "-bg_stdev_max",       "rawExp.bg_stdev",       "<");
     219    PXOPT_COPY_F64(config->args, where, "-bg_mean_stdev_min",  "rawExp.bg_mean_stdev",  ">=");
     220    PXOPT_COPY_F64(config->args, where, "-bg_mean_stdev_max",  "rawExp.bg_mean_stdev",  "<");
     221    PXOPT_COPY_F64(config->args, where, "-alt_min",            "rawExp.alt",            ">=");
     222    PXOPT_COPY_F64(config->args, where, "-alt_max",            "rawExp.alt",            "<");
     223    PXOPT_COPY_F64(config->args, where, "-az_min",             "rawExp.az",             ">=");
     224    PXOPT_COPY_F64(config->args, where, "-az_max",             "rawExp.az",             "<");
     225    PXOPT_COPY_F32(config->args, where, "-ccd_temp_min",       "rawExp.ccd_temp",       ">=");
     226    PXOPT_COPY_F32(config->args, where, "-ccd_temp_max",       "rawExp.ccd_temp",       "<");
     227    PXOPT_COPY_F64(config->args, where, "-posang_min",         "rawExp.posang",         ">=");
     228    PXOPT_COPY_F64(config->args, where, "-posang_max",         "rawExp.posang",         "<");
     229    PXOPT_COPY_STR(config->args, where, "-object",             "rawExp.object",         "==");
     230    PXOPT_COPY_F32(config->args, where, "-solang_min",         "rawExp.solang",         ">=");
     231    PXOPT_COPY_F32(config->args, where, "-solang_max",         "rawExp.solang",         "<");
    194232    PXOPT_COPY_STR(config->args, where, "-reduction", "fakeRun.reduction", "==");
    195233    PXOPT_COPY_STR(config->args, where, "-label",     "fakeRun.label",     "==");
     
    227265
    228266    // use psDBGenerateWhereSQL because the SQL yields an intermediate table
    229     if (where && psListLength(where->list)) {
    230         psString whereClause = psDBGenerateWhereSQL(where, NULL);
    231         psStringAppend(&query, "%s", whereClause);
     267    if (psListLength(where->list)) {
     268        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     269        psStringAppend(&query, "AND %s", whereClause);
    232270        psFree(whereClause);
    233271    }
     
    299337
    300338    psMetadata *where = psMetadataAlloc();
    301     pxwarpGetSearchArgs (config, where);
    302339    PXOPT_COPY_S64(config->args, where, "-warp_id",   "warpRun.warp_id",   "==");
    303340    PXOPT_COPY_STR(config->args, where, "-reduction", "warpRun.reduction", "==");
    304     PXOPT_COPY_STR(config->args, where, "-label",     "warpRun.label",     "==");
    305     PXOPT_COPY_STR(config->args, where, "-state",     "warpRun.state",     "==");
     341    PXOPT_COPY_STR(config->args, where, "-label",     "warpRun.label",     "==");
     342    PXOPT_COPY_STR(config->args, where, "-state",     "warpRun.state",     "==");
    306343
    307344    if (!psListLength(where->list)
     
    10701107
    10711108    psMetadata *where = psMetadataAlloc();
    1072     pxwarpGetSearchArgs (config, where);
    10731109    PXOPT_COPY_S64(config->args, where, "-warp_id",    "warpSkyfile.warp_id", "==");
    10741110    PXOPT_COPY_STR(config->args, where, "-skycell_id", "warpSkyfile.skycell_id", "==");
     
    16271663
    16281664  int numImportTables = 3;
    1629  
     1665
    16301666  char tables[3] [80] = {"warpImfile", "warpSkyfile", "warpSkyCellMap"};
    16311667
    16321668  PS_ASSERT_PTR_NON_NULL(config, NULL);
    1633  
     1669
    16341670  PXOPT_LOOKUP_STR(infile, config->args, "-infile", true,  false);
    16351671
     
    16421678  psAssert (item, "entry not in input?");
    16431679  psAssert (item->type == PS_DATA_METADATA_MULTI, "entry not multi?");
    1644  
     1680
    16451681  psMetadataItem *entry = psListGet (item->data.list, 0);
    16461682  assert (entry);
     
    16561692    psAssert (item, "entry not in input?");
    16571693    psAssert (item->type == PS_DATA_METADATA_MULTI, "entry not multi?");
    1658    
     1694
    16591695    switch (i) {
    1660       case 0: 
     1696      case 0:
    16611697        for (int i = 0; i < item->data.list->n; i++) {
    16621698          entry = psListGet (item->data.list, i);
     
    16701706        }
    16711707        break;
    1672        
    1673       case 1: 
     1708
     1709      case 1:
    16741710        for (int i = 0; i < item->data.list->n; i++) {
    16751711          entry = psListGet (item->data.list, i);
     
    16831719        }
    16841720        break;
    1685        
    1686       case 2: 
     1721
     1722      case 2:
    16871723        for (int i = 0; i < item->data.list->n; i++) {
    16881724          entry = psListGet (item->data.list, i);
Note: See TracChangeset for help on using the changeset viewer.