Changeset 38846
- Timestamp:
- Oct 12, 2015, 3:40:59 PM (11 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 6 added
- 2 edited
-
share/Makefile.am (modified) (5 diffs)
-
share/addtool_find_ffsummary_id.sql (added)
-
share/addtool_find_ffsummary_id_dvo.sql (added)
-
share/addtool_find_pendingexp_ffsummary.sql (added)
-
share/addtool_find_processedexp_ffsummary.sql (added)
-
share/addtool_queue_ffsummary.sql (added)
-
share/addtool_revertprocessedexp_ffsummary.sql (added)
-
src/addtool.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/share/Makefile.am
r38563 r38846 12 12 addtool_find_ff_id.sql \ 13 13 addtool_find_ff_id_dvo.sql \ 14 addtool_find_ffsummary_id.sql \ 15 addtool_find_ffsummary_id_dvo.sql \ 14 16 addtool_find_skycal_id_dvo.sql \ 15 17 addtool_find_skycal_id.sql \ … … 22 24 addtool_find_pendingexp_diff.sql \ 23 25 addtool_find_pendingexp_ff.sql \ 26 addtool_find_pendingexp_ff_summary.sql \ 24 27 addtool_find_pendingexp_skycal.sql \ 25 28 addtool_find_pendingexp_stack.sql \ … … 29 32 addtool_find_processedexp_diff.sql \ 30 33 addtool_find_processedexp_ff.sql \ 34 addtool_find_processedexp_ff_summary.sql \ 31 35 addtool_find_processedexp_skycal.sql \ 32 36 addtool_find_processedexp_stack.sql \ … … 39 43 addtool_queue_diff_id.sql \ 40 44 addtool_queue_ff_id.sql \ 45 addtool_queue_ffsummary_id.sql \ 41 46 addtool_queue_stack_id.sql \ 42 47 addtool_queue_sky_id_multi.sql \ … … 47 52 addtool_revertprocessedexp_diff.sql \ 48 53 addtool_revertprocessedexp_ff.sql \ 54 addtool_revertprocessedexp_ffsummary.sql \ 49 55 addtool_revertprocessedexp_skycal.sql \ 50 56 addtool_revertprocessedexp_stack.sql \ -
trunk/ippTools/src/addtool.c
r38608 r38846 156 156 if (strcmp(stage, "fullforce")==0) { 157 157 pxAddLabelSearchArgs (config, where, "-label", "fullForceRun.label", "=="); //define using skycalRun label 158 pxAddLabelSearchArgs (config, where, "-data_group","fullForceRun.data_group", "=="); 159 PXOPT_COPY_STR(config->args, where, "-reduction", "fullForceRun.reduction", "=="); 160 } 161 if (strcmp(stage, "fullforce_summary")==0) { 162 //should be nearly identical to fullforce (uses the same tables) 163 pxAddLabelSearchArgs (config, where, "-label", "fullForceRun.label", "=="); 158 164 pxAddLabelSearchArgs (config, where, "-data_group","fullForceRun.data_group", "=="); 159 165 PXOPT_COPY_STR(config->args, where, "-reduction", "fullForceRun.reduction", "=="); … … 315 321 } 316 322 323 if (strcmp(stage,"fullforce_summary") == 0) { 324 if (dvodb ) { 325 psTrace("addtool.c", PS_LOG_INFO, "dvodb argument found (%s) using addtool_find_ffsummary_id_dvo.sql\n%s\n", dvodb,stage); 326 // find the skycal_id of all the exposures that we want to queue up. 327 bare_query = pxDataGet("addtool_find_ffsummary_id_dvo.sql"); 328 // user supplied dvodb 329 psStringAppend(&dvodb_string, "addRun.dvodb = '%s'", dvodb); 330 } else { 331 psTrace("addtool.c", PS_LOG_INFO, "dvodb argument not found using addtool_ffsummary_id.sql\n%s\n",stage); 332 // find the skycal_id of all the exposures that we want to queue up. 333 bare_query = pxDataGet("addtool_find_ffsummary_id.sql"); 334 // inherit dvodb from skycalRun, avoid matching NULL 335 psStringAppend(&dvodb_string, "(fullForceRun.dvodb IS NOT NULL AND previous_dvodb = fullForceRun.dvodb)"); 336 // this is silly, there is no dvodb in skycalRun...? 337 } 338 } 339 317 340 318 341 … … 350 373 351 374 } 375 if (strcmp(stage,"fullforce_summary") == 0) { 376 //ff needs the ra /deg stuff 377 psStringAppend(&query, " AND radeg >= %f", minra); 378 psStringAppend(&query, " AND radeg <= %f", maxra); 379 psStringAppend(&query, " AND decdeg >= %f", mindec); 380 psStringAppend(&query, " AND decdeg <= %f", maxdec); 381 382 } 352 383 353 384 psFree(whereClause); … … 404 435 if (strcmp(stage,"fullforce") == 0) { 405 436 psStringAppend(&query, " GROUP BY ff_id, warp_id "); //this needs checking, but I think it shoul be fine? it groups by lots of stuff (including stack - we only want one of each stack in there 437 } 438 if (strcmp(stage,"fullforce_summary") == 0) { 439 psStringAppend(&query, " GROUP BY ff_id "); //needs to be checked, but should be fine: want 1 ff summary cmf. 406 440 } 407 441 … … 592 626 psMetadata *md = output->data[i]; 593 627 628 fullForceRunRow *row = fullForceRunObjectFromMetadata(md); 629 630 if (!row) { 631 psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into fullforceRun"); 632 psFree(output); 633 return false; 634 } 635 636 if (!dvodb) { // there's no skycalRun.dvodb 637 psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined dvodb: label: %s, ff_id %" PRId64, row->label, row->ff_id); 638 psFree(output); 639 return false; 640 } 641 if (!workdir && !row->workdir) { 642 psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined workdir: label: %s, ff_id %" PRId64, row->label, row->ff_id); 643 psFree(output); 644 return false; 645 } 646 647 psFree(row); 648 } 649 } 650 651 if (strcmp(stage,"fullforce_summary") == 0) { 652 for (long i = 0; i < psArrayLength(output); i++) { 653 psMetadata *md = output->data[i]; 654 //i believe this is correct for ff_summary as well: 594 655 fullForceRunRow *row = fullForceRunObjectFromMetadata(md); 595 656 … … 908 969 psFree(row); 909 970 } 971 } 972 if (strcmp(stage,"fullforce_summary") == 0) { 973 for (long i = 0; i < psArrayLength(output); i++) { 974 psMetadata *md = output->data[i]; 975 psS64 stage_id =0; 976 977 fullForceRunRow *row = fullForceRunObjectFromMetadata(md); 978 stage_id = row->ff_id; 979 bool status = false; 980 981 if (!row) { 982 psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into fullforceRun"); 983 psFree(output); 984 return false; 985 } 986 987 // queue the exp 988 if (!pxaddQueueByCamID(config, 989 stage, 990 stage_id, 991 0, 992 workdir ? workdir : row->workdir, 993 reduction ? reduction : row->reduction, 994 label ? label : row->label, 995 data_group ? data_group : (row->data_group ? row->data_group : (label ? label : row->label)), 996 dvodb ? dvodb : NULL, 997 note ? note : NULL, 998 image_only, 999 minidvodb, 1000 minidvodb_group, 1001 minidvodb_name 1002 )) { 1003 if (!psDBRollback(config->dbh)) { 1004 psError(PS_ERR_UNKNOWN, false, "database error sfg"); 1005 } 1006 psError(PS_ERR_UNKNOWN, false, 1007 "failed to trying to queue stage %s %" PRId64,stage, stage_id); 1008 psFree(row); 1009 psFree(output); 1010 return false; 1011 } 1012 psFree(row); 1013 } 910 1014 } 911 1015 … … 968 1072 if (strcmp(stage, "fullforce")==0) { 969 1073 query = psStringCopy("UPDATE addRun JOIN fullForceResult on (ff_id = stage_id and warp_id = stage_extra1 and stage = 'fullforce') JOIN fullForceRun on (ff_id)"); 1074 } 1075 if (strcmp(stage, "fullforce_summary")==0) { 1076 query = psStringCopy("UPDATE addRun JOIN fullForceSummary on (ff_id = stage_id and stage = 'fullforce_summary') JOIN fullForceRun on (ff_id)"); 970 1077 } 971 1078 … … 1024 1131 query = pxDataGet("addtool_find_pendingexp_ff.sql"); 1025 1132 } 1133 if (strcmp(stage, "fullforce_summary")==0) { 1134 query = pxDataGet("addtool_find_pendingexp_ffsummary.sql"); 1135 } 1026 1136 1027 1137 … … 1066 1176 } 1067 1177 } 1068 1069 // if (multi) {1070 // psStringAppend(&query, " , %s", "stage_id");1071 //}1072 1178 1179 if (strcmp(stage, "fullforce_summary") == 0) { 1180 //this group by is needed to join against all the warps (to get camera) 1181 psStringAppend(&query, "GROUP BY %s", "ff_id"); 1182 } 1073 1183 1074 1184 // treat limit == 0 as "no limit" … … 1305 1415 } else if (strcmp (stage,"fullforce") == 0) { 1306 1416 query = pxDataGet("addtool_find_processedexp_ff.sql"); 1307 1417 } else if (strcmp (stage,"fullforce_summary") == 0) { 1418 query = pxDataGet("addtool_find_processedexp_ffsummary.sql"); 1308 1419 } else { 1309 1420 psFree(where); … … 1430 1541 if (strcmp(stage, "fullforce") == 0) { 1431 1542 query = pxDataGet("addtool_revertprocessedexp_ff.sql"); 1543 } 1544 if (strcmp(stage, "fullforce_summary") == 0) { 1545 query = pxDataGet("addtool_revertprocessedexp_ffsummary.sql"); 1432 1546 } 1433 1547
Note:
See TracChangeset
for help on using the changeset viewer.
