Changeset 31030 for trunk/ippToPsps/src/DetectionBatch.c
- Timestamp:
- Mar 23, 2011, 4:27:17 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/src/DetectionBatch.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/src/DetectionBatch.c
r31025 r31030 47 47 48 48 // open input FITS file 49 Fits* fitsIn = existing_Fits(this->base.inputFiles[0] );49 Fits* fitsIn = existing_Fits(this->base.inputFiles[0], this->base.logger); 50 50 if (fitsIn->getFilePtr(fitsIn) == NULL) return PS_EXIT_SYS_ERROR; 51 51 … … 157 157 } 158 158 159 this->base.logger->print(this->base.logger, MSG_INFO, 160 "+-----------+---------+----------+----------------+--------------+--------------+\n"); 161 this->base.logger->print(this->base.logger, MSG_INFO, 162 "| Extension | Rows in | Rows out | Duplicate IDs | Invalid Flux | Bogus det ID |\n"); 163 159 164 // loop round chips 160 165 for (int x=startX; x<stopX; x++) { … … 190 195 skylist = dvoSkyListByExternID(this->base.dvoConfig, sourceId, imageId, &image); 191 196 if (skylist == NULL) { 192 psError(PS_ERR_IO, false,197 this->base.logger->print(this->base.logger, MSG_ERROR, 193 198 "DVO: can't find SkyList for sourceId='%d' imageId='%d' (CCD = XY%s): skipping this chip\n", 194 199 sourceId, imageId, ccdNumber); … … 205 210 if (numDvoDetections > this->MAXDETECT ) { 206 211 207 psError(PS_ERR_IO, false, "Number of detections (%d) exceeds max limit (%ld)\n",212 this->base.logger->print(this->base.logger, MSG_ERROR,"Number of detections (%d) exceeds max limit (%ld)\n", 208 213 numDvoDetections, this->MAXDETECT); 209 214 error = true; … … 370 375 } 371 376 372 psLogMsg("ippToPsps", PS_LOG_INFO, 373 "+-----------+---------+----------+----------------+--------------+--------------+\n" 374 "| Extension | Rows in | Rows out | Duplicate IDs | Invalid Flux | Bogus det ID |\n" 377 this->base.logger->print(this->base.logger, MSG_INFO, 375 378 "| %s | %5ld | %5d | %5d | %5d | %5d |\n", 376 379 extensionName, nChipDetectionsIn, nChipDetectionsOut, numOfDuplicates, numInvalidFlux, numOfInvalidIppIDet); … … 385 388 } 386 389 387 psLogMsg("ippToPsps", PS_LOG_INFO, "Total detections for this exposure = %ld\n", totalDetectionsOut); 390 this->base.logger->print(this->base.logger, MSG_INFO, 391 "+-----------+---------+----------+----------------+--------------+--------------+\n"); 392 393 this->base.logger->print(this->base.logger, MSG_INFO, "Total detections for this exposure = %ld\n", totalDetectionsOut); 388 394 389 395 // free-up memory … … 419 425 writeResults(this, minObjID, maxObjID, totalDetectionsOut); 420 426 421 psLogMsg("ippToPsps", PS_LOG_INFO, "Data written for a total of %d chips/OTAs", nOta);427 this->base.logger->print(this->base.logger, MSG_INFO, "Data written for a total of %d chips/OTAs", nOta); 422 428 423 429 if (error || nOta < 1) this->base.exitCode = PS_EXIT_DATA_ERROR; … … 481 487 !haveExpName) { 482 488 483 printf("\n* ERROR with supplied arguments:");489 this->base.logger->print(this->base.logger, MSG_ERROR, "Problem with supplied arguments\n"); 484 490 this->print(this); 485 491 this->base.exitCode = PS_EXIT_CONFIG_ERROR; … … 493 499 Constructor. Returns a new DetectionBatch object. 494 500 */ 495 DetectionBatch* new_DetectionBatch(int *argc, char **argv) { 496 501 DetectionBatch* new_DetectionBatch(Logger* logger, int *argc, char **argv) { 502 503 logger->print(logger, MSG_DEBUG, "DetectionBatch: Constructor\n"); 497 504 DetectionBatch *this = (DetectionBatch*)calloc(1, sizeof(DetectionBatch)); 498 505 499 506 // call base-class constructor 500 if (!new_Batch(&this->base)) { 501 502 psError(PS_ERR_IO, false, "Unable to create Batch base-class object"); 503 return this; 504 } 507 new_Batch(logger, &this->base); 505 508 506 509 this->MAXDETECT = 200000; … … 525 528 psTimerStart("detectionbatch"); 526 529 527 ippToPsps_VersionPrint();530 // ippToPsps_VersionPrint(); 528 531 529 532 int exitCode; 530 533 531 DetectionBatch* detectionBatch = new_DetectionBatch(&argc, argv); 534 Logger* logger = new_Logger(NULL); 535 536 DetectionBatch* detectionBatch = new_DetectionBatch(logger, &argc, argv); 532 537 detectionBatch->base.run(detectionBatch); 533 538 exitCode = detectionBatch->base.exitCode; … … 537 542 double secs = psTimerMark("detectionbatch"); 538 543 539 psLogMsg("detectionbatch", 3, "detectionbatch completed %ssuccessfully, with exit code %d, in %.1f %s\n",544 logger->print(logger, MSG_INFO, "detectionbatch completed %ssuccessfully, with exit code %d, in %.1f %s\n", 540 545 (exitCode == PS_EXIT_SUCCESS) ? "" : "un", 541 546 exitCode, … … 546 551 psTimerStop(); 547 552 psLibFinalize(); 553 logger->destroy(logger); 548 554 549 555 return exitCode;
Note:
See TracChangeset
for help on using the changeset viewer.
