IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 27, 2007, 6:45:24 PM (18 years ago)
Author:
eugene
Message:

set up to replace masked pixels with background model; use chip median value for now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageReplaceBackground.c

    r15928 r15945  
    2828    psMaskType maskVal  = options->satMask | options->badMask | options->flatMask | options->blankMask;
    2929
     30    float meanValue = psMetadataLookupF32 (&status, recipe, "SKY_MEAN");
     31
    3032    // iterate over the cells and readout for this chip
    3133    while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
    32         psLogMsg ("ppImagePhotom", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
     34        psLogMsg ("ppImagePhotom", 5, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    3335        if (! cell->process || ! cell->file_exists) { continue; }
    3436
     
    4648            }
    4749            if (!modelReadout) {
    48                 psphotImageMedian (config, view, maskVal);
     50                psphotModelBackground (config, view, "PPIMAGE.CHIP", maskVal);
    4951                modelFile = psMetadataLookupPtr(&status, config->files, "PSPHOT.BACKMDL");
    5052                assert (modelFile);
    51                 modelReadout = pmFPAviewThisReadout (view, modelFile->fpa);
     53                if (modelFile->mode == PM_FPA_MODE_INTERNAL) {
     54                  modelReadout = modelFile->readout;
     55                } else {
     56                  modelReadout = pmFPAviewThisReadout (view, modelFile->fpa);
     57                }
    5258                assert (modelReadout);
    5359            }
     
    6268                for (int ix = 0; ix < image->numCols; ix++) {
    6369                    if (!(mask->data.U8[iy][ix] && maskVal)) continue;
    64                     image->data.F32[iy][ix] = psImageUnbinPixel_V2(ix, iy, model, binning);
     70                    if (1) {
     71                        image->data.F32[iy][ix] = meanValue;
     72                    } else {
     73                        image->data.F32[iy][ix] = psImageUnbinPixel_V2(ix, iy, model, binning);
     74                    }
    6575                }
    6676            }
    6777        }
    6878    }
     79    pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
     80    pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");
    6981    return true;
    7082}
Note: See TracChangeset for help on using the changeset viewer.