Changeset 12131 for trunk/ippTools/src/warptool.c
- Timestamp:
- Feb 28, 2007, 6:44:37 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/warptool.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/warptool.c
r12105 r12131 239 239 } 240 240 241 psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag"); 242 if (!status) { 243 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag"); 244 return false; 245 } 246 if (!exp_tag) { 247 psError(PS_ERR_UNKNOWN, true, "-exp_tag is required"); 248 return false; 249 } 250 251 // defaults to 0 252 psS32 cam_version = psMetadataLookupS32(&status, config->args, "-cam_version"); 253 if (!status) { 254 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -cam_version"); 241 psString cam_id = psMetadataLookupStr(&status, config->args, "-cam_id"); 242 if (!status) { 243 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -cam_id"); 244 return false; 245 } 246 if (!cam_id) { 247 psError(PS_ERR_UNKNOWN, true, "-cam_id is required"); 255 248 return false; 256 249 } … … 267 260 // constrants 268 261 if (!warpInputExpInsert(config->dbh, 269 (psS32)atoi(warp_id), 270 exp_tag, 271 cam_version, 262 (psS64)atoll(warp_id), 263 (psS64)atoll(cam_id), 272 264 magiced 273 265 )) { … … 299 291 " USING(warp_id)\n" 300 292 " JOIN camProcessedExp\n" 301 " ON warpInputExp.exp_tag = camProcessedExp.exp_tag\n" 302 " AND warpInputExp.cam_version = camProcessedExp.cam_version\n" 293 " ON warpInputExp.cam_id = camProcessedExp.cam_id\n" 303 294 " WHERE\n" 304 295 " warpRun.state = 'run'\n" … … 357 348 358 349 if (psArrayLength(output)) { 350 if (!convertIdToStr(output)) { 351 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 352 psFree(output); 353 return false; 354 } 355 359 356 // negative simple so the default is true 360 357 if (!ippdbPrintMetadatas(stdout, output, "warpInputExp", !simple)) { … … 386 383 "SELECT\n" 387 384 " rawImfile.*,\n" 388 " warpInputExp.cam_ version\n"385 " warpInputExp.cam_id\n" 389 386 " FROM warpRun\n" 390 387 " JOIN warpInputExp\n" 391 388 " USING(warp_id)\n" 389 " JOIN camProcessedExp\n" 390 " ON warpInputExp.cam_id = camProcessedExp.cam_id" 391 " JOIN chipProcessedExp\n" 392 " ON camProcessedExp.chip_id = chipProcessedExp.chip_id" 392 393 " JOIN rawImfile\n" // is there any reason not to refer back to rawimfiles? 393 " ON warpInputExp.exp_tag = rawImfile.exp_tag\n"394 " ON chipProcessedExp.exp_tag = rawImfile.exp_tag\n" 394 395 " WHERE\n" 395 396 " warpRun.state = 'run'\n" … … 446 447 447 448 if (psArrayLength(output)) { 449 if (!convertIdToStr(output)) { 450 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 451 psFree(output); 452 return false; 453 } 454 448 455 // negative simple so the default is true 449 456 if (!ippdbPrintMetadatas(stdout, output, "warpInputImfile", !simple)) { … … 482 489 " USING(warp_id)\n" 483 490 " JOIN camProcessedExp\n" 484 " ON warpInputExp.exp_tag = camProcessedExp.exp_tag\n" 485 " AND warpInputExp.cam_version = camProcessedExp.cam_version\n" 491 " ON warpInputExp.cam_id = camProcessedExp.cam_id\n" 492 " JOIN chipProcessedExp\n" 493 " ON camProcessedExp.chip_id = chipProcessedExp.chip_id" 486 494 " JOIN rawExp\n" 487 " ON c amProcessedExp.exp_tag = rawExp.exp_tag\n"495 " ON chipProcessedExp.exp_tag = rawExp.exp_tag\n" 488 496 " LEFT JOIN warpSkyCellMap\n" 489 497 " ON warpInputExp.warp_id = warpSkyCellMap.warp_id\n" 490 " AND warpInputExp.exp_tag = warpSkyCellMap.exp_tag\n" 491 " AND warpInputExp.cam_version = warpSkyCellMap.cam_version\n" 498 " AND warpInputExp.cam_id = warpSkyCellMap.cam_id\n" 492 499 " WHERE\n" 493 500 " warpRun.state = 'run'\n" 494 501 " AND camProcessedExp.fault = 0\n" 495 502 " AND warpSkyCellMap.warp_id IS NULL\n" 496 " AND warpSkyCellMap.exp_tag IS NULL\n" 497 " AND warpSkyCellMap.cam_version IS NULL\n" 503 " AND warpSkyCellMap.cam_id IS NULL\n" 498 504 ); 499 505 … … 549 555 550 556 if (psArrayLength(output)) { 557 if (!convertIdToStr(output)) { 558 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 559 psFree(output); 560 return false; 561 } 562 551 563 // negative simple so the default is true 552 564 if (!ippdbPrintMetadatas(stdout, output, "warpInputExp", !simple)) { … … 681 693 " JOIN warpSkyCellMap\n" 682 694 " USING(warp_id)\n" 695 " JOIN camProcessedExp\n" 696 " ON warpSkyCellMap.cam_id = camProcessedExp.cam_id" 683 697 " JOIN chipProcessedImfile\n" 684 " ON warpSkyCellMap.exp_tag = chipProcessedImfile.exp_tag\n"698 " ON camProcessedExp.chip_id = chipProcessedImfile.chip_id" 685 699 " AND warpSkyCellMap.class_id = chipProcessedImfile.class_id\n" 686 700 " WHERE\n" … … 739 753 740 754 if (psArrayLength(output)) { 755 if (!convertIdToStr(output)) { 756 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 757 psFree(output); 758 return false; 759 } 760 741 761 // negative simple so the default is true 742 762 if (!ippdbPrintMetadatas(stdout, output, "warpSkyCellMap", !simple)) { … … 773 793 " JOIN warpSkyCellMap\n" 774 794 " USING(warp_id)\n" 795 " JOIN camProcessedExp\n" 796 " ON warpSkyCellMap.cam_id = camProcessedExp.cam_id" 797 " JOIN chipProcessedExp\n" 798 " ON camProcessedExp.chip_id = chipProcessedExp.chip_id" 775 799 " JOIN rawExp\n" 776 " ON warpSkyCellMap.exp_tag = rawExp.exp_tag\n"800 " ON chipProcessedExp.exp_tag = rawExp.exp_tag\n" 777 801 " LEFT JOIN warpSkyfile\n" 778 802 " ON warpRun.warp_id = warpSkyfile.warp_id\n" … … 837 861 838 862 if (psArrayLength(output)) { 863 if (!convertIdToStr(output)) { 864 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 865 psFree(output); 866 return false; 867 } 868 839 869 // negative simple so the default is true 840 870 if (!ippdbPrintMetadatas(stdout, output, "warpPendingSkyCell", !simple)) { … … 918 948 // XXX need to validate that this coresponds to an warpInputImfile 919 949 if (!warpSkyfileInsert(config->dbh, 920 (psS 32)atoi(warp_id),950 (psS64)atoll(warp_id), 921 951 skycell_id, 922 952 tess_id, … … 1125 1155 1126 1156 if (psArrayLength(output)) { 1157 if (!convertIdToStr(output)) { 1158 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 1159 psFree(output); 1160 return false; 1161 } 1162 1127 1163 // negative simple so the default is true 1128 1164 if (!ippdbPrintMetadatas(stdout, output, "warpSkyfile", !simple)) {
Note:
See TracChangeset
for help on using the changeset viewer.
