IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 11, 2008, 1:58:53 PM (18 years ago)
Author:
Paul Price
Message:

Adding additional selections to stacktool -queue.

File:
1 edited

Legend:

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

    r16826 r16940  
    9999    PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false);
    100100
    101     psMetadata *where = psMetadataAlloc();
    102     // map -inst -> camera
    103     PXOPT_COPY_STR(config->args, where, "-select_inst", "camera", "==");
    104     PXOPT_COPY_STR(config->args, where, "-select_telescope", "telescope", "==");
    105     PXOPT_COPY_STR(config->args, where, "-select_filter", "filter", "==");
    106     PXOPT_COPY_STR(config->args, where, "-select_uri", "uri", "==");
    107     PXOPT_COPY_TIME(config->args, where, "-select_dateobs_begin", "dateobs", ">=");
    108     PXOPT_COPY_TIME(config->args, where, "-select_dateobs_end", "dateobs", "<");
    109     PXOPT_COPY_F32(config->args, where, "-select_airmass_min", "airmass", ">=");
    110     PXOPT_COPY_F32(config->args, where, "-select_airmass_max", "airmass", "<=");
    111     PXOPT_COPY_F32(config->args, where, "-select_sat_pixel_frac_max", "sat_pixel_frac", "<=");
    112     PXOPT_COPY_F32(config->args, where, "-select_exp_time_min", "exp_time", ">=");
    113     PXOPT_COPY_F32(config->args, where, "-select_exp_time_max", "exp_time", "<=");
    114     PXOPT_COPY_F32(config->args, where, "-select_ccd_temp_min", "ccd_temp", ">=");
    115     PXOPT_COPY_F32(config->args, where, "-select_ccd_temp_max", "ccd_temp", "<=");
    116     PXOPT_COPY_F32(config->args, where, "-select_posang_min", "posang", ">=");
    117     PXOPT_COPY_F32(config->args, where, "-select_posang_max", "posang", "<=");
    118     PXOPT_COPY_F32(config->args, where, "-select_solang_min", "solang", ">=");
    119     PXOPT_COPY_F32(config->args, where, "-select_solang_max", "solang", "<=");
    120 
    121     if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) {
    122         psFree(where);
     101    psMetadata *whereRE = psMetadataAlloc(); // rawExp where
     102    psMetadata *whereWSF = psMetadataAlloc(); // warpSkyfile where
     103    // map -inst -> camera, etc
     104    PXOPT_COPY_STR(config->args, whereRE, "-select_inst", "camera", "==");
     105    PXOPT_COPY_STR(config->args, whereRE, "-select_telescope", "telescope", "==");
     106    PXOPT_COPY_STR(config->args, whereRE, "-select_filter", "filter", "==");
     107    PXOPT_COPY_STR(config->args, whereRE, "-select_uri", "uri", "==");
     108    PXOPT_COPY_TIME(config->args, whereRE, "-select_dateobs_begin", "dateobs", ">=");
     109    PXOPT_COPY_TIME(config->args, whereRE, "-select_dateobs_end", "dateobs", "<");
     110    PXOPT_COPY_F32(config->args, whereRE, "-select_airmass_min", "airmass", ">=");
     111    PXOPT_COPY_F32(config->args, whereRE, "-select_airmass_max", "airmass", "<=");
     112    PXOPT_COPY_F32(config->args, whereRE, "-select_sat_pixel_frac_max", "sat_pixel_frac", "<=");
     113    PXOPT_COPY_F32(config->args, whereRE, "-select_exp_time_min", "exp_time", ">=");
     114    PXOPT_COPY_F32(config->args, whereRE, "-select_exp_time_max", "exp_time", "<=");
     115    PXOPT_COPY_F32(config->args, whereRE, "-select_ccd_temp_min", "ccd_temp", ">=");
     116    PXOPT_COPY_F32(config->args, whereRE, "-select_ccd_temp_max", "ccd_temp", "<=");
     117    PXOPT_COPY_F32(config->args, whereRE, "-select_posang_min", "posang", ">=");
     118    PXOPT_COPY_F32(config->args, whereRE, "-select_posang_max", "posang", "<=");
     119    PXOPT_COPY_F32(config->args, whereRE, "-select_solang_min", "solang", ">=");
     120    PXOPT_COPY_F32(config->args, whereRE, "-select_solang_max", "solang", "<=");
     121    PXOPT_COPY_STR(config->args, whereWSF, "-select_skycell_id", "skycell_id", "==");
     122
     123    if (!psListLength(whereRE->list) && !psListLength(whereWSF->list) &&
     124        !psMetadataLookupBool(NULL, config->args, "-all")) {
     125        psFree(whereRE);
     126        psFree(whereWSF);
    123127        psError(PXTOOLS_ERR_DATA, false, "search parameters are required");
    124128        return false;
     
    128132    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    129133    PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false);
    130     PXOPT_COPY_STR(config->args, where, "-select_exp_type", "exp_type", "==");
     134    PXOPT_COPY_STR(config->args, whereRE, "-select_exp_type", "exp_type", "==");
     135    PXOPT_COPY_F32(config->args, whereWSF, "-select_good_frac_min", "good_frac", ">=");
    131136
    132137    psString query = pxDataGet("stacktool_find_complete_warps.sql");
     
    136141    }
    137142
    138     if (where) {
    139         psString whereClause = psDBGenerateWhereConditionSQL(where, "rawExp");
     143    if (whereRE) {
     144        psString whereClause = psDBGenerateWhereConditionSQL(whereRE, "rawExp");
    140145        psStringAppend(&query, " AND %s", whereClause);
    141146        psFree(whereClause);
    142147    }
     148    psFree(whereRE);
     149
     150    if (whereWSF) {
     151        psString whereClause = psDBGenerateWhereConditionSQL(whereWSF, "warpSkyfile");
     152        psStringAppend(&query, " AND %s", whereClause);
     153        psFree(whereClause);
     154    }
     155    psFree(whereWSF);
    143156
    144157    if (!p_psDBRunQuery(config->dbh, query)) {
Note: See TracChangeset for help on using the changeset viewer.