IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 24, 2011, 11:03:32 AM (15 years ago)
Author:
rhenders
Message:

Changes to reflect those in Logger class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/src/StackBatch.c

    r31030 r31033  
    5858    fitsIn->readColumnUsingName(fitsIn, TLONG, "FLAGS2", 1, 1, nDet, flags2);
    5959
    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);
    6162    float mag;
    6263    long unmatched = 0, totalDetections = 0, numOfDuplicates = 0, numInvalidFlux = 0, numDetectionsOut = 0;
    6364
    64     this->base.logger->print(this->base.logger, MSG_INFO,
     65    this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch", 
    6566            "+---------------+---------+----------+------------------+---------------+--------------+\n");
    66     this->base.logger->print(this->base.logger, MSG_INFO,
     67    this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch", 
    6768            "|   Extension   | Rows in | Rows out | Missing from DVO | Duplicate IDs | Invalid Flux |\n");
    6869
     
    108109    }
    109110
    110     this->base.logger->print(this->base.logger, MSG_INFO,
     111    this->base.logger->print(this->base.logger, MSG_INFO, "StackBatch",
    111112            "|  %12s |  %5ld  |   %5ld  |      %5ld       |    %5ld      |    %5ld     |\n",
    112113            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",
    114115            "+---------------+---------+----------+------------------+---------------+--------------+\n");
    115116
     
    149150
    150151    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;
    152155
    153156
     
    172175    }
    173176
    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);
    175179    for (long s=0; s<nDet; s++) {
    176180
     
    271275
    272276    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;
    274280
    275281    long* ippIdets = (long*)calloc(this->MAXDETECT, sizeof(long));
     
    281287    fitsIn->readColumnUsingName(fitsIn, TSTRING, "MODEL_TYPE", 1, 1, nDet, modelTypes);
    282288
    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);
    284291    for (long i = 0; i<nDet; i++) {
    285292
     
    360367    createStackDetectionTable(this, fitsIn, filterIDs, surveyIDs, skycellIDs, exposureTime);
    361368    createStackApFlxTable(this, fitsIn, filterIDs, surveyIDs);
    362     printf("dsdsdddds\n\n");
    363369    createStackModelFitTable(this, fitsIn, filterIDs, surveyIDs);
    364370    createStackToImageTable(this, fitsIn);
     
    433439StackBatch* new_StackBatch(Logger* logger, int *argc, char **argv) {
    434440
    435     logger->print(logger, MSG_DEBUG, "StackBatch: Constructor\n");
     441    logger->print(logger, MSG_DEBUG, "StackBatch", "Constructor\n");
    436442    StackBatch *this = (StackBatch*)calloc(1, sizeof(StackBatch));
    437443
     
    456462int main(int argc, char **argv) {
    457463
    458     psTimerStart("stackbatch");
    459 
    460464//    ippToPsps_VersionPrint();
    461465
     
    463467
    464468    Logger* logger = new_Logger(NULL);
     469    logger->print(logger, MSG_INFO, "main", "Creating new stack batch\n");
    465470
    466471    StackBatch* stackBatch = new_StackBatch(logger, &argc, argv);
     
    470475    stackBatch->destroy(stackBatch);
    471476
    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 
    480477    // tidy up
    481     psTimerStop();
     478    logger->destroy(logger);
    482479    psLibFinalize();
    483     logger->destroy(logger);
    484480
    485481    return exitCode;
Note: See TracChangeset for help on using the changeset viewer.