Changeset 31033 for trunk/ippToPsps/src/StackBatch.c
- Timestamp:
- Mar 24, 2011, 11:03:32 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/src/StackBatch.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/src/StackBatch.c
r31030 r31033 58 58 fitsIn->readColumnUsingName(fitsIn, TLONG, "FLAGS2", 1, 1, nDet, flags2); 59 59 60 printf("Looping through %ld psf detections\n", nDet); 60 this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch", 61 "Looping through %ld psf detection rows from '%s'\n", nDet, extensionName); 61 62 float mag; 62 63 long unmatched = 0, totalDetections = 0, numOfDuplicates = 0, numInvalidFlux = 0, numDetectionsOut = 0; 63 64 64 this->base.logger->print(this->base.logger, MSG_INFO, 65 this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch", 65 66 "+---------------+---------+----------+------------------+---------------+--------------+\n"); 66 this->base.logger->print(this->base.logger, MSG_INFO, 67 this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch", 67 68 "| Extension | Rows in | Rows out | Missing from DVO | Duplicate IDs | Invalid Flux |\n"); 68 69 … … 108 109 } 109 110 110 this->base.logger->print(this->base.logger, MSG_INFO, 111 this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch", 111 112 "| %12s | %5ld | %5ld | %5ld | %5ld | %5ld |\n", 112 113 extensionName, nDet, numDetectionsOut, unmatched, numOfDuplicates, numInvalidFlux); 113 this->base.logger->print(this->base.logger, MSG_INFO, 114 this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch", 114 115 "+---------------+---------+----------+------------------+---------------+--------------+\n"); 115 116 … … 149 150 150 151 long nDet = 0; 151 if (!fitsIn->moveToBinaryTableAndCountRows(fitsIn, "SkyChip.xrad", &nDet)) return false; 152 char extensionName[15]; 153 sprintf(extensionName, "SkyChip.xrad"); 154 if (!fitsIn->moveToBinaryTableAndCountRows(fitsIn, extensionName, &nDet)) return false; 152 155 153 156 … … 172 175 } 173 176 174 printf("Looping through %ld extended source detections\n", nDet); 177 this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch", 178 "Looping through %ld extended source detections from extension '%s'\n", nDet, extensionName); 175 179 for (long s=0; s<nDet; s++) { 176 180 … … 271 275 272 276 long nDet = 0; 273 if (!fitsIn->moveToBinaryTableAndCountRows(fitsIn, "SkyChip.xfit", &nDet)) return false; 277 char extensionName[40]; 278 sprintf(extensionName, "SkyChip.xfit"); 279 if (!fitsIn->moveToBinaryTableAndCountRows(fitsIn, extensionName, &nDet)) return false; 274 280 275 281 long* ippIdets = (long*)calloc(this->MAXDETECT, sizeof(long)); … … 281 287 fitsIn->readColumnUsingName(fitsIn, TSTRING, "MODEL_TYPE", 1, 1, nDet, modelTypes); 282 288 283 printf("Looping through %ld model fit rows\n", nDet); 289 this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch", 290 "Looping through %ld model fit rows from '%s'\n", nDet, extensionName); 284 291 for (long i = 0; i<nDet; i++) { 285 292 … … 360 367 createStackDetectionTable(this, fitsIn, filterIDs, surveyIDs, skycellIDs, exposureTime); 361 368 createStackApFlxTable(this, fitsIn, filterIDs, surveyIDs); 362 printf("dsdsdddds\n\n");363 369 createStackModelFitTable(this, fitsIn, filterIDs, surveyIDs); 364 370 createStackToImageTable(this, fitsIn); … … 433 439 StackBatch* new_StackBatch(Logger* logger, int *argc, char **argv) { 434 440 435 logger->print(logger, MSG_DEBUG, "StackBatch :Constructor\n");441 logger->print(logger, MSG_DEBUG, "StackBatch", "Constructor\n"); 436 442 StackBatch *this = (StackBatch*)calloc(1, sizeof(StackBatch)); 437 443 … … 456 462 int main(int argc, char **argv) { 457 463 458 psTimerStart("stackbatch");459 460 464 // ippToPsps_VersionPrint(); 461 465 … … 463 467 464 468 Logger* logger = new_Logger(NULL); 469 logger->print(logger, MSG_INFO, "main", "Creating new stack batch\n"); 465 470 466 471 StackBatch* stackBatch = new_StackBatch(logger, &argc, argv); … … 470 475 stackBatch->destroy(stackBatch); 471 476 472 double secs = psTimerMark("stackbatch");473 474 logger->print(logger, MSG_INFO, "stackbatch completed %ssuccessfully, with exit code %d, in %.1f %s\n",475 (exitCode == PS_EXIT_SUCCESS) ? "" : "un",476 exitCode,477 (secs<60.0) ? secs : (secs/60.0),478 (secs<60.0) ? "sec(s)" : "min(s)");479 480 477 // tidy up 481 psTimerStop();478 logger->destroy(logger); 482 479 psLibFinalize(); 483 logger->destroy(logger);484 480 485 481 return exitCode;
Note:
See TracChangeset
for help on using the changeset viewer.
