IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 18, 2007, 11:04:45 AM (19 years ago)
Author:
eugene
Message:

adding -corr to usage; fixing image loop

File:
1 edited

Legend:

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

    r11862 r11877  
    1414    // psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, RECIPE_NAME);
    1515
     16    // select the input image
    1617    pmFPAfile *input = psMetadataLookupPtr(&status, config->files, "DVOFLAT.INPUT");
    1718    if (!status) {
     
    2223    pmFPAview *view = pmFPAviewAlloc(0);// View for level of interest
    2324
    24     // load data at FPA leve
     25    // load data at FPA level
    2526    if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    26         psError(PS_ERR_UNKNOWN, false, "failed IO for fpa in psphot\n");
     27        psError(PS_ERR_UNKNOWN, false, "failed IO for fpa in dvoApplyCorr\n");
    2728        psFree(view);
    2829        return false;
     
    3435        if (!chip->process || !chip->file_exists) continue;
    3536        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
    36             psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d in psphot\n", view->chip);
     37            psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d in dvoApplyCorr\n", view->chip);
    3738            psFree (view);
    3839            return false;
     
    4344            psLogMsg ("dvoApplyCorrLoop", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    4445            if (!cell->process || !cell->file_exists) continue;
    45             if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE))
    46                 psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d in psphot\n", view->chip, view->cell);
    47             psFree (view);
    48             return false;
    49         }
    50 
    51         // process each of the readouts
    52         while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
    53             if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    54                 psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d, readout %d in psphot\n", view->chip, view->cell, view->readout);
     46            if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
     47                psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d in dvoApplyCorr\n", view->chip, view->cell);
    5548                psFree (view);
    5649                return false;
    5750            }
    58             if (!readout->data_exists) continue;
    5951
    60             // XXX put the function here which multiplies the input image and the correction image
    61             dvoApplyCorrReadout (config, view, "DVOFLAT.INPUT", "DVOFLAT.CORR");
     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;
    6260
     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                }
     69            }
    6370            if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
    64                 psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d, readout %d in psphot\n", view->chip, view->cell, view->readout);
     71                psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d in dvoApplyCorr\n", view->chip, view->cell);
    6572                psFree (view);
    6673                return false;
     
    6875        }
    6976        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
    70             psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d in psphot\n", view->chip, view->cell);
     77            psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d in dvoApplyCorr\n", view->chip);
    7178            psFree (view);
    7279            return false;
     
    7481    }
    7582    if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
    76         psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d in psphot\n", view->chip);
     83        psError(PS_ERR_UNKNOWN, false, "failed IO for fpa in dvoApplyCorr\n");
    7784        psFree (view);
    7885        return false;
Note: See TracChangeset for help on using the changeset viewer.