IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11384


Ignore:
Timestamp:
Jan 29, 2007, 12:37:59 PM (19 years ago)
Author:
eugene
Message:

handle cases for BACKMDL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotImageMedian.c

    r11311 r11384  
    11# include "psphot.h"
    2 # define TESTSAVE
    32
    43// generate the median in NxN boxes, clipping heavily
     
    101100    }
    102101
     102    // we have 4 possibilities: (INTERNAL or I/O file) and (exists or not)
    103103    // select model pixels (from output background model file, or create internal file)
    104104    file = psMetadataLookupPtr (&status, config->files, "PSPHOT.BACKMDL");
     
    107107        model = pmFPAfileDefineInternal (config->files, "PSPHOT.BACKMDL", nx, ny, PS_TYPE_F32);
    108108    } else {
    109         // we are using PSPHOT.BACKMDL as an I/O file: select readout or create
    110         model = pmFPAviewThisReadout (view, file->fpa);
    111         if (model == NULL) {
    112             // readout does not yet exist: create from input
    113             pmFPAfileCopyStructureView (file->fpa, inFPA, DX, DY, view);
     109        if (file->mode == PM_FPA_MODE_INTERNAL) {
     110            model = file->readout;
     111        } else {
     112            // we are using PSPHOT.BACKMDL as an I/O file: select readout or create
    114113            model = pmFPAviewThisReadout (view, file->fpa);
    115             if ((nx != model->image->numCols) || (ny != model->image->numRows)) {
    116                 psError (PSPHOT_ERR_PROG, true, "inconsistent sizes for model dimensions");
    117                 return false;
     114            if (model == NULL) {
     115                // readout does not yet exist: create from input
     116                pmFPAfileCopyStructureView (file->fpa, inFPA, DX, DY, view);
     117                model = pmFPAviewThisReadout (view, file->fpa);
     118                if ((nx != model->image->numCols) || (ny != model->image->numRows)) {
     119                    psError (PSPHOT_ERR_PROG, true, "inconsistent sizes for model dimensions");
     120                    return false;
     121                }
    118122            }
    119123        }
Note: See TracChangeset for help on using the changeset viewer.