Changeset 12131
- Timestamp:
- Feb 28, 2007, 6:44:37 PM (19 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 2 added
- 20 edited
-
configure.ac (modified) (2 diffs)
-
scripts/camtest.sh (modified) (1 diff)
-
scripts/chiptest.sh (modified) (1 diff)
-
scripts/mapfile.txt (modified) (2 diffs)
-
scripts/warptest.sh (modified) (1 diff)
-
src/Makefile.am (modified) (2 diffs)
-
src/camtool.c (modified) (23 diffs)
-
src/camtoolConfig.c (modified) (5 diffs)
-
src/chiptool.c (modified) (9 diffs)
-
src/chiptoolConfig.c (modified) (5 diffs)
-
src/dettool.c (modified) (16 diffs)
-
src/difftool.c (modified) (6 diffs)
-
src/difftoolConfig.c (modified) (2 diffs)
-
src/pxio.c (added)
-
src/pxio.h (added)
-
src/pxtools.h (modified) (1 diff)
-
src/pzgetimfiles.c (modified) (1 diff)
-
src/regtool.c (modified) (5 diffs)
-
src/stacktool.c (modified) (6 diffs)
-
src/stacktoolConfig.c (modified) (1 diff)
-
src/warptool.c (modified) (14 diffs)
-
src/warptoolConfig.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/configure.ac
r12088 r12131 1 1 AC_PREREQ(2.59) 2 2 3 AC_INIT([ipptools], [1.1.1 3], [ipp-support@ifa.hawaii.edu])3 AC_INIT([ipptools], [1.1.14], [ipp-support@ifa.hawaii.edu]) 4 4 AC_CONFIG_SRCDIR([autogen.sh]) 5 5 … … 18 18 PKG_CHECK_MODULES([PSLIB], [pslib >= 1.1.0]) 19 19 PKG_CHECK_MODULES([PSMODULES], [psmodules >= 1.1.0]) 20 PKG_CHECK_MODULES([IPPDB], [ippdb >= 1.1.1 3])20 PKG_CHECK_MODULES([IPPDB], [ippdb >= 1.1.14]) 21 21 22 22 PXTOOLS_CFLAGS="${PSLIB_CFLAGS=} ${PSMODULES_CFLAGS=} ${IPPDB_CFLAGS=}" -
trunk/ippTools/scripts/camtest.sh
r12058 r12131 8 8 camtool -pendingimfile || exit 1 9 9 10 camtool -addprocessedexp - exp_tag t10.1 -uri file://camp -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -sigma_ra 1 -sigma_dec 2 -nastro 42 -path_base file:///foo -zp_mean 1 -zp_stdev 2 || exit 111 camtool -addprocessedexp - exp_tag t11.2 -uri file://camp -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -sigma_ra 1 -sigma_dec 2 -nastro 42 -path_base file:///foo -zp_mean 1 -zp_stdev 2 || exit 110 camtool -addprocessedexp -cam_id 1 -uri file://camp -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -sigma_ra 1 -sigma_dec 2 -nastro 42 -path_base file:///foo -zp_mean 1 -zp_stdev 2 || exit 1 11 camtool -addprocessedexp -cam_id 2 -uri file://camp -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -sigma_ra 1 -sigma_dec 2 -nastro 42 -path_base file:///foo -zp_mean 1 -zp_stdev 2 || exit 1 -
trunk/ippTools/scripts/chiptest.sh
r12058 r12131 8 8 9 9 for ID in `seq 0 3`; do 10 chiptool -addprocessedimfile - exp_tag t10.1 -class_id $ID -uri file://chipp-t10.$ID -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -path_base file:///foo || exit 110 chiptool -addprocessedimfile -chip_id 1 -class_id $ID -uri file://chipp-t10.$ID -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -path_base file:///foo || exit 1 11 11 done; 12 12 13 13 for ID in `seq 0 3`; do 14 chiptool -addprocessedimfile - exp_tag t11.2 -class_id $ID -uri file://chipp-t11.$ID -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -path_base file:///foo || exit 114 chiptool -addprocessedimfile -chip_id 2 -class_id $ID -uri file://chipp-t11.$ID -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -path_base file:///foo || exit 1 15 15 done; 16 16 -
trunk/ippTools/scripts/mapfile.txt
r12058 r12131 2 2 3 3 warpSkyCellMap METADATA 4 warp_id S32 1 4 warp_id S64 1 5 cam_id S64 1 5 6 skycell_id STR foo1 6 7 tess_id STR bar 7 exp_tag STR t10.18 cam_version S32 09 8 class_id STR quix1 10 9 fault S16 0 … … 12 11 13 12 warpSkyCellMap METADATA 14 warp_id S32 1 13 warp_id S64 1 14 cam_id S64 1 15 15 skycell_id STR foo2 16 16 tess_id STR bar 17 exp_tag STR t10.118 cam_version S32 019 17 class_id STR quix2 20 18 fault S16 0 -
trunk/ippTools/scripts/warptest.sh
r12029 r12131 7 7 warptool -definerun -mode warp -workdir file:///foo || exit 1 8 8 9 warptool -addinputexp -warp_id 1 -exp_tag t10.1 -cam_version 0 || exit 1 9 warptool -addinputexp -warp_id 1 -cam_id 1 || exit 1 10 warptool -addinputexp -warp_id 1 -cam_id 2 || exit 1 10 11 11 12 warptool -updaterun -warp_id 1 -state run || exit 1 -
trunk/ippTools/src/Makefile.am
r12075 r12131 32 32 pxinject.h \ 33 33 pxdata.h \ 34 pxio.h \ 34 35 pxtag.h \ 35 36 pzgetexp.h \ … … 48 49 pxtables.c \ 49 50 pxdata.c \ 51 pxio.c \ 50 52 pxtag.c 51 53 -
trunk/ippTools/src/camtool.c
r12093 r12131 100 100 " rawExp.workdir" 101 101 " FROM camPendingExp" 102 " JOIN chipProcessedExp" 103 " USING(chip_id)" 102 104 " JOIN rawExp" 103 " USING(exp_tag)"105 " ON chipProcessedExp.exp_tag = rawExp.exp_tag" 104 106 " LEFT JOIN camProcessedExp" 105 " USING(exp_tag)"107 " on camPendingExp.cam_id = camPendingExp.cam_id" 106 108 " LEFT JOIN camMask" 107 109 " ON camPendingExp.label = camMask.label" 108 110 " WHERE" 109 " camProcessedExp. exp_tagIS NULL"111 " camProcessedExp.cam_id IS NULL" 110 112 " AND camMask.label IS NULL" 111 113 ); … … 152 154 } 153 155 156 if (!convertIdToStr(output)) { 157 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 158 psFree(output); 159 return false; 160 } 161 154 162 // negate simple so the default is true 155 163 if (!ippdbPrintMetadatas(stdout, output, "camPendingExp", !simple)) { … … 170 178 psString query = psStringCopy( 171 179 "SELECT" 180 " camPendingExp.cam_id," 172 181 " chipProcessedImfile.*," 173 182 " rawExp.camera," … … 175 184 " FROM camPendingExp" 176 185 " JOIN chipProcessedImfile" 177 " USING( exp_tag, chip_version)"186 " USING(chip_id)" 178 187 " JOIN rawExp" 179 " USING(exp_tag)"188 " ON chipProcessedImfile.exp_tag = rawExp.exp_tag" 180 189 " LEFT JOIN camProcessedExp" 181 " USING(exp_tag)"190 " ON camPendingExp.cam_id = camProcessedExp.cam_id" 182 191 " LEFT JOIN camMask" 183 192 " ON camPendingExp.label = camMask.label" 184 193 " WHERE" 185 " camProcessedExp. exp_tagIS NULL"194 " camProcessedExp.cam_id IS NULL" 186 195 " AND camMask.label IS NULL" 187 196 ); … … 221 230 } 222 231 232 if (!convertIdToStr(output)) { 233 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 234 psFree(output); 235 return false; 236 } 237 238 if (!convertIdToStr(output)) { 239 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 240 psFree(output); 241 return false; 242 } 243 244 if (!convertIdToStr(output)) { 245 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 246 psFree(output); 247 return false; 248 } 249 250 if (!convertIdToStr(output)) { 251 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 252 psFree(output); 253 return false; 254 } 255 223 256 // negate simple so the default is true 224 257 if (!ippdbPrintMetadatas(stdout, output, "chipProcessedImfile", !simple)) { … … 237 270 PS_ASSERT_PTR_NON_NULL(config, false); 238 271 239 // det_id, exp_tag, recip240 // are required241 272 bool status = false; 242 psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag"); 243 if (!status) { 244 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag"); 245 return false; 246 } 247 if (!exp_tag) { 248 psError(PS_ERR_UNKNOWN, true, "-exp_tag is required"); 249 return false; 250 } 273 psString cam_id = psMetadataLookupStr(&status, config->args, "-cam_id"); 274 if (!status) { 275 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -cam_id"); 276 return false; 277 } 278 if (!cam_id) { 279 psError(PS_ERR_UNKNOWN, true, "-cam_id is required"); 280 return false; 281 } 282 251 283 psString uri = psMetadataLookupStr(&status, config->args, "-uri"); 252 284 if (!status) { … … 258 290 return false; 259 291 } 292 260 293 psString recipe = psMetadataLookupStr(&status, config->args, "-recip"); 261 294 if (!status) { … … 267 300 return false; 268 301 } 302 269 303 psF64 bg = psMetadataLookupF64(&status, config->args, "-bg"); 270 304 if (!status) { … … 272 306 return false; 273 307 } 308 274 309 psF64 bg_stdev = psMetadataLookupF64(&status, config->args, "-bg_stdev"); 275 310 if (!status) { … … 277 312 return false; 278 313 } 314 279 315 psF64 bg_mean_stdev = psMetadataLookupF64(&status, config->args, "-bg_mean_stdev"); 280 316 if (!status) { … … 282 318 return false; 283 319 } 320 284 321 psF32 sigma_ra = psMetadataLookupF32(&status, config->args, "-sigma_ra"); 285 322 if (!status) { … … 291 328 return false; 292 329 } 330 293 331 psF32 sigma_dec = psMetadataLookupF32(&status, config->args, "-sigma_dec"); 294 332 if (!status) { … … 300 338 return false; 301 339 } 340 302 341 psS32 nastro = psMetadataLookupS32(&status, config->args, "-nastro"); 303 342 if (!status) { … … 309 348 return false; 310 349 } 350 311 351 psF32 zp_mean = psMetadataLookupF32(&status, config->args, "-zp_mean"); 312 352 if (!status) { … … 318 358 return false; 319 359 } 360 320 361 psF32 zp_stdev = psMetadataLookupF32(&status, config->args, "-zp_stdev"); 321 362 if (!status) { … … 346 387 " FROM camPendingExp" 347 388 " LEFT JOIN camProcessedExp" 348 " USING( exp_tag)"389 " USING(cam_id)" 349 390 " WHERE" 350 " camProcessedExp. exp_tagIS NULL"351 " AND camPendingExp. exp_tag= '%s'"391 " camProcessedExp.cam_id IS NULL" 392 " AND camPendingExp.cam_id = '%s'" 352 393 ); 353 394 354 if (!p_psDBRunQuery(config->dbh, query, exp_tag)) {395 if (!p_psDBRunQuery(config->dbh, query, cam_id)) { 355 396 psError(PS_ERR_UNKNOWN, false, "database error"); 356 397 psFree(query); … … 382 423 // create a new camProcessedImfile object 383 424 camProcessedExpRow *row = camProcessedExpRowAlloc( 384 exp_tag, 385 pendingRow->cam_version, 386 pendingRow->chip_version, 425 pendingRow->cam_id, 426 pendingRow->chip_id, 387 427 pendingRow->label, 388 428 uri, … … 437 477 } 438 478 479 439 480 static bool processedexpMode(pxConfig *config) 440 481 { … … 460 501 " rawExp.workdir" 461 502 " FROM camProcessedExp" 503 " JOIN chipProcessedExp" 504 " USING(chip_id)" 462 505 " JOIN rawExp" 463 " USING(exp_tag)"506 " chipProcessedExp.exp_tag = rawExp.exp_tag" 464 507 " WHERE" 465 " camProcessedExp. exp_tag IS NOT NULL"508 " camProcessedExp.cam_id IS NOT NULL" // bongus 466 509 ); 467 510 … … 515 558 } 516 559 560 if (!convertIdToStr(output)) { 561 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 562 psFree(output); 563 return false; 564 } 565 566 if (!convertIdToStr(output)) { 567 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 568 psFree(output); 569 return false; 570 } 571 572 if (!convertIdToStr(output)) { 573 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 574 psFree(output); 575 return false; 576 } 577 578 if (!convertIdToStr(output)) { 579 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 580 psFree(output); 581 return false; 582 } 583 517 584 // negate simple so the default is true 518 585 if (!ippdbPrintMetadatas(stdout, output, "camProcessedExp", !simple)) { … … 570 637 return true; 571 638 } 639 572 640 573 641 static bool maskedMode(pxConfig *config) … … 605 673 } 606 674 675 if (!convertIdToStr(output)) { 676 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 677 psFree(output); 678 return false; 679 } 680 607 681 // negative simple so the default is true 608 682 if (!ippdbPrintMetadatas(stdout, output, "camMask", !simple)) { … … 617 691 } 618 692 693 619 694 static bool unblockMode(pxConfig *config) 620 695 { -
trunk/ippTools/src/camtoolConfig.c
r12058 r12131 46 46 // -pendingexp 47 47 psMetadata *pendingexpArgs = psMetadataAlloc(); 48 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_tag", 0, 49 "search by exposure ID", NULL); 50 psMetadataAddS32(pendingexpArgs, PS_LIST_TAIL, "-chip_version", 0, 51 "search for exposures with this chip version", -1); 52 psMetadataAddS32(pendingexpArgs, PS_LIST_TAIL, "-cam_version", 0, 53 "search for exposures with this cam version", -1); 48 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-cam_id", 0, 49 "search by camtool ID", NULL); 50 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-chip_id", 0, 51 "search by chiptool ID", NULL); 54 52 psMetadataAddU64(pendingexpArgs, PS_LIST_TAIL, "-limit", 0, 55 "limit result set to N items", 0);53 "limit result set to N items", 0); 56 54 psMetadataAddBool(pendingexpArgs, PS_LIST_TAIL, "-simple", 0, 57 55 "use the simple output format", false); … … 60 58 // -pendingimfile 61 59 psMetadata *pendingimfileArgs = psMetadataAlloc(); 62 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_tag", 0, 63 "search by exposure ID", NULL); 60 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-cam_id", 0, 61 "search by camtool ID", NULL); 62 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-chip_id", 0, 63 "search by chiptool ID", NULL); 64 64 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class", 0, 65 65 "search by class", NULL); … … 72 72 // -addprocessedexp 73 73 psMetadata *addprocessedexpArgs = psMetadataAlloc(); 74 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_tag", 0, 75 "define exp ID (required)", NULL); 74 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-cam_id", 0, 75 "define camtool ID (required)", NULL); 76 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-chip_id", 0, 77 "define chiptool ID (required)", NULL); 76 78 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-uri", 0, 77 79 "define URI (required)", NULL); … … 96 98 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-path_base", 0, 97 99 "define banana 1", NULL); 98 psMetadataAddS 8(addprocessedexpArgs, PS_LIST_TAIL, "-code", 0,99 "set fault code (required)", 0);100 psMetadataAddBool( pendingexpArgs, PS_LIST_TAIL, "-faulted", 0,101 "only return imfiles with a fault status set", false);100 psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-code", 0, 101 "set fault code (required)", 0); 102 psMetadataAddBool(addprocessedexpArgs, PS_LIST_TAIL, "-faulted", 0, 103 "only return imfiles with a fault status set", false); 102 104 103 105 // -processedexp 104 106 psMetadata *processedexpArgs = psMetadataAlloc(); 105 psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_tag", 0, 106 "search by exposure ID", NULL); 107 psMetadataAddS32(processedexpArgs, PS_LIST_TAIL, "-chip_version", 0, 108 "search for exposures with this chip version", -1); 109 psMetadataAddS32(processedexpArgs, PS_LIST_TAIL, "-cam_version", 0, 110 "search for exposures with this cam version", -1); 107 psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-cam_id", 0, 108 "search by camtool ID", NULL); 109 psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-chip_id", 0, 110 "search by chiptool ID", NULL); 111 111 psMetadataAddU64(processedexpArgs, PS_LIST_TAIL, "-limit", 0, 112 "limit result set to N items", 0);112 "limit result set to N items", 0); 113 113 psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-simple", 0, 114 114 "use the simple output format", false); 115 115 psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-faulted", 0, 116 "only return imfiles with a fault status set", false);116 "only return imfiles with a fault status set", false); 117 117 118 118 // -updateprocessedexp 119 119 psMetadata *updateprocessedexpArgs = psMetadataAlloc(); 120 psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-exp_tag", 0, 121 "search by exposure ID", NULL); 120 psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-cam_id", 0, 121 "search by camtool ID", NULL); 122 psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-chip_id", 0, 123 "search by chiptool ID", NULL); 122 124 psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-class", 0, 123 "search by class", NULL);125 "search by class", NULL); 124 126 psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-class_id", 0, 125 "search by class ID", NULL);126 psMetadataAddS 8(updateprocessedexpArgs, PS_LIST_TAIL, "-code", 0,127 "set fault code (required)", 0);127 "search by class ID", NULL); 128 psMetadataAddS16(updateprocessedexpArgs, PS_LIST_TAIL, "-code", 0, 129 "set fault code (required)", 0); 128 130 129 131 // -block … … 221 223 config->where = psMetadataAlloc(); 222 224 223 addWhereStr(exp_tag); 225 { 226 psString str = NULL; 227 bool status = false; 228 if ((str = psMetadataLookupStr(&status, config->args, "-cam_id"))) { 229 if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "cam_id", 0, "==", (psS64)atoll(str))) { 230 psError(PS_ERR_UNKNOWN, false, "failed to add item cam_id"); 231 psFree(config); 232 return NULL; 233 } 234 } 235 } 236 237 { 238 psString str = NULL; 239 bool status = false; 240 if ((str = psMetadataLookupStr(&status, config->args, "-chip_id"))) { 241 if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(str))) { 242 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 243 psFree(config); 244 return NULL; 245 } 246 } 247 } 248 224 249 // convert '-inst' to 'camera' 225 250 { -
trunk/ippTools/src/chiptool.c
r12096 r12131 169 169 "INSERT INTO chipPendingExp\n" 170 170 " SElECT\n" 171 " 0\n" // chip_id 171 172 " exp_tag,\n" 172 173 " 'my recipe',\n" // recipe … … 269 270 } 270 271 272 if (!convertIdToStr(output)) { 273 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 274 psFree(output); 275 return false; 276 } 277 271 278 // negative simple so the default is true 272 279 if (!ippdbPrintMetadatas(stdout, output, "chipPendingImfile", !simple)) { … … 307 314 psMetadata *where = psMetadataAlloc(); 308 315 bool status = false; 309 psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag"); if (!status) {310 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for - exp_tag");316 psString chip_id = psMetadataLookupStr(&status, config->args, "-chip_id"); if (!status) { 317 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -chip_id"); 311 318 psFree(query); 312 319 return false; 313 320 } 314 if ( exp_tag) {315 if (!psMetadataAddStr(where, PS_LIST_TAIL, " exp_tag", 0, "==", exp_tag)) {316 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");321 if (chip_id) { 322 if (!psMetadataAddStr(where, PS_LIST_TAIL, "chip_id", 0, "==", chip_id)) { 323 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 317 324 psFree(where); 318 325 psFree(query); … … 320 327 } 321 328 } 329 322 330 psString class_id = psMetadataLookupStr(&status, config->args, "-class_id"); 323 331 if (!status) { … … 517 525 } 518 526 527 if (!convertIdToStr(output)) { 528 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 529 psFree(output); 530 return false; 531 } 532 519 533 // negative simple so the default is true 520 534 if (!ippdbPrintMetadatas(stdout, output, "chipProcessedImfile", !simple)) { … … 606 620 return false; 607 621 } 622 } 623 624 if (!convertIdToStr(output)) { 625 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 626 psFree(output); 627 return false; 608 628 } 609 629 … … 799 819 800 820 return chipProcessedImfileRowAlloc( 821 imfile->chip_id, 801 822 imfile->exp_tag, 802 imfile->chip_version, 803 imfile->guide_version, 823 imfile->guide_id, 804 824 imfile->class_id, 805 825 recipe, … … 819 839 820 840 return chipProcessedExpRowAlloc( 841 pendingExp->chip_id, 821 842 pendingExp->exp_tag, 822 pendingExp->chip_version, 823 pendingExp->guide_version, 843 pendingExp->guide_id, 824 844 pendingExp->label, 825 845 pendingExp->expgroup, … … 834 854 835 855 return camPendingExpRowAlloc( 836 pendingExp->exp_tag, 837 0x0, // cam version 838 pendingExp->chip_version, 856 0, // cam version, assigned by db 857 pendingExp->chip_id, 839 858 pendingExp->label, 840 859 pendingExp->expgroup, -
trunk/ippTools/src/chiptoolConfig.c
r12058 r12131 91 91 // -pendingimfile 92 92 psMetadata *pendingimfileArgs = psMetadataAlloc(); 93 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-chip_id", 0, 94 "search by chip ID", NULL); 93 95 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_tag", 0, 94 " defineexposure ID", NULL);96 "search by exposure ID", NULL); 95 97 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class", 0, 96 " defineclass", NULL);98 "search by class", NULL); 97 99 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class_id", 0, 98 " defineclass ID", NULL);100 "search by class ID", NULL); 99 101 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-inst", 0, 100 " definecamera of interest", NULL);102 "search by camera of interest", NULL); 101 103 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-filter", 0, 102 " definefilter of interest", NULL);104 "search by filter of interest", NULL); 103 105 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-uri", 0, 104 " defineURL", NULL);106 "search by URL", NULL); 105 107 psMetadataAddU64(pendingimfileArgs, PS_LIST_TAIL, "-limit", 0, 106 108 "limit result set to N items", 0); … … 110 112 // -addprocessedimfile 111 113 psMetadata *addprocessedimfileArgs = psMetadataAlloc(); 114 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-chip_id", 0, 115 "define chip ID (required)", NULL); 116 #if 0 112 117 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag", 0, 113 "define exp_tag (required)", NULL); 118 "define exposure tag (required) (XXX redudant with chip_id)", NULL); 119 #endif 114 120 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, 115 121 "define class ID", NULL); … … 131 137 // -processedimfile 132 138 psMetadata *processedimfileArgs = psMetadataAlloc(); 139 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-chip_id", 0, 140 "define chip ID (required)", NULL); 133 141 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_tag", 0, 134 142 "define exposure ID", NULL); … … 152 160 // -updateprocessedimfile 153 161 psMetadata *updateprocessedimfileArgs = psMetadataAlloc(); 162 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-chip_id", 0, 163 "define chip ID (required)", NULL); 154 164 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag", 0, 155 165 "search by exposure ID", NULL); … … 257 267 config->where = psMetadataAlloc(); 258 268 269 { 270 psString str = NULL; 271 bool status = false; 272 if ((str = psMetadataLookupStr(&status, config->args, "-chip_id"))) { 273 if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(str))) { 274 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 275 psFree(config); 276 return NULL; 277 } 278 } 279 } 280 259 281 addWhereStr(exp_tag); 260 282 // convert '-inst' to 'camera' -
trunk/ippTools/src/dettool.c
r12123 r12131 25 25 #include <string.h> 26 26 #include <stdlib.h> 27 #include <stdint.h> 28 27 29 #include <ippdb.h> 28 30 … … 70 72 static bool register_detrend_imfileMode(pxConfig *config); 71 73 72 static bool convertDetIdToStr(psArray *mds);73 74 static detNormalizedStatImfileRow *detStackedToDetNormalizedStatImfile(pxConfig *config, detStackedImfileRow *stackedImfile); 74 75 static detNormalizedImfileRow *detNormalizedStatToDetNormalizedmfile(pxConfig *config, detNormalizedStatImfileRow *statImfile); … … 598 599 } 599 600 600 // convert det_id to a str externally 601 if (!convertDetIdToStr(detRuns)) { 602 psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string"); 601 if (!convertIdToStr(detRuns)) { 602 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 603 603 psFree(detRuns); 604 604 return false; … … 616 616 } 617 617 618 #if 0 618 619 // This function is used to convert the det_id from an int, as it is used 619 620 // internally, to be a string for external use. The rational being that we may … … 640 641 return true; 641 642 } 643 #endif 642 644 643 645 static bool definebyqueryMode(pxConfig *config) … … 1243 1245 1244 1246 // convert det_id to a string externaly 1245 if (!convert DetIdToStr(detRuns)) {1247 if (!convertIdToStr(detRuns)) { 1246 1248 psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string"); 1247 1249 psFree(detRuns); … … 1281 1283 { 1282 1284 psMetadata *where = psMetadataAlloc(); 1283 psMetadataAddS 32(where, PS_LIST_TAIL, "det_id", 0, "==", (psS32)atoi(det_id));1285 psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==", (psS64)atoll(det_id)); 1284 1286 detRuns = detRunSelectRowObjects(config->dbh, where, 0); 1285 1287 psFree(where); … … 1291 1293 // sanity check the result... we should have only found one det_id 1292 1294 if (psArrayLength(detRuns) != 1) { 1293 psAbort("found more then one detRun matching det_id % d(this should not happen)", (psS32)atoi(det_id));1295 psAbort("found more then one detRun matching det_id %" PRId64 " (this should not happen)", (psS64)atoll(det_id)); 1294 1296 return false; // unreachable 1295 1297 } … … 1624 1626 psFree(time_filter); 1625 1627 1626 if (!p_psDBRunQuery(config->dbh, query, (psS 32)newDet_id, (psS32)atoi(det_id))) {1628 if (!p_psDBRunQuery(config->dbh, query, (psS64)newDet_id, (psS64)atoll(det_id))) { 1627 1629 psError(PS_ERR_UNKNOWN, false, "database error"); 1628 1630 psFree(query); … … 1666 1668 1667 1669 // convert det_id to a string externaly 1668 if (!convert DetIdToStr(newDetRuns)) {1669 psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");1670 psFree( newDetRuns);1670 if (!convertIdToStr(detRuns)) { 1671 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 1672 psFree(detRuns); 1671 1673 return false; 1672 1674 } … … 1701 1703 1702 1704 // convert det_id to a string externaly 1703 if (!convert DetIdToStr(runs)) {1704 psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");1705 if (!convertIdToStr(runs)) { 1706 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 1705 1707 psFree(runs); 1706 1708 return false; … … 1784 1786 1785 1787 // convert det_id to a string externaly 1786 if (!convert DetIdToStr(output)) {1787 psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");1788 if (!convertIdToStr(output)) { 1789 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 1788 1790 psFree(output); 1789 1791 return false; … … 2907 2909 psMetadata *where = psMetadataAlloc(); 2908 2910 if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", 2909 (psS 32)atoi(det_id))) {2911 (psS64)atoll(det_id))) { 2910 2912 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag"); 2911 2913 psFree(where); … … 4870 4872 return false; 4871 4873 } 4872 if (!psMetadataAddS 32(where, PS_LIST_TAIL, "det_id", 0, "==", (psS32)atoi(det_id))) {4874 if (!psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==", (psS64)atoll(det_id))) { 4873 4875 psError(PS_ERR_UNKNOWN, false, "failed to add item det_id"); 4874 4876 psFree(where); … … 6332 6334 0.0, // solang max 6333 6335 label, // label 6334 atoi(parent)6336 (psS64)atoll(parent) 6335 6337 )) { 6336 6338 psError(PS_ERR_UNKNOWN, false, "database error"); … … 6435 6437 // the det_id is valid 6436 6438 if (!detNormalizedImfileInsert(config->dbh, 6437 (psS 32)atoi(det_id),6439 (psS64)atoll(det_id), 6438 6440 0, // the iteration is fixed at 0 6439 6441 class_id, -
trunk/ippTools/src/difftool.c
r12112 r12131 281 281 // constrants 282 282 if (!diffInputSkyfileInsert(config->dbh, 283 (psS 32)atoi(diff_id),284 (psS 32)atoi(warp_id),283 (psS64)atoll(diff_id), 284 (psS64)atoll(warp_id), 285 285 skycell_id, 286 286 tess_id, … … 322 322 " JOIN warpInputExp\n" 323 323 " ON diffInputSkyfile.warp_id = warpInputExp.warp_id\n" 324 " JOIN camProcessedExp\n" 325 " ON warpInputExp.cam_id = camProcessedExp.cam_id\n" 326 " JOIN chipProcessedExp\n" 327 " ON camProcessedExp.chip_id = chipProcessedExp.chip_id\n" 324 328 " JOIN rawExp\n" 325 " ON warpInputExp.exp_tag= rawExp.exp_tag\n"329 " ON chipProcessedExp.exp_tag = rawExp.exp_tag\n" 326 330 " WHERE\n" 327 331 " diffRun.state = 'run'\n" … … 379 383 380 384 if (psArrayLength(output)) { 385 if (!convertIdToStr(output)) { 386 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 387 psFree(output); 388 return false; 389 } 390 381 391 // negative simple so the default is true 382 392 if (!ippdbPrintMetadatas(stdout, output, "diffInputSkyfile", !simple)) { … … 474 484 475 485 if (psArrayLength(output)) { 486 if (!convertIdToStr(output)) { 487 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 488 psFree(output); 489 return false; 490 } 491 476 492 // negative simple so the default is true 477 493 if (!ippdbPrintMetadatas(stdout, output, "diffSkyfile", !simple)) { … … 532 548 533 549 if (!diffSkyfileInsert(config->dbh, 534 (psS 32)atoi(diff_id),550 (psS64)atoll(diff_id), 535 551 uri, 536 552 bg, … … 637 653 638 654 if (psArrayLength(output)) { 655 if (!convertIdToStr(output)) { 656 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 657 psFree(output); 658 return false; 659 } 660 639 661 // negative simple so the default is true 640 662 if (!ippdbPrintMetadatas(stdout, output, "diffSkyfile", !simple)) { -
trunk/ippTools/src/difftoolConfig.c
r12029 r12131 239 239 bool status = false; 240 240 if ((str = psMetadataLookupStr(&status, config->args, "-diff_id"))) { 241 if (!psMetadataAddS 32(config->where, PS_LIST_TAIL, "diff_id", 0, "==", (psS32)atoi(str))) {241 if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "diff_id", 0, "==", (psS64)atoll(str))) { 242 242 psError(PS_ERR_UNKNOWN, false, "failed to add item diff_id"); 243 243 psFree(config); … … 250 250 bool status = false; 251 251 if ((str = psMetadataLookupStr(&status, config->args, "-warp_id"))) { 252 if (!psMetadataAddS 32(config->where, PS_LIST_TAIL, "warp_id", 0, "==", (psS32)atoi(str))) {252 if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "warp_id", 0, "==", (psS64)atoll(str))) { 253 253 psError(PS_ERR_UNKNOWN, false, "failed to add item warp_id"); 254 254 psFree(config); -
trunk/ippTools/src/pxtools.h
r11047 r12131 27 27 # include <psmodules.h> 28 28 # include <ippdb.h> 29 29 30 # include "pxtoolsErrorCodes.h" 31 # include "pxio.h" 32 # include "pxdata.h" 30 33 31 34 // load these values from the db in the init stage -
trunk/ippTools/src/pzgetimfiles.c
r11859 r12131 624 624 return NULL; 625 625 } 626 if (!psMetadataAddS 32(md, PS_LIST_TAIL, "bytes", 0, NULL, (psS32)atoi(bytes))) {626 if (!psMetadataAddS64(md, PS_LIST_TAIL, "bytes", 0, NULL, (psS64)atoll(bytes))) { 627 627 psError(PS_ERR_UNKNOWN, false, "failed to add item bytes"); 628 628 psFree(md); -
trunk/ippTools/src/regtool.c
r12096 r12131 41 41 // static guidePendingExpRow *newToP1PendingExp(newExpRow *newExp); 42 42 static chipPendingExpRow *newTochipPendingExp(pxConfig *config, newExpRow *newExp); 43 static chipPendingImfileRow *rawImfileTochipPendingImfile(pxConfig *config, rawImfileRow *rawImfile);43 static chipPendingImfileRow *rawImfileTochipPendingImfile(pxConfig *config, psS64 chip_id, rawImfileRow *rawImfile); 44 44 45 45 static rawExpRow *newToRawExp(pxConfig *config, newExpRow *exp); … … 664 664 return false; 665 665 } 666 667 // get the chip_id for the imfiles 668 psS64 chip_id = psDBLastInsertID(config->dbh); 666 669 psFree(chipPendingExp); 667 670 … … 712 715 for (long i = 0; i < psArrayLength(rawImfiles); i++) { 713 716 rawImfileRow *rawImfile = rawImfiles->data[i]; 714 chipPendingImfileRow *pendingImfile = rawImfileTochipPendingImfile(config, rawImfile);717 chipPendingImfileRow *pendingImfile = rawImfileTochipPendingImfile(config, chip_id, rawImfile); 715 718 if (!chipPendingImfileInsertObject(config->dbh, pendingImfile)){ 716 719 // rollback … … 890 893 891 894 chipPendingExpRow *chipExp = chipPendingExpRowAlloc( 892 exp->exp_tag,893 0x0, // chip version XXX calc version number894 0xdeadbeef, // guide version895 label,896 "my recipe",897 NULL, // groupa898 NULL // dvodb895 0, // chip ID, assigned by db 896 exp->exp_tag, 897 0xdeadbeef, // guide version 898 label, 899 "my recipe", // recipe 900 NULL, // expgroup 901 NULL // dvodb 899 902 ); 900 903 … … 903 906 904 907 905 static chipPendingImfileRow *rawImfileTochipPendingImfile(pxConfig *config, rawImfileRow *rawImfile)908 static chipPendingImfileRow *rawImfileTochipPendingImfile(pxConfig *config, psS64 chip_id, rawImfileRow *rawImfile) 906 909 { 907 910 return chipPendingImfileRowAlloc( 908 rawImfile->exp_tag,909 0x0, // chip version XXX calc version number910 0xdeadbeef,// guide version911 rawImfile->class_id,912 "my recipe",913 rawImfile->uri911 chip_id, 912 rawImfile->exp_tag, 913 0xdeadbeef, // guide version 914 rawImfile->class_id, 915 "my recipe", // recipe 916 rawImfile->uri 914 917 ); 915 918 } -
trunk/ippTools/src/stacktool.c
r12114 r12131 192 192 return false; 193 193 } 194 if (!stackInputSkyfileInsert(config->dbh, run->stack_id, atoi((char *)item->data.V))) {194 if (!stackInputSkyfileInsert(config->dbh, run->stack_id, (psS64)atoll((char *)item->data.V))) { 195 195 if (!psDBRollback(config->dbh)) { 196 196 psError(PS_ERR_UNKNOWN, false, "database error"); … … 296 296 // constrants 297 297 if (!stackInputSkyfileInsert(config->dbh, 298 (psS 32)atoi(stack_id),299 (psS 32)atoi(warp_id)298 (psS64)atoll(stack_id), 299 (psS64)atoll(warp_id) 300 300 )) { 301 301 psError(PS_ERR_UNKNOWN, false, "database error"); … … 388 388 389 389 if (psArrayLength(output)) { 390 if (!convertIdToStr(output)) { 391 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 392 psFree(output); 393 return false; 394 } 395 390 396 // negative simple so the default is true 391 397 if (!ippdbPrintMetadatas(stdout, output, "stackInputSkyfile", !simple)) { … … 477 483 478 484 if (psArrayLength(output)) { 485 if (!convertIdToStr(output)) { 486 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 487 psFree(output); 488 return false; 489 } 490 479 491 // negative simple so the default is true 480 492 if (!ippdbPrintMetadatas(stdout, output, "stackSumSkyfile", !simple)) { … … 539 551 // constrants 540 552 if (!stackSumSkyfileInsert(config->dbh, 541 (psS 32)atoi(stack_id),553 (psS64)atoll(stack_id), 542 554 uri, 543 555 bg, … … 642 654 643 655 if (psArrayLength(output)) { 656 if (!convertIdToStr(output)) { 657 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 658 psFree(output); 659 return false; 660 } 661 644 662 if (!ippdbPrintMetadatas(stdout, output, "stackSumSkyfile", !simple)) { 645 663 psError(PS_ERR_UNKNOWN, false, "failed to print array"); -
trunk/ippTools/src/stacktoolConfig.c
r12029 r12131 226 226 bool status = false; 227 227 if ((str = psMetadataLookupStr(&status, config->args, "-warp_id"))) { 228 if (!psMetadataAddS 32(config->where, PS_LIST_TAIL, "warp_id", 0, "==", (psS32)atoi(str))) {228 if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "warp_id", 0, "==", (psS64)atoll(str))) { 229 229 psError(PS_ERR_UNKNOWN, false, "failed to add item warp_id"); 230 230 psFree(config); -
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)) { -
trunk/ippTools/src/warptoolConfig.c
r12029 r12131 60 60 psMetadata *updaterunArgs = psMetadataAlloc(); 61 61 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-warp_id", 0, 62 "define warp ID (required)", NULL);62 "define warptool ID (required)", NULL); 63 63 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-state", 0, 64 64 "set state (required)", NULL); … … 73 73 psMetadata *addinputexpArgs = psMetadataAlloc(); 74 74 psMetadataAddStr(addinputexpArgs, PS_LIST_TAIL, "-warp_id", 0, 75 "define warp ID (required)", NULL); 76 psMetadataAddStr(addinputexpArgs, PS_LIST_TAIL, "-exp_tag", 0, 77 "define exposure tag (required)", NULL); 78 psMetadataAddS32(addinputexpArgs, PS_LIST_TAIL, "-cam_version", 0, 79 "define phase 3 version of exposure tag (required)", 0); 75 "define warptool ID (required)", NULL); 76 psMetadataAddStr(addinputexpArgs, PS_LIST_TAIL, "-cam_id", 0, 77 "define camtool ID (required)", NULL); 80 78 psMetadataAddBool(addinputexpArgs, PS_LIST_TAIL, "-magiced", 0, 81 79 "has this exposure been magiced", false); … … 84 82 psMetadata *expArgs = psMetadataAlloc(); 85 83 psMetadataAddStr(expArgs, PS_LIST_TAIL, "-warp_id", 0, 86 "define warp ID (required)", NULL); 87 psMetadataAddStr(expArgs, PS_LIST_TAIL, "-exp_tag", 0, 88 "define exposure tag (required)", NULL); 89 psMetadataAddS32(expArgs, PS_LIST_TAIL, "-cam_version", 0, 90 "define phase 3 version of exposure tag (required)", 0); 84 "search by warptool ID", NULL); 85 psMetadataAddStr(expArgs, PS_LIST_TAIL, "-cam_id", 0, 86 "search by camtool ID", NULL); 91 87 psMetadataAddU64(expArgs, PS_LIST_TAIL, "-limit", 0, 92 88 "limit result set to N items", 0); … … 97 93 psMetadata *imfileArgs = psMetadataAlloc(); 98 94 psMetadataAddStr(imfileArgs, PS_LIST_TAIL, "-warp_id", 0, 99 "define warp ID (required)", NULL); 100 psMetadataAddStr(imfileArgs, PS_LIST_TAIL, "-exp_tag", 0, 101 "define exposure tag (required)", NULL); 102 psMetadataAddS32(imfileArgs, PS_LIST_TAIL, "-cam_version", 0, 103 "define phase 3 version of exposure tag (required)", 0); 95 "search by warptool ID", NULL); 96 psMetadataAddStr(imfileArgs, PS_LIST_TAIL, "-cam_id", 0, 97 "search by camtool ID", NULL); 104 98 psMetadataAddU64(imfileArgs, PS_LIST_TAIL, "-limit", 0, 105 99 "limit result set to N items", 0); … … 119 113 psMetadata *addoverlapArgs = psMetadataAlloc(); 120 114 psMetadataAddStr(addoverlapArgs, PS_LIST_TAIL, "-mapfile", 0, 121 " skycell <-> imfile mapping description", NULL);115 "path to skycell <-> imfile mapping file", NULL); 122 116 123 117 // -scmap 124 118 psMetadata *scmapArgs = psMetadataAlloc(); 125 119 psMetadataAddStr(scmapArgs, PS_LIST_TAIL, "-warp_id", 0, 126 "search by warp ID", NULL);120 "search by warptool ID", NULL); 127 121 psMetadataAddStr(scmapArgs, PS_LIST_TAIL, "-skycell_id", 0, 128 122 "searcy by skycell ID", NULL); … … 137 131 psMetadata *towarpedArgs = psMetadataAlloc(); 138 132 psMetadataAddStr(towarpedArgs, PS_LIST_TAIL, "-warp_id", 0, 139 "search by warp ID", NULL);133 "search by warptool ID", NULL); 140 134 psMetadataAddU64(towarpedArgs, PS_LIST_TAIL, "-limit", 0, 141 135 "limit result set to N items", 0); … … 146 140 psMetadata *addwarpedArgs = psMetadataAlloc(); 147 141 psMetadataAddStr(addwarpedArgs, PS_LIST_TAIL, "-warp_id", 0, 148 "define warp ID (required)", NULL);142 "define warptool ID (required)", NULL); 149 143 psMetadataAddStr(addwarpedArgs, PS_LIST_TAIL, "-skycell_id", 0, 150 144 "define skycell ID (required)", NULL); … … 161 155 psMetadata *warpedArgs = psMetadataAlloc(); 162 156 psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-warp_id", 0, 163 "search by warp ID", NULL);157 "search by warptool ID", NULL); 164 158 psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-skycell_id", 0, 165 159 "define skycell ID (required)", NULL); … … 168 162 psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-exp_tag", 0, 169 163 "define exposure tag (required)", NULL); 170 psMetadataAddS 32(warpedArgs, PS_LIST_TAIL, "-cam_version", 0,171 "define phase 3 version of exposure tag (required)", 0);164 psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-cam_id", 0, 165 "define phase 3 version of exposure tag (required)", NULL); 172 166 psMetadataAddU64(warpedArgs, PS_LIST_TAIL, "-limit", 0, 173 167 "limit result set to N items", 0); … … 286 280 bool status = false; 287 281 if ((str = psMetadataLookupStr(&status, config->args, "-warp_id"))) { 288 if (!psMetadataAddS 32(config->where, PS_LIST_TAIL, "warp_id", 0, "==", (psS32)atoi(str))) {282 if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "warp_id", 0, "==", (psS64)atoll(str))) { 289 283 psError(PS_ERR_UNKNOWN, false, "failed to add item warp_id"); 290 284 psFree(config);
Note:
See TracChangeset
for help on using the changeset viewer.
