IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 14, 2012, 3:05:17 PM (14 years ago)
Author:
heather
Message:

dvodb changes: staticsky and staticsky_multi are now just staticsky

File:
1 edited

Legend:

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

    r33030 r33525  
    141141    pxAddLabelSearchArgs (config, where, "-data_group","staticskyRun.data_group", "=="); // define using camRun label
    142142    PXOPT_COPY_STR(config->args, where,  "-reduction", "staticskyyRun.reduction", "==");
    143     pxAddLabelSearchArgs (config, where, "-filter",     "stackRun.filter", "=="); // define using camRun label
    144     }
    145         if (strcmp(stage, "staticsky_multi")== 0) {
    146 
    147     pxAddLabelSearchArgs (config, where, "-label",     "staticskyRun.label", "=="); // define using camRun label
    148     pxAddLabelSearchArgs (config, where, "-data_group","staticskyRun.data_group", "=="); // define using camRun label
    149     PXOPT_COPY_STR(config->args, where,  "-reduction", "staticskyyRun.reduction", "==");
    150143    //no filter here
    151144    }
     
    227220    }
    228221    }
     222 
    229223    if (strcmp(stage,"staticsky") == 0) {
    230     if (dvodb ) {
    231       psTrace("addtool.c", PS_LOG_INFO, "dvodb argument found (%s) using addtool_find_sky_id_dvo.sql\n%s\n", dvodb,stage);
    232         // find the cam_id of all the exposures that we want to queue up.
    233         bare_query = pxDataGet("addtool_find_sky_id_dvo.sql");
    234         // user supplied dvodb
    235         psStringAppend(&dvodb_string, "addRun.dvodb = '%s'", dvodb);
    236     } else {
    237       psTrace("addtool.c", PS_LOG_INFO, "dvodb argument not found using addtool_find_sky_id.sql\n%s\n",stage);
    238         // find the cam_id of all the exposures that we want to queue up.
    239         bare_query = pxDataGet("addtool_find_sky_id.sql");
    240         // inherit dvodb from camRun, avoid matching NULL
    241         psStringAppend(&dvodb_string, "(staticskyRun.dvodb IS NOT NULL AND previous_dvodb = staticskyRun.dvodb)");
    242     }
    243     }
    244 
    245     if (strcmp(stage,"staticsky_multi") == 0) {
    246224      if (dvodb ) {
    247225        psTrace("addtool.c", PS_LOG_INFO, "dvodb argument found (%s) using addtool_find_sky_id_multi_dvo.sql\n%s\n", dvodb,stage);
     
    310288        psStringAppend(&query, " GROUP BY stack_id");
    311289      }
     290      //   if (strcmp(stage,"staticsky") == 0) {
     291      //   psStringAppend(&query, " GROUP BY stack_id");
     292      // }
    312293    if (strcmp(stage,"staticsky") == 0) {
    313         psStringAppend(&query, " GROUP BY stack_id");
    314       }
    315     if (strcmp(stage,"staticsky_multi") == 0) {
    316294      psStringAppend(&query, " GROUP BY sky_id");  //some reason it needs this
    317295      }
     
    402380    }
    403381    }
     382   
    404383    if (strcmp(stage,"staticsky") == 0) {
    405     for (long i = 0; i < psArrayLength(output); i++) {
    406         psMetadata *md = output->data[i];
    407 
    408         staticskyRunRow *row = staticskyRunObjectFromMetadata(md);
    409        
    410         if (!row) {
    411             psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into camRun");
    412             psFree(output);
    413             return false;
    414         }
    415 
    416         if (!dvodb) {  //there's no staticsky.dvodb
    417             psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined dvodb: label: %s, sky_id %" PRId64, row->label, row->sky_id);
    418             psFree(output);
    419             return false;
    420         }
    421         if (!workdir && !row->workdir) {
    422             psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined workdir: label: %s, sky_id %" PRId64, row->label, row->sky_id);
    423             psFree(output);
    424             return false;
    425         }
    426 
    427         psFree(row);
    428     }
    429     }
    430     if (strcmp(stage,"staticsky_multi") == 0) {
    431384    for (long i = 0; i < psArrayLength(output); i++) {
    432385        psMetadata *md = output->data[i];
     
    566519    }
    567520      }
     521   
    568522    if (strcmp(stage,"staticsky") == 0) {
    569     for (long i = 0; i < psArrayLength(output); i++) {
    570         psMetadata *md = output->data[i];
    571         psS64 stage_id =0;
    572        
    573         staticskyRunRow *row = staticskyRunObjectFromMetadata(md);
    574         stage_id = row->sky_id;
    575        
    576         if (!row) {
    577             psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into camRun");
    578             psFree(output);
    579             return false;
    580         }
    581 
    582         // queue the exp
    583         if (!pxaddQueueByCamID(config,
    584                                stage,
    585                                stage_id,
    586                                0,
    587                                workdir     ? workdir   : row->workdir,
    588                                reduction   ? reduction : row->reduction,
    589                                label       ? label     : row->label,
    590                                data_group  ? data_group : (row->data_group ? row->data_group :  (label ? label : row->label)),
    591                                dvodb       ? dvodb     : NULL,
    592                                note        ? note      : NULL,
    593                                image_only,
    594                                minidvodb,
    595                                minidvodb_group,
    596                                minidvodb_name
    597         )) {
    598             if (!psDBRollback(config->dbh)) {
    599                 psError(PS_ERR_UNKNOWN, false, "database error sfg");
    600             }
    601             psError(PS_ERR_UNKNOWN, false,
    602                     "failed to trying to queue stage %s %" PRId64,stage, stage_id);
    603             psFree(row);
    604             psFree(output);
    605             return false;
    606         }
    607         psFree(row);
    608     }
    609       }
    610 
    611     if (strcmp(stage,"staticsky_multi") == 0) {
    612523    for (long i = 0; i < psArrayLength(output); i++) {
    613524        psMetadata *md = output->data[i];
     
    705616    query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id");
    706617    }
    707     if (strcmp(stage, "staticsky_multi")==0) {
    708     query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id");
    709     }
     618   
    710619
    711620    // pxUpdateRun gets parameters from config->args and runs the update query
     
    745654    }
    746655    if (strcmp(stage, "staticsky")==0) {
    747     query = pxDataGet("addtool_find_pendingexp_staticsky.sql");
    748     }
    749     if (strcmp(stage, "staticsky_multi")==0) {
    750656    query = pxDataGet("addtool_find_pendingexp_staticsky_multi.sql");
    751657    }
     
    768674      psStringAppend(&query, " GROUP BY %s", "stack_id");
    769675    }
     676    //if (strcmp(stage, "staticsky") == 0) {
     677    //  //this group by is needed to join against all the warps (to get camera)
     678    //  psStringAppend(&query, " GROUP BY %s", "sky_id");
     679    //}
    770680    if (strcmp(stage, "staticsky") == 0) {
    771       //this group by is needed to join against all the warps (to get camera)
    772       psStringAppend(&query, " GROUP BY %s", "sky_id");
    773     }
    774     if (strcmp(stage, "staticsky_multi") == 0) {
    775681      //this group by is needed to join against all the warps (to get camera)
    776682      psStringAppend(&query, " GROUP BY %s", "sky_id, stage_extra1");
     
    977883    }
    978884    if (strcmp (stage,"staticsky") == 0) {
    979     query = pxDataGet("addtool_find_processedexp_staticsky.sql");
    980     }
    981     if (strcmp (stage,"staticsky_multi") == 0) {
    982885    query = pxDataGet("addtool_find_processedexp_staticsky_multi.sql");
    983886    }
     
    1090993         query = pxDataGet("addtool_revertprocessedexp_stack.sql");
    1091994      }
    1092      if (strcmp(stage, "staticsky") == 0) {
    1093          query = pxDataGet("addtool_revertprocessedexp_staticsky.sql");
    1094       }
    1095    if (strcmp(stage, "staticsky_multi") == 0) {
     995    if (strcmp(stage, "staticsky") == 0) {
    1096996         query = pxDataGet("addtool_revertprocessedexp_staticsky_multi.sql");
    1097997      }
Note: See TracChangeset for help on using the changeset viewer.