Changeset 33525 for trunk/ippTools
- Timestamp:
- Mar 14, 2012, 3:05:17 PM (14 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 10 edited
-
share/Makefile.am (modified) (3 diffs)
-
share/addtool_find_pendingexp_staticsky_multi.sql (modified) (1 diff)
-
share/addtool_find_sky_id.sql (modified) (2 diffs)
-
share/addtool_find_sky_id_dvo.sql (modified) (1 diff)
-
share/addtool_find_sky_id_multi.sql (modified) (2 diffs)
-
share/addtool_find_sky_id_multi_dvo.sql (modified) (1 diff)
-
share/addtool_queue_sky_id_multi.sql (modified) (1 diff)
-
share/addtool_revertprocessedexp_staticsky_multi.sql (modified) (1 diff)
-
src/addtool.c (modified) (10 diffs)
-
src/pxadd.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/share/Makefile.am
r33030 r33525 8 8 addtool_find_cam_id_dvo.sql \ 9 9 addtool_find_cam_id.sql \ 10 addtool_find_sky_id_dvo.sql \11 addtool_find_sky_id.sql \12 10 addtool_find_sky_id_multi_dvo.sql \ 13 11 addtool_find_sky_id_multi.sql \ … … 17 15 addtool_find_pendingexp_cam.sql \ 18 16 addtool_find_pendingexp_stack.sql \ 19 addtool_find_pendingexp_staticsky.sql \20 17 addtool_find_pendingexp_staticsky_multi.sql \ 21 18 addtool_find_pendingmergeprocess.sql \ 22 19 addtool_find_processedexp_cam.sql \ 23 20 addtool_find_processedexp_stack.sql \ 24 addtool_find_processedexp_staticsky.sql \25 21 addtool_find_processedexp_staticsky_multi.sql \ 26 22 addtool_find_minidvodbprocessed.sql \ … … 30 26 addtool_queue_cam_id.sql \ 31 27 addtool_queue_stack_id.sql \ 32 addtool_queue_sky_id.sql \33 28 addtool_queue_sky_id_multi.sql \ 34 29 addtool_queue_minidvodbrun.sql \ -
trunk/ippTools/share/addtool_find_pendingexp_staticsky_multi.sql
r32832 r33525 25 25 WHERE 26 26 staticskyRun.state = 'full' 27 AND stage = 'staticsky _multi'27 AND stage = 'staticsky' 28 28 AND ((addRun.state = 'new' AND addProcessedExp.add_id IS NULL) OR addRun.state = 'update') 29 29 AND addRun.dvodb IS NOT NULL -
trunk/ippTools/share/addtool_find_sky_id.sql
r31596 r33525 2 2 staticskyRun.* 3 3 FROM 4 staticskyR esult5 join staticskyR unusing (sky_id)4 staticskyRun 5 join staticskyResult using (sky_id) 6 6 join staticskyInput using(sky_id) 7 7 JOIN stackRun USING(stack_id) … … 19 19 staticskyRun.state = 'full' 20 20 AND staticskyResult.quality = 0 21 AND added_ exp_id IS NULL21 AND added_sky_id IS NULL 22 22 -- addtool adds checks on exposure being added to the dvodb previously -
trunk/ippTools/share/addtool_find_sky_id_dvo.sql
r31596 r33525 1 SELECT staticskyRun.* FROM staticskyR esult2 JOIN staticskyR unUSING(sky_id)1 SELECT staticskyRun.* FROM staticskyRun 2 JOIN staticskyResult USING(sky_id) 3 3 join staticskyInput using(sky_id) 4 4 JOIN stackRun USING(stack_id) 5 5 6 6 WHERE staticskyRun.state = 'full' and staticskyResult.quality = 0 7 AND s ky_id NOT IN (SELECT sky_id7 AND stack_id NOT IN (SELECT stack_id 8 8 FROM addRun 9 9 JOIN staticskyResult on staticskyResult.sky_id = addRun.stage_id 10 10 JOIN staticskyRun USING(sky_id) 11 JOIN staticskyInput USING(sky_id) 11 12 WHERE addRun.stage = 'staticsky' AND %s 12 13 ) -
trunk/ippTools/share/addtool_find_sky_id_multi.sql
r32832 r33525 4 4 staticskyResult.num_inputs 5 5 FROM 6 staticskyR esult7 join staticskyR unusing (sky_id)6 staticskyRun 7 join staticskyResult using (sky_id) 8 8 join staticskyInput using(sky_id) 9 9 JOIN stackRun USING(stack_id) 10 10 11 LEFT JOIN (SELECT s ky_id AS added_sky_id,11 LEFT JOIN (SELECT stack_id AS added_stack_id, 12 12 addRun.dvodb AS previous_dvodb 13 13 FROM addRun 14 14 JOIN staticskyRun on sky_id = stage_id 15 15 ) as foo 16 ON s ky_id = added_sky_id17 AND stage = 'staticsky _multi'16 ON stack_id = added_stack_id 17 AND stage = 'staticsky' 18 18 -- hook for qualifying the join on the previous_dvodb 19 19 AND %s … … 21 21 staticskyRun.state = 'full' 22 22 AND staticskyResult.quality = 0 23 AND added_ exp_id IS NULL23 AND added_stack_id IS NULL 24 24 -- addtool adds checks on exposure being added to the dvodb previously -
trunk/ippTools/share/addtool_find_sky_id_multi_dvo.sql
r32832 r33525 5 5 6 6 WHERE staticskyRun.state = 'full' and staticskyResult.quality = 0 7 AND s ky_id NOT IN (SELECT sky_id7 AND stack_id NOT IN (SELECT stack_id 8 8 FROM addRun 9 9 JOIN staticskyResult on staticskyResult.sky_id = addRun.stage_id 10 10 JOIN staticskyRun USING(sky_id) 11 WHERE addRun.stage = 'staticsky_multi' AND %s 11 JOIN staticskyInput USING(sky_id) 12 WHERE addRun.stage = 'staticsky' AND %s 12 13 ) -
trunk/ippTools/share/addtool_queue_sky_id_multi.sql
r32832 r33525 2 2 SELECT 3 3 0, -- add_id 4 'staticsky _multi', -- stage4 'staticsky', -- stage 5 5 sky_id, -- stage_id 6 6 %d, -- stage_extra1 -
trunk/ippTools/share/addtool_revertprocessedexp_staticsky_multi.sql
r32832 r33525 5 5 AND addProcessedExp.fault != 0 6 6 AND addRun.state = 'new' 7 AND addRun.stage = 'staticsky _multi'7 AND addRun.stage = 'staticsky' -
trunk/ippTools/src/addtool.c
r33030 r33525 141 141 pxAddLabelSearchArgs (config, where, "-data_group","staticskyRun.data_group", "=="); // define using camRun label 142 142 PXOPT_COPY_STR(config->args, where, "-reduction", "staticskyyRun.reduction", "=="); 143 pxAddLabelSearchArgs (config, where, "-filter", "stackRun.filter", "=="); // define using camRun label144 }145 if (strcmp(stage, "staticsky_multi")== 0) {146 147 pxAddLabelSearchArgs (config, where, "-label", "staticskyRun.label", "=="); // define using camRun label148 pxAddLabelSearchArgs (config, where, "-data_group","staticskyRun.data_group", "=="); // define using camRun label149 PXOPT_COPY_STR(config->args, where, "-reduction", "staticskyyRun.reduction", "==");150 143 //no filter here 151 144 } … … 227 220 } 228 221 } 222 229 223 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 dvodb235 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 NULL241 psStringAppend(&dvodb_string, "(staticskyRun.dvodb IS NOT NULL AND previous_dvodb = staticskyRun.dvodb)");242 }243 }244 245 if (strcmp(stage,"staticsky_multi") == 0) {246 224 if (dvodb ) { 247 225 psTrace("addtool.c", PS_LOG_INFO, "dvodb argument found (%s) using addtool_find_sky_id_multi_dvo.sql\n%s\n", dvodb,stage); … … 310 288 psStringAppend(&query, " GROUP BY stack_id"); 311 289 } 290 // if (strcmp(stage,"staticsky") == 0) { 291 // psStringAppend(&query, " GROUP BY stack_id"); 292 // } 312 293 if (strcmp(stage,"staticsky") == 0) { 313 psStringAppend(&query, " GROUP BY stack_id");314 }315 if (strcmp(stage,"staticsky_multi") == 0) {316 294 psStringAppend(&query, " GROUP BY sky_id"); //some reason it needs this 317 295 } … … 402 380 } 403 381 } 382 404 383 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.dvodb417 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) {431 384 for (long i = 0; i < psArrayLength(output); i++) { 432 385 psMetadata *md = output->data[i]; … … 566 519 } 567 520 } 521 568 522 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 exp583 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_name597 )) {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) {612 523 for (long i = 0; i < psArrayLength(output); i++) { 613 524 psMetadata *md = output->data[i]; … … 705 616 query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id"); 706 617 } 707 if (strcmp(stage, "staticsky_multi")==0) { 708 query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id"); 709 } 618 710 619 711 620 // pxUpdateRun gets parameters from config->args and runs the update query … … 745 654 } 746 655 if (strcmp(stage, "staticsky")==0) { 747 query = pxDataGet("addtool_find_pendingexp_staticsky.sql");748 }749 if (strcmp(stage, "staticsky_multi")==0) {750 656 query = pxDataGet("addtool_find_pendingexp_staticsky_multi.sql"); 751 657 } … … 768 674 psStringAppend(&query, " GROUP BY %s", "stack_id"); 769 675 } 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 //} 770 680 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) {775 681 //this group by is needed to join against all the warps (to get camera) 776 682 psStringAppend(&query, " GROUP BY %s", "sky_id, stage_extra1"); … … 977 883 } 978 884 if (strcmp (stage,"staticsky") == 0) { 979 query = pxDataGet("addtool_find_processedexp_staticsky.sql");980 }981 if (strcmp (stage,"staticsky_multi") == 0) {982 885 query = pxDataGet("addtool_find_processedexp_staticsky_multi.sql"); 983 886 } … … 1090 993 query = pxDataGet("addtool_revertprocessedexp_stack.sql"); 1091 994 } 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) { 1096 996 query = pxDataGet("addtool_revertprocessedexp_staticsky_multi.sql"); 1097 997 } -
trunk/ippTools/src/pxadd.c
r32832 r33525 157 157 } 158 158 if (strcmp(stage,"staticsky") == 0) { 159 query = pxDataGet("addtool_queue_sky_id.sql");160 psMemSetPersistent(query, true);161 }162 if (strcmp(stage,"staticsky_multi") == 0) {163 159 query = pxDataGet("addtool_queue_sky_id_multi.sql"); 164 160 psMemSetPersistent(query, true);
Note:
See TracChangeset
for help on using the changeset viewer.
