Changeset 32832 for trunk/ippTools
- Timestamp:
- Nov 29, 2011, 11:46:43 AM (15 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 6 added
- 8 edited
-
share/Makefile.am (modified) (4 diffs)
-
share/addtool_find_pendingexp_staticsky_multi.sql (added)
-
share/addtool_find_processedexp_staticsky_multi.sql (added)
-
share/addtool_find_sky_id_multi.sql (added)
-
share/addtool_find_sky_id_multi_dvo.sql (added)
-
share/addtool_queue_cam_id.sql (modified) (1 diff)
-
share/addtool_queue_sky_id.sql (modified) (1 diff)
-
share/addtool_queue_sky_id_multi.sql (added)
-
share/addtool_queue_stack_id.sql (modified) (1 diff)
-
share/addtool_revertprocessedexp_staticsky_multi.sql (added)
-
src/addtool.c (modified) (13 diffs)
-
src/flatcorr.c (modified) (1 diff)
-
src/pxadd.c (modified) (3 diffs)
-
src/pxadd.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/share/Makefile.am
r32771 r32832 10 10 addtool_find_sky_id_dvo.sql \ 11 11 addtool_find_sky_id.sql \ 12 addtool_find_sky_id_multi_dvo.sql \ 13 addtool_find_sky_id_multi.sql \ 12 14 addtool_find_stack_id_dvo.sql \ 13 15 addtool_find_stack_id.sql \ … … 16 18 addtool_find_pendingexp_stack.sql \ 17 19 addtool_find_pendingexp_staticsky.sql \ 20 addtool_find_pendingexp_staticsky_multi.sql \ 18 21 addtool_find_pendingmergeprocess.sql \ 19 22 addtool_find_processedexp_cam.sql \ 20 23 addtool_find_processedexp_stack.sql \ 21 24 addtool_find_processedexp_staticsky.sql \ 25 addtool_find_processedexp_staticsky_multi.sql \ 22 26 addtool_find_minidvodbprocessed.sql \ 23 27 addtool_find_minidvodbrun.sql \ … … 27 31 addtool_queue_stack_id.sql \ 28 32 addtool_queue_sky_id.sql \ 33 addtool_queue_sky_id_multi.sql \ 29 34 addtool_queue_minidvodbrun.sql \ 30 35 addtool_revertminidvodbprocessed.sql \ … … 32 37 addtool_revertprocessedexp_stack.sql \ 33 38 addtool_revertprocessedexp_staticsky.sql \ 39 addtool_revertprocessedexp_staticsky_multi.sql \ 34 40 bgtool_advancechip.sql \ 35 41 bgtool_advancewarp.sql \ -
trunk/ippTools/share/addtool_queue_cam_id.sql
r31375 r32832 4 4 'cam', -- stage 5 5 cam_id, -- stage_id 6 %d, -- stage_extra1 6 7 '%s', -- state 7 8 '%s', -- workdir -
trunk/ippTools/share/addtool_queue_sky_id.sql
r31375 r32832 4 4 'staticsky', -- stage 5 5 sky_id, -- stage_id 6 %d, -- stage_extra1 6 7 '%s', -- state 7 8 '%s', -- workdir -
trunk/ippTools/share/addtool_queue_stack_id.sql
r31375 r32832 4 4 'stack', -- stage 5 5 stack_id, -- stage_id 6 %d, --stage_extra1 6 7 '%s', -- state 7 8 '%s', -- workdir -
trunk/ippTools/src/addtool.c
r32711 r32832 143 143 pxAddLabelSearchArgs (config, where, "-filter", "stackRun.filter", "=="); // define using camRun label 144 144 } 145 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", "=="); 150 //no filter here 151 } 146 152 if (!psListLength(where->list)) { 147 153 psFree(where); … … 237 243 } 238 244 239 245 if (strcmp(stage,"staticsky_multi") == 0) { 246 if (dvodb ) { 247 psTrace("addtool.c", PS_LOG_INFO, "dvodb argument found (%s) using addtool_find_sky_id_multi_dvo.sql\n%s\n", dvodb,stage); 248 // find the cam_id of all the exposures that we want to queue up. 249 bare_query = pxDataGet("addtool_find_sky_id_multi_dvo.sql"); 250 // user supplied dvodb 251 psStringAppend(&dvodb_string, "addRun.dvodb = '%s'", dvodb); 252 } else { 253 psTrace("addtool.c", PS_LOG_INFO, "dvodb argument not found using addtool_find_sky_id_multi.sql\n%s\n",stage); 254 // find the cam_id of all the exposures that we want to queue up. 255 bare_query = pxDataGet("addtool_find_sky_id_multi.sql"); 256 // inherit dvodb from camRun, avoid matching NULL 257 psStringAppend(&dvodb_string, "(staticskyRun.dvodb IS NOT NULL AND previous_dvodb = staticskyRun.dvodb)"); 258 } 259 } 240 260 241 261 if (!bare_query) { … … 292 312 psStringAppend(&query, " GROUP BY stack_id"); 293 313 } 294 314 if (strcmp(stage,"staticsky_multi") == 0) { 315 psStringAppend(&query, " GROUP BY sky_id"); //some reason it needs this 316 } 295 317 296 318 … … 405 427 } 406 428 } 429 if (strcmp(stage,"staticsky_multi") == 0) { 430 for (long i = 0; i < psArrayLength(output); i++) { 431 psMetadata *md = output->data[i]; 432 bool status = false; 433 psS32 num_inputs = psMetadataLookupS32(&status, md, "num_inputs"); 434 if (!status) { 435 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item num_inputs"); 436 return false; 437 } 438 if (num_inputs < 0) { 439 psError(PS_ERR_UNKNOWN, true, "invalid value for num_inputs"); 440 return false; 441 } 442 443 staticskyRunRow *row = staticskyRunObjectFromMetadata(md); 444 445 if (!row) { 446 psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into camRun"); 447 psFree(output); 448 return false; 449 } 450 451 if (!dvodb) { //there's no staticsky.dvodb 452 psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined dvodb: label: %s, sky_id %" PRId64, row->label, row->sky_id); 453 psFree(output); 454 return false; 455 } 456 if (!workdir && !row->workdir) { 457 psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined workdir: label: %s, sky_id %" PRId64, row->label, row->sky_id); 458 psFree(output); 459 return false; 460 } 461 462 psFree(row); 463 } 464 } 465 466 467 407 468 408 469 // start a transaction so we don't end up with an exp without any associted … … 438 499 stage, 439 500 stage_id, 501 0, 440 502 workdir ? workdir : row->workdir, 441 503 reduction ? reduction : row->reduction, … … 479 541 stage, 480 542 stage_id, 543 0, 481 544 workdir ? workdir : row->workdir, 482 545 reduction ? reduction : row->reduction, … … 520 583 stage, 521 584 stage_id, 585 0, 522 586 workdir ? workdir : row->workdir, 523 587 reduction ? reduction : row->reduction, … … 544 608 } 545 609 610 if (strcmp(stage,"staticsky_multi") == 0) { 611 for (long i = 0; i < psArrayLength(output); i++) { 612 psMetadata *md = output->data[i]; 613 psS64 stage_id =0; 614 bool status = false; 615 psS32 num_inputs = psMetadataLookupS32(&status, md, "num_inputs"); 616 if (!status) { 617 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item num_inputs"); 618 return false; 619 } 620 staticskyRunRow *row = staticskyRunObjectFromMetadata(md); 621 stage_id = row->sky_id; 622 623 if (!row) { 624 psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into camRun"); 625 psFree(output); 626 return false; 627 } 628 629 // queue the exp 630 for (int filter_id = 0; filter_id < num_inputs; filter_id++) { 631 if (!pxaddQueueByCamID(config, 632 stage, 633 stage_id, 634 filter_id, 635 workdir ? workdir : row->workdir, 636 reduction ? reduction : row->reduction, 637 label ? label : row->label, 638 data_group ? data_group : (row->data_group ? row->data_group : (label ? label : row->label)), 639 dvodb ? dvodb : NULL, 640 note ? note : NULL, 641 image_only, 642 minidvodb, 643 minidvodb_group, 644 minidvodb_name 645 )) { 646 if (!psDBRollback(config->dbh)) { 647 psError(PS_ERR_UNKNOWN, false, "database error sfg"); 648 } 649 psError(PS_ERR_UNKNOWN, false, 650 "failed to trying to queue stage %s %" PRId64,stage, stage_id); 651 psFree(row); 652 psFree(output); 653 return false; 654 } 655 } 656 psFree(row); 657 } 658 } 659 660 661 662 546 663 psFree(output); 547 664 … … 585 702 } 586 703 if (strcmp(stage, "staticsky")==0) { 704 query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id"); 705 } 706 if (strcmp(stage, "staticsky_multi")==0) { 587 707 query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id"); 588 708 } … … 626 746 query = pxDataGet("addtool_find_pendingexp_staticsky.sql"); 627 747 } 628 748 if (strcmp(stage, "staticsky_multi")==0) { 749 query = pxDataGet("addtool_find_pendingexp_staticsky_multi.sql"); 750 } 751 629 752 630 753 if (!query) { … … 648 771 psStringAppend(&query, " GROUP BY %s", "sky_id"); 649 772 } 650 773 if (strcmp(stage, "staticsky_multi") == 0) { 774 //this group by is needed to join against all the warps (to get camera) 775 psStringAppend(&query, " GROUP BY %s", "sky_id, stage_extra1"); 776 } 651 777 // treat limit == 0 as "no limit" 652 778 if (limit) { … … 838 964 query = pxDataGet("addtool_find_processedexp_staticsky.sql"); 839 965 } 966 if (strcmp (stage,"staticsky_multi") == 0) { 967 query = pxDataGet("addtool_find_processedexp_staticsky_multi.sql"); 968 } 969 840 970 841 971 if (!query) { … … 948 1078 query = pxDataGet("addtool_revertprocessedexp_staticsky.sql"); 949 1079 } 1080 if (strcmp(stage, "staticsky_multi") == 0) { 1081 query = pxDataGet("addtool_revertprocessedexp_staticsky_multi.sql"); 1082 } 1083 1084 1085 950 1086 if (!query) { 951 1087 // rollback -
trunk/ippTools/src/flatcorr.c
r31375 r32832 666 666 "cam", 667 667 row->cam_id, 668 0, 668 669 row->workdir, 669 670 row->reduction, -
trunk/ippTools/src/pxadd.c
r31375 r32832 131 131 char *stage, 132 132 psS64 stage_id, 133 psS32 stage_extra1, 133 134 char *workdir, 134 135 char *reduction, … … 159 160 psMemSetPersistent(query, true); 160 161 } 162 if (strcmp(stage,"staticsky_multi") == 0) { 163 query = pxDataGet("addtool_queue_sky_id_multi.sql"); 164 psMemSetPersistent(query, true); 165 } 161 166 if (!query) { 162 167 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); … … 170 175 // on 32/64 171 176 if (!p_psDBRunQueryF(config->dbh, query, 177 stage_extra1 ? stage_extra1 : 0, 172 178 "new", // state 173 179 workdir ? workdir : "NULL", -
trunk/ippTools/src/pxadd.h
r31375 r32832 33 33 char *stage, 34 34 psS64 stage_id, 35 psS32 stage_extra1, 35 36 char *workdir, 36 37 char *reduction,
Note:
See TracChangeset
for help on using the changeset viewer.
