Changeset 12131 for trunk/ippTools/src/camtool.c
- Timestamp:
- Feb 28, 2007, 6:44:37 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/camtool.c (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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 {
Note:
See TracChangeset
for help on using the changeset viewer.
