IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 22, 2010, 4:54:06 AM (16 years ago)
Author:
bills
Message:

need to define the background image differently so that it gets a
separate fpa from the input work in progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppbgrestore/src/ppbgrestoreLoop.c

    r26662 r26664  
    104104            return false;
    105105        }
    106         pmReadout *backgroundRO = pmFPAviewThisReadout(&roView, background->fpa);
    107 //        pmReadout *backgroundRO = pmFPAfileDefineInternal (config->files, "PSPHOT.BACKGND", image->numCols, image->numRows, PS_TYPE_F32);
     106        pmReadout *backgroundRO;
     107#define USE_CELL
     108#ifdef USE_CELL
     109        pmCell *backgroundCell = pmFPAviewThisCell(&roView, background->fpa);
     110        backgroundRO = pmReadoutAlloc(backgroundCell);
     111#else
     112        backgroundRO = pmFPAviewThisReadout(&roView, background->fpa);
     113//        backgroundRO = pmFPAfileDefineInternal (config->files, "PSPHOT.BACKGND", image->numCols, image->numRows, PS_TYPE_F32);
     114#endif
    108115        backgroundRO->image = psImageAlloc(image->numCols, image->numRows, PS_TYPE_F32);
     116        backgroundRO->data_exists = true;
     117        backgroundRO->parent->data_exists = true;
     118        backgroundRO->parent->parent->data_exists = true;
    109119
    110120        // linear interpolation to full-scale
     
    120130        int numCols = image->numCols, numRows = image->numRows; // Size of image
    121131        long nancount = 0;
     132        long naninputs = 0;
    122133        long finitecount = 0;
    123134        for (int y = 0; y < numRows; y++) {
     
    140151                } else if (isfinite(imageval)) {
    141152                    // XXX: TODO:following ppImage we should not modify pixels that are masked.
    142                     image->data.F32[y][x] += bgvalue;
    143                 }
     153                    image->data.F32[y][x] = imageval + bgvalue;
     154                } else {
     155                    naninputs++;
     156                }
    144157            }
     158        }
     159        if (naninputs) {
     160            printf("%ld infinite pixels found in input image\n", naninputs);
    145161        }
    146162        if (nancount) {
Note: See TracChangeset for help on using the changeset viewer.