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

Location:
trunk/ppbgrestore/src
Files:
3 edited

Legend:

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

    r25973 r26664  
    2222    // fprintf(stderr, "Found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "ppImage");
    2323
    24     fprintf(stderr, "Found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "ppbgrestore");
     24//    fprintf(stderr, "Found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "ppbgrestore");
    2525
    2626}
  • 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) {
  • trunk/ppbgrestore/src/ppbgrestoreParseCamera.c

    r26662 r26664  
    2727        return NULL;
    2828    }
    29     pmFPAfile *outBG = pmFPAfileDefineOutput(config, input->fpa, "PPBGRESTORE.BACKGROUND");
     29    // pmFPAfile *outBG = pmFPAfileDefineOutput(config, NULL, "PPBGRESTORE.BACKGROUND");
     30    pmFPAfile *outBG = pmFPAfileDefineFromFPA(config, input->fpa, 1, 1, "PPBGRESTORE.BACKGROUND");
    3031    if (!outBG) {
    3132        psError(PS_ERR_IO, false, _("Unable to generate bacgkround file from PPBGRESTORE.BACKGROUND"));
Note: See TracChangeset for help on using the changeset viewer.