IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25789


Ignore:
Timestamp:
Oct 6, 2009, 3:48:25 PM (17 years ago)
Author:
eugene
Message:

fixed up addtool

Location:
trunk/ippTools
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/Makefile.am

    r25711 r25789  
    44
    55dist_pkgdata_DATA = \
     6     addtool_donecleanup.sql \
     7     addtool_find_cam_id.sql \
    68     addtool_find_pendingexp.sql \
     9     addtool_find_processedexp.sql \
     10     addtool_pendingcleanupexp.sql \
     11     addtool_pendingcleanuprun.sql \
    712     addtool_queue_cam_id.sql \
    813     addtool_reset_faulted_runs.sql \
  • trunk/ippTools/share/addtool_find_pendingexp.sql

    r25299 r25789  
    1212JOIN chipRun
    1313    USING(chip_id)
    14 JOIN chipProcessedImfile
    15     USING(chip_id)
    1614JOIN rawExp
    17     ON chipRun.exp_id = rawExp.exp_id
     15    USING(exp_id)
    1816LEFT JOIN addProcessedExp
    1917    USING(add_id)
  • trunk/ippTools/src/addtool.c

    r25299 r25789  
    106106
    107107    psMetadata *where = psMetadataAlloc();
    108     pxaddGetSearchArgs (config, where);
    109     pxAddLabelSearchArgs (config, where, "-label", "addRun.label", "==");
    110     PXOPT_COPY_STR(config->args, where, "-reduction", "addRun.reduction", "==");
     108    pxcamGetSearchArgs (config, where);
     109    PXOPT_COPY_S64(config->args, where,  "-cam_id",    "camRun.cam_id", "==");
     110    pxAddLabelSearchArgs (config, where, "-label",     "camRun.label", "==");
     111    PXOPT_COPY_STR(config->args, where,  "-reduction", "camRun.reduction", "==");
    111112
    112113    if (!psListLength(where->list) &&
     
    121122    PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false);
    122123    PXOPT_LOOKUP_STR(dvodb, config->args, "-set_dvodb", false, false);
     124    PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false);
     125    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    123126
    124127    // find the cam_id of all the exposures that we want to queue up.
     
    130133    }
    131134
    132     // use psDBGenerateWhereSQL because the SQL yields an intermediate table
     135    // use psDBGenerateWhereConditionSQL because the SQL ends in a WHERE
    133136    if (where && psListLength(where->list)) {
    134137        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     
    136139        psFree(whereClause);
    137140    }
    138 
    139141    psFree(where);
    140142
     
    153155    if (!psArrayLength(output)) {
    154156        psTrace("addtool", PS_LOG_INFO, "no rows found");
     157        psFree(output);
     158        return true;
     159    }
     160
     161    if (pretend) {
     162        // negative simple so the default is true
     163        if (!ippdbPrintMetadatas(stdout, output, "addRun", !simple)) {
     164            psError(PS_ERR_UNKNOWN, false, "failed to print array");
     165            psFree(output);
     166            return false;
     167        }
    155168        psFree(output);
    156169        return true;
     
    175188        psMetadata *md = output->data[i];
    176189
    177         addRunRow *row = addRunObjectFromMetadata(md);
     190        camRunRow *row = camRunObjectFromMetadata(md);
    178191        if (!row) {
    179192            psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into addRun");
     
    218231
    219232    psMetadata *where = psMetadataAlloc();
    220     pxaddGetSearchArgs (config, where);
    221233    PXOPT_COPY_S64(config->args, where, "-add_id",    "addRun.add_id", "==");
     234    PXOPT_COPY_S64(config->args, where, "-cam_id",    "camRun.cam_id", "==");
     235    pxcamGetSearchArgs (config, where); // most search arguments based on camera
     236
    222237    PXOPT_COPY_STR(config->args, where, "-label",     "addRun.label", "==");
    223238    PXOPT_COPY_STR(config->args, where, "-state",     "addRun.state", "==");
     
    267282
    268283    psMetadata *where = psMetadataAlloc();
    269     pxaddGetSearchArgs (config, where);
    270284    PXOPT_COPY_S64(config->args, where, "-add_id",    "addRun.add_id", "==");
     285    PXOPT_COPY_S64(config->args, where, "-cam_id",    "camRun.cam_id", "==");
     286    pxcamGetSearchArgs (config, where);
    271287    pxAddLabelSearchArgs (config, where, "-label", "addRun.label", "==");
    272288    PXOPT_COPY_STR(config->args, where, "-reduction", "addRun.reduction", "==");
     
    325341}
    326342
    327 /* static bool pendingimfileMode(pxConfig *config) */
    328 /* { */
    329 /*     PS_ASSERT_PTR_NON_NULL(config, false); */
    330 
    331 /*     psMetadata *where = psMetadataAlloc(); */
    332 /*     pxaddGetSearchArgs (config, where); */
    333 /*     PXOPT_COPY_S64(config->args, where, "-add_id",    "addRun.add_id",                "=="); */
    334 /*     pxAddLabelSearchArgs (config, where, "-label",    "addRun.label",                 "=="); */
    335 /*     PXOPT_COPY_STR(config->args, where, "-reduction", "addRun.reduction",             "=="); */
    336 /*     PXOPT_COPY_S64(config->args, where, "-chip_id",   "addRun.chip_id",              "=="); */
    337 /*     PXOPT_COPY_STR(config->args, where, "-class_id",  "addProcessedExp.class_id", "=="); */
    338 
    339 /*     PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); */
    340 
    341 /*     psString query = pxDataGet("addtool_find_pendingimfile.sql"); */
    342 /*     if (!query) { */
    343 /*         psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); */
    344 /*         return false; */
    345 /*     } */
    346 
    347 /*     // use psDBGenerateWhereSQL because the SQL yields an intermediate table */
    348 /*     if (psListLength(where->list)) { */
    349 /*         psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); */
    350 /*         psStringAppend(&query, " AND %s", whereClause); */
    351 /*         psFree(whereClause); */
    352 /*     } */
    353 /*     psFree(where); */
    354 
    355 /*     if (!p_psDBRunQuery(config->dbh, query)) { */
    356 /*         psError(PS_ERR_UNKNOWN, false, "database error"); */
    357 /*         psFree(query); */
    358 /*         return false; */
    359 /*     } */
    360 /*     psFree(query); */
    361 
    362 /*     psArray *output = p_psDBFetchResult(config->dbh); */
    363 /*     if (!output) { */
    364 /*         psError(PS_ERR_UNKNOWN, false, "database error"); */
    365 /*         return false; */
    366 /*     } */
    367 /*     if (!psArrayLength(output)) { */
    368 /*         psTrace("addtool", PS_LOG_INFO, "no rows found"); */
    369 /*         psFree(output); */
    370 /*         return true; */
    371 /*     } */
    372 
    373 /*     // negate simple so the default is true */
    374 /*     if (!ippdbPrintMetadatas(stdout, output, "addProcessedExp", !simple)) { */
    375 /*         psError(PS_ERR_UNKNOWN, false, "failed to print array"); */
    376 /*         psFree(output); */
    377 /*         return false; */
    378 /*     } */
    379 
    380 /*     psFree(output); */
    381 
    382 /*     return true; */
    383 /* } */
    384 
    385343static bool addprocessedexpMode(pxConfig *config)
    386344{
     
    392350    // optional
    393351    PXOPT_LOOKUP_F32(dtime_addstar, config->args,  "-dtime_addstar", false, false);
    394 
    395352    PXOPT_LOOKUP_S32(n_stars, config->args,        "-n_stars", false, false);
    396 
    397353    PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", false, false);
    398 
    399354    PXOPT_LOOKUP_S64(magicked, config->args, "-magicked", false, false);
    400355
     
    469424        return false;
    470425    }
    471 
    472     // NULL for end_stage means go as far as possible
    473     // EAM : skip here if fault != 0
    474     // Also, we can run fake even if tess_id is not defined
    475 /*     if (fault || (pendingRow->end_stage && psStrcasestr(pendingRow->end_stage, "add"))) { */
    476 /*         psFree(row); */
    477 /*         psFree(pendingRow); */
    478 /*         if (!psDBCommit(config->dbh)) { */
    479 /*             psError(PS_ERR_UNKNOWN, false, "database error"); */
    480 /*             return false; */
    481 /*         } */
    482 /*         return true; */
    483 /*     } */
    484426    psFree(row);
    485     // else continue on...
    486 
    487 /*     if (!pxfakeQueueByAddID(config, */
    488 /*             pendingRow->add_id, */
    489 /*             pendingRow->workdir, */
    490 /*             pendingRow->label, */
    491 /*             pendingRow->reduction, */
    492 /*             pendingRow->expgroup, */
    493 /*             pendingRow->dvodb, */
    494 /*             pendingRow->tess_id, */
    495 /*             pendingRow->end_stage */
    496 /*     )) { */
    497 /*         // rollback */
    498 /*         if (!psDBRollback(config->dbh)) { */
    499 /*             psError(PS_ERR_UNKNOWN, false, "database error"); */
    500 /*         } */
    501 /*         psError(PS_ERR_UNKNOWN, false, "failed to queue new fakeRun"); */
    502 /*         psFree(pendingRow); */
    503 /*         return false; */
    504 /*     } */
    505427    psFree(pendingRow);
    506428
     
    524446    // generate restrictions
    525447    psMetadata *where = psMetadataAlloc();
    526     pxaddGetSearchArgs (config, where);
    527448    PXOPT_COPY_S64(config->args, where, "-add_id",    "addRun.add_id",    "==");
     449    PXOPT_COPY_S64(config->args, where, "-cam_id",    "camRun.cam_id",    "==");
     450    pxcamGetSearchArgs (config, where);
    528451    pxAddLabelSearchArgs (config, where, "-label",    "addRun.label",     "==");
    529452    PXOPT_COPY_STR(config->args, where, "-reduction", "addRun.reduction", "==");
     
    613536
    614537    psMetadata *where = psMetadataAlloc();
    615     pxaddGetSearchArgs (config, where);
    616538    PXOPT_COPY_S64(config->args, where, "-add_id",    "addRun.add_id",         "==");
     539    PXOPT_COPY_S64(config->args, where, "-cam_id",    "camRun.cam_id",         "==");
     540    pxcamGetSearchArgs (config, where);
    617541    pxAddLabelSearchArgs (config, where, "-label",    "addRun.label",     "==");
    618542    PXOPT_COPY_STR(config->args, where, "-reduction", "addRun.reduction",      "==");
    619 /*     PXOPT_COPY_S16(config->args, where, "-fault", "addProcessedExp.fault", "=="); */
    620543
    621544    if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) {
     
    710633    PXOPT_COPY_S64(config->args, where, "-add_id",   "add_id",   "==");
    711634    PXOPT_COPY_S64(config->args, where, "-cam_id",  "cam_id",  "==");
    712 /*     PXOPT_COPY_STR(config->args, where, "-class",    "class",    "=="); */
    713 /*     PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); */
    714635
    715636    if (!pxSetFaultCode(config->dbh, "addProcessedExp", where, fault)) {
     
    776697    return true;
    777698}
    778 
    779699
    780700static bool unblockMode(pxConfig *config)
  • trunk/ippTools/src/addtoolConfig.c

    r25299 r25789  
    4848
    4949    // -definebyquery
    50     // XXX need to allow multiple chip_ids
    51     // XXX need to allow multiple exp_ids
    5250    psMetadata *definebyqueryArgs = psMetadataAlloc();
     51    psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-cam_id",             0, "search by cam_id", 0);
    5352    pxcamSetSearchArgs(definebyqueryArgs);
    54     psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by chipRun label", NULL);
    55     psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-reduction",          0, "search by chipRun reduction class", NULL);
     53    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by camRun label", NULL);
     54    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-reduction",          0, "search by camRun reduction class", NULL);
    5655
    5756    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_workdir",        0, "define workdir", NULL);
     
    5958    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_reduction",      0, "define reduction class", NULL);
    6059    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_dvodb",          0, "define DVO db", NULL);
     60    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-pretend",           0, "do not actually modify the database", false);
    6161    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-all",               0, "allow everything to be queued without search terms", false);
     62    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-simple",            0, "use the simple output format", false);
    6263
    6364    // -updaterun
    64     // XXX need to allow multiple add_ids
    65     // XXX need to allow multiple chip_ids
    66     // XXX need to allow multiple exp_ids
    6765    psMetadata *updaterunArgs = psMetadataAlloc();
     66    psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-add_id",                 0, "search by add_id", 0);
     67    psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-cam_id",                 0, "search by cam_id", 0);
    6868    pxcamSetSearchArgs(updaterunArgs);
    69     psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-add_id",             0, "search by add_id", 0);
    70     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-label",              0, "search by camRun label", NULL);
    71     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-state",              0, "search by camRun state", NULL);
    72     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-reduction",          0, "search by camRun reduction class", NULL);
    73     psMetadataAddBool(updaterunArgs, PS_LIST_TAIL, "-all",               0, "allow everything to be queued without search terms", false);
    74     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_state",          0, "set state", NULL);
    75     psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_label",          0, "set label", NULL);
     69    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-label",                  0, "search by addRun label", NULL);
     70    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-state",                  0, "search by addRun state", NULL);
     71    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-reduction",              0, "search by addRun reduction class", NULL);
     72    psMetadataAddBool(updaterunArgs, PS_LIST_TAIL, "-all",                   0, "allow everything to be queued without search terms", false);
     73    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_state",              0, "set state", NULL);
     74    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_label",              0, "set label", NULL);
    7675
    7776    // -pendingexp
    7877    psMetadata *pendingexpArgs = psMetadataAlloc();
    79     pxcamSetSearchArgs(pendingexpArgs);
    8078    psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-add_id",            0, "search by add_id", 0);
    8179    psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-cam_id",            0, "search by cam_id", 0);
    82     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by camRun label", NULL);
    83     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-reduction",         0, "search by camRun reduction class", NULL);
     80    pxcamSetSearchArgs(pendingexpArgs);
     81    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by addRun label", NULL);
     82    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-reduction",         0, "search by addRun reduction class", NULL);
    8483    psMetadataAddU64(pendingexpArgs, PS_LIST_TAIL, "-limit",             0, "limit result set to N items", 0);
    8584    psMetadataAddBool(pendingexpArgs, PS_LIST_TAIL, "-simple",           0, "use the simple output format", false);
    86 
    87     // XXX is this used? psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class",    0,            "search by class", NULL);
    8885
    8986    // -addprocessedexp
    9087    psMetadata *addprocessedexpArgs = psMetadataAlloc();
    9188    psMetadataAddS64(addprocessedexpArgs, PS_LIST_TAIL, "-add_id", 0,            "define addtool ID (required)", 0);
    92 
    9389    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-dtime_addstar", 0, "define elapsed time for DVO insertion (seconds)", NAN);
    9490    psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-n_stars", 0,            "define number of stars", 0);
    95 
    9691    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-path_base", 0,            "define base output location", NULL);
    9792    psMetadataAddS64(addprocessedexpArgs, PS_LIST_TAIL, "-magicked", 0,             "set magicked", 0);
     93
    9894    // -processedexp
    9995    psMetadata *processedexpArgs = psMetadataAlloc();
     96    psMetadataAddS64(processedexpArgs, PS_LIST_TAIL, "-add_id",   0,            "search by add_id", 0);
     97    psMetadataAddS64(processedexpArgs, PS_LIST_TAIL, "-cam_id",   0,            "search by cam_id", 0);
    10098    pxcamSetSearchArgs(processedexpArgs);
    101     psMetadataAddS64(processedexpArgs, PS_LIST_TAIL, "-add_id",   0,            "search by add_id", 0);
    10299    psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by addRun label", NULL);
    103100    psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-reduction",0,            "search by addRun reduction class", NULL);
     
    106103    psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-all",     0,            "list everything without restriction", false);
    107104    psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-simple",  0,            "use the simple output format", false);
    108 /*     psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-faulted", 0,            "only return imfiles with a fault status set", false); */
    109105
    110106    // -revertprocessedexp
    111     // XXX need to allow multiple add_ids
    112     // XXX need to allow multiple chip_ids
    113     // XXX need to allow multiple exp_ids
    114107    psMetadata *revertprocessedexpArgs = psMetadataAlloc();
     108    psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-add_id",   0,            "search by add_id", 0);
     109    psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-cam_id",   0,            "search by cam_id", 0);
    115110    pxcamSetSearchArgs(revertprocessedexpArgs);
    116     psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-add_id",   0,            "search by add_id", 0);
    117111    psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-label",    PS_META_DUPLICATE_OK, "search by addRun label", NULL);
    118112    psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-reduction",0,            "search by addRun reduction class", NULL);
     
    121115
    122116    // -updateprocessedexp
    123     // XXX allow full search options?
    124117    psMetadata *updateprocessedexpArgs = psMetadataAlloc();
    125118    psMetadataAddS64(updateprocessedexpArgs, PS_LIST_TAIL, "-add_id", 0,            "search by addtool ID", 0);
     
    139132
    140133    // -pendingcleanuprun
    141     // XXX allow full search options?
    142134    psMetadata *pendingcleanuprunArgs = psMetadataAlloc();
    143135    psMetadataAddStr(pendingcleanuprunArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "list blocks for specified label", NULL);
     
    146138
    147139    // -pendingcleanupexp
    148     // XXX allow full search options?
    149140    psMetadata *pendingcleanupexpArgs = psMetadataAlloc();
    150141    psMetadataAddStr(pendingcleanupexpArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "list blocks for specified label", NULL);
  • trunk/ippTools/src/pxadd.c

    r25299 r25789  
    2828#include "pxtools.h"
    2929#include "pxadd.h"
    30 
    31 bool pxaddSetSearchArgs (psMetadata *md) {
    32 
    33     psMetadataAddS64(md,  PS_LIST_TAIL, "-add_id",            0, "search by add_id", 0);
    34     psMetadataAddS64(md,  PS_LIST_TAIL, "-cam_id",             0, "search by cam_id", 0);
    35 
    36 /*     psMetadataAddStr(md,  PS_LIST_TAIL, "-exp_name",           0, "search by exp_name", NULL); */
    37 /*     psMetadataAddStr(md,  PS_LIST_TAIL, "-inst",               0, "search for camera", NULL); */
    38 /*     psMetadataAddStr(md,  PS_LIST_TAIL, "-telescope",          0, "search for telescope", NULL); */
    39 /*     psMetadataAddTime(md, PS_LIST_TAIL, "-dateobs_begin",      0, "search for exposures by time (>=)", NULL); */
    40 /*     psMetadataAddTime(md, PS_LIST_TAIL, "-dateobs_end",        0, "search for exposures by time (<)", NULL); */
    41 /*     psMetadataAddStr(md,  PS_LIST_TAIL, "-exp_tag",            0, "search by exp_tag", NULL); */
    42 /*     psMetadataAddStr(md,  PS_LIST_TAIL, "-exp_type",           0, "search by exp_type", NULL); */
    43 /*     psMetadataAddStr(md,  PS_LIST_TAIL, "-comment",            0, "search by comment", NULL); */
    44 /*     psMetadataAddStr(md,  PS_LIST_TAIL, "-filelevel",          0, "search by filelevel", NULL); */
    45 /*     psMetadataAddStr(md,  PS_LIST_TAIL, "-filter",             0, "search for filter", NULL); */
    46 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-airmass_min",        0, "define min airmass", NAN); */
    47 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-airmass_max",        0, "define max airmass", NAN); */
    48 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-ra_min",             0, "define min RA (degrees) ", NAN); */
    49 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-ra_max",             0, "define max RA (degrees) ", NAN); */
    50 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-decl_min",           0, "define min DEC (degrees)", NAN); */
    51 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-decl_max",           0, "define max DEC (degrees)", NAN); */
    52 /*     psMetadataAddF32(md,  PS_LIST_TAIL, "-exp_time_min",       0, "define min exposure time", NAN); */
    53 /*     psMetadataAddF32(md,  PS_LIST_TAIL, "-exp_time_max",       0, "define max exposure time", NAN); */
    54 /*     psMetadataAddF32(md,  PS_LIST_TAIL, "-sat_pixel_frac_min", 0, "define max fraction of saturated pixels", NAN); */
    55 /*     psMetadataAddF32(md,  PS_LIST_TAIL, "-sat_pixel_frac_max", 0, "define max fraction of saturated pixels", NAN); */
    56 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-bg_min",             0, "define min background", NAN); */
    57 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-bg_max",             0, "define max background", NAN); */
    58 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-bg_stdev_min",       0, "define min background standard deviation", NAN); */
    59 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-bg_stdev_max",       0, "define max background standard deviation", NAN); */
    60 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-bg_mean_stdev_min",  0, "define min background mean standard deviation (across imfiles)", NAN); */
    61 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-bg_mean_stdev_max",  0, "define max background mean standard deviation (across imfiles)", NAN); */
    62 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-alt_min",            0, "define min altitude", NAN); */
    63 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-alt_max",            0, "define max altitude", NAN); */
    64 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-az_min",             0, "define min azimuth ", NAN); */
    65 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-az_max",             0, "define max azimuth ", NAN); */
    66 /*     psMetadataAddF32(md,  PS_LIST_TAIL, "-ccd_temp_min",       0, "define min ccd tempature", NAN); */
    67 /*     psMetadataAddF32(md,  PS_LIST_TAIL, "-ccd_temp_max",       0, "define max ccd tempature", NAN); */
    68 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-posang_min",         0, "define min rotator position angle", NAN); */
    69 /*     psMetadataAddF64(md,  PS_LIST_TAIL, "-posang_max",         0, "define max rotator position angle", NAN); */
    70 /*     psMetadataAddStr(md,  PS_LIST_TAIL, "-object",             0, "search by exposure object", NULL); */
    71 /*     psMetadataAddF32(md,  PS_LIST_TAIL, "-sun_angle_min",      0, "define min solar angle", NAN); */
    72 /*     psMetadataAddF32(md,  PS_LIST_TAIL, "-sun_angle_max",      0, "define max solar angle", NAN); */
    73 
    74     return true;
    75 }
    76 
    77 bool pxaddGetSearchArgs (pxConfig *config, psMetadata *where) {
    78 
    79     PXOPT_COPY_S64(config->args,     where, "-add_id",             "addRun.add_id",        "==");
    80 /*     PXOPT_COPY_S64(config->args,     where, "-cam_id",             "camRun.cam_id",        "=="); */
    81 /*     PXOPT_COPY_S64(config->args,   where, "-chip_id",            "chipRun.chip_id",   "=="); */
    82 /*     PXOPT_COPY_S64(config->args,   where, "-exp_id",             "rawExp.exp_id",     "=="); */
    83 /*     PXOPT_COPY_STR(config->args,   where, "-exp_name",           "rawExp.exp_name",   "=="); */
    84 /*     PXOPT_COPY_STR(config->args,   where, "-inst",               "rawExp.camera",     "=="); */
    85 /*     PXOPT_COPY_STR(config->args,   where, "-telescope",          "rawExp.telescope",  "=="); */
    86 /*     PXOPT_COPY_TIME(config->args,  where, "-dateobs_begin",      "rawExp.dateobs",    ">="); */
    87 /*     PXOPT_COPY_TIME(config->args,  where, "-dateobs_end",        "rawExp.dateobs",    "<="); */
    88 /*     PXOPT_COPY_STR(config->args,   where, "-exp_tag",            "rawExp.exp_tag",    "=="); */
    89 /*     PXOPT_COPY_STR(config->args,   where, "-exp_type",           "rawExp.exp_type",   "=="); */
    90 /*     PXOPT_COPY_STR(config->args,   where, "-comment",            "rawExp.comment",    "LIKE"); */
    91 /*     PXOPT_COPY_STR(config->args,   where, "-filelevel",          "rawExp.filelevel",  "=="); */
    92 /*     PXOPT_COPY_STR(config->args,   where, "-filter",             "rawExp.filter",         "=="); */
    93 /*     PXOPT_COPY_F64(config->args,   where, "-airmass_min",        "rawExp.airmass",        ">="); */
    94 /*     PXOPT_COPY_F64(config->args,   where, "-airmass_max",        "rawExp.airmass",        "<"); */
    95 /*     PXOPT_COPY_RADEC(config->args, where, "-ra_min",             "rawExp.ra",             ">="); */
    96 /*     PXOPT_COPY_RADEC(config->args, where, "-ra_max",             "rawExp.ra",             "<"); */
    97 /*     PXOPT_COPY_RADEC(config->args, where, "-decl_min",           "rawExp.decl",           ">="); */
    98 /*     PXOPT_COPY_RADEC(config->args, where, "-decl_max",           "rawExp.decl",           "<"); */
    99 /*     PXOPT_COPY_F32(config->args,   where, "-exp_time_min",       "rawExp.exp_time",       ">="); */
    100 /*     PXOPT_COPY_F32(config->args,   where, "-exp_time_max",       "rawExp.exp_time",       "<"); */
    101 /*     PXOPT_COPY_F32(config->args,   where, "-sat_pixel_frac_min", "rawExp.sat_pixel_frac", ">="); */
    102 /*     PXOPT_COPY_F32(config->args,   where, "-sat_pixel_frac_max", "rawExp.sat_pixel_frac", "<"); */
    103 /*     PXOPT_COPY_F64(config->args,   where, "-bg_min",             "rawExp.bg",             ">="); */
    104 /*     PXOPT_COPY_F64(config->args,   where, "-bg_max",             "rawExp.bg",             "<"); */
    105 /*     PXOPT_COPY_F64(config->args,   where, "-bg_stdev_min",       "rawExp.bg_stdev",       ">="); */
    106 /*     PXOPT_COPY_F64(config->args,   where, "-bg_stdev_max",       "rawExp.bg_stdev",       "<"); */
    107 /*     PXOPT_COPY_F64(config->args,   where, "-bg_mean_stdev_min",  "rawExp.bg_mean_stdev",  ">="); */
    108 /*     PXOPT_COPY_F64(config->args,   where, "-bg_mean_stdev_max",  "rawExp.bg_mean_stdev",  "<"); */
    109 /*     PXOPT_COPY_F64(config->args,   where, "-alt_min",            "rawExp.alt",            ">="); */
    110 /*     PXOPT_COPY_F64(config->args,   where, "-alt_max",            "rawExp.alt",            "<"); */
    111 /*     PXOPT_COPY_F64(config->args,   where, "-az_min",             "rawExp.az",             ">="); */
    112 /*     PXOPT_COPY_F64(config->args,   where, "-az_max",             "rawExp.az",             "<"); */
    113 /*     PXOPT_COPY_F32(config->args,   where, "-ccd_temp_min",       "rawExp.ccd_temp",       ">="); */
    114 /*     PXOPT_COPY_F32(config->args,   where, "-ccd_temp_max",       "rawExp.ccd_temp",       "<"); */
    115 /*     PXOPT_COPY_F64(config->args,   where, "-posang_min",         "rawExp.posang",         ">="); */
    116 /*     PXOPT_COPY_F64(config->args,   where, "-posang_max",         "rawExp.posang",         "<"); */
    117 /*     PXOPT_COPY_STR(config->args,   where, "-object",             "rawExp.object",         "=="); */
    118 /*     PXOPT_COPY_F32(config->args,   where, "-sun_angle_min",      "rawExp.sun_angle",      ">="); */
    119 /*     PXOPT_COPY_F32(config->args,   where, "-sun_angle_max",      "rawExp.sun_angle",      "<"); */
    120 
    121     return true;
    122 }
    12330
    12431bool pxaddRunSetState(pxConfig *config, psS64 add_id, const char *state, psS64 magicked)
     
    236143        }
    237144    }
    238     //    fprintf(stderr,"%s",query);
     145
    239146    // queue the exp
    240     // XXX chip_id is being cast here work around psS64 have a different type
    241     // different on 32/64
     147    // Note: cam_id is being cast here work around psS64 have a different type different
     148    // on 32/64
    242149    if (!p_psDBRunQueryF(config->dbh, query,
    243150                         "new", // state
  • trunk/ippTools/src/pxadd.h

    r25299 r25789  
    3030bool pxaddRunSetLabelByQuery(pxConfig *config, psMetadata *where, const char *label);
    3131
    32 bool pxaddSetSearchArgs (psMetadata *md);
    33 bool pxaddGetSearchArgs (pxConfig *config, psMetadata *where);
    34 
    3532// Likely BROKEN
    3633bool pxaddQueueByCamID(pxConfig *config,
Note: See TracChangeset for help on using the changeset viewer.