IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 12, 2006, 8:59:15 PM (20 years ago)
Author:
eugene
Message:

tests on non-poisson errors, updates to image background, tests of systematic biases, updates to use pmFPAfile paradigm

File:
1 edited

Legend:

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

    r6727 r6851  
    55bool psphotSkyReplace (pmConfig *config, pmFPAview *view) {
    66
    7     bool status;
     7    // find the currently selected readout
     8    pmReadout *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT");
     9    if (readout == NULL) psAbort ("psphot", "input not defined");
    810
    9     // find the currently selected readout
    10     //  psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PSPHOT");
    11     pmFPAfile *input   = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT");
    12     pmReadout *readout = pmFPAviewThisReadout (view, input->fpa);
     11    // select background pixels, from output background file, or create
     12    pmReadout *background = pmFPAfileThisReadout (config->files, view, "PSPHOT.BACKGND");
     13    if (background == NULL) psAbort ("psphot", "background not defined");
    1314
    1415    // select the corresponding images
    15     psImage *image = readout->image;
    16     psImage *mask  = readout->mask;
    17 
    18     // select background pixels, from output background file, or create
    19     psImage *background = pmFPAfileReadoutImage (config->files, view, "PSPHOT.BACKGND", 0, 0, PS_TYPE_F32);
    20     if (background == NULL) {
    21         return false;
    22     }
     16    psF32 **image = readout->image->data.F32;
     17    psU8  **mask  = readout->mask->data.U8;
     18    psF32 **back  = background->image->data.F32;
    2319
    2420    // replace the background model
    25     for (int j = 0; j < image->numRows; j++) {
    26         for (int i = 0; i < image->numCols; i++) {
    27             if (!mask->data.U8[j][i]) {
    28                 image->data.F32[j][i] += background->data.F32[j][i];
     21    for (int j = 0; j < readout->image->numRows; j++) {
     22        for (int i = 0; i < readout->image->numCols; i++) {
     23            if (!mask[j][i]) {
     24                image[j][i] += back[j][i];
    2925            }
    3026        }
    3127    }
    32    
    33     psFree (background);
    3428    return true;
    3529}
Note: See TracChangeset for help on using the changeset viewer.