IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 15, 2008, 5:51:49 PM (18 years ago)
Author:
eugene
Message:

extensive fixes to make these two programs actually work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dvoTools/src/dvoApplyCorrLoop.c

    r11877 r20180  
    1010    pmChip *chip;
    1111    pmCell *cell;
    12     pmReadout *readout;
    1312
    1413    // psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, RECIPE_NAME);
     
    1716    pmFPAfile *input = psMetadataLookupPtr(&status, config->files, "DVOFLAT.INPUT");
    1817    if (!status) {
    19         psErrorStackPrint(stderr, "Can't find input data!\n");
     18        psErrorStackPrint(stderr, "Can't find input flat-field image\n");
     19        exit(EXIT_FAILURE);
     20    }
     21
     22    // select the input image
     23    pmFPAfile *corr = psMetadataLookupPtr(&status, config->files, "DVOFLAT.CORR");
     24    if (!status) {
     25        psErrorStackPrint(stderr, "Can't find correction image\n");
    2026        exit(EXIT_FAILURE);
    2127    }
     
    4046        }
    4147
     48        pmChip *corrChip = pmFPAviewThisChip(view, corr->fpa);
     49
    4250        // process each cell in the Chip
    4351        while ((cell = pmFPAviewNextCell(view, input->fpa, 1)) != NULL) {
     
    5058            }
    5159
    52             // process each of the readouts
    53             while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
    54                 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    55                     psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d, readout %d in dvoApplyCorr\n", view->chip, view->cell, view->readout);
    56                     psFree (view);
    57                     return false;
    58                 }
    59                 if (!readout->data_exists) continue;
    60 
    61                 // XXX put the function here which multiplies the input image and the correction image
    62                 dvoApplyCorrReadout (config, view, "DVOFLAT.INPUT", "DVOFLAT.CORR");
    63 
    64                 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
    65                     psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d, readout %d in dvoApplyCorr\n", view->chip, view->cell, view->readout);
    66                     psFree (view);
    67                     return false;
    68                 }
     60            // multiply the input image and the correction image
     61            if (!dvoApplyCorrReadout (cell, corrChip)) {
     62                psError(PS_ERR_UNKNOWN, false, "failed to apply correction to chip %d, cell %d dvoApplyCorr\n", view->chip, view->cell);
     63                psFree (view);
     64                return false;
    6965            }
    7066            if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
Note: See TracChangeset for help on using the changeset viewer.