Changeset 26662 for trunk/ppbgrestore/src/ppbgrestoreLoop.c
- Timestamp:
- Jan 22, 2010, 2:02:53 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/ppbgrestore/src/ppbgrestoreLoop.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppbgrestore/src/ppbgrestoreLoop.c
r25974 r26662 30 30 exit(PS_EXIT_PROG_ERROR); 31 31 } 32 pmFPAfile *background= psMetadataLookupPtr(&status, config->files, "PPBGRESTORE.BACKGROUND"); 33 if (!status) { 34 psErrorStackPrint(stderr, "Can't find output data!\n"); 35 ppbgrestoreCleanup(config, options); 36 exit(PS_EXIT_PROG_ERROR); 37 } 38 bool save_background = psMetadataLookupBool(&status, config->arguments, "SAVE_BACKGROUND"); 32 39 33 40 pmFPAview *view = pmFPAviewAlloc(0);// View for level of interest … … 90 97 } 91 98 output->save = true; 99 background->save = save_background; 92 100 93 101 psImageBinning *binning = psphotBackgroundBinning(image, config); … … 96 104 return false; 97 105 } 98 pmReadout *background = pmFPAfileDefineInternal (config->files, "PSPHOT.BACKGND", image->numCols, image->numRows, PS_TYPE_F32); 106 pmReadout *backgroundRO = pmFPAviewThisReadout(&roView, background->fpa); 107 // pmReadout *backgroundRO = pmFPAfileDefineInternal (config->files, "PSPHOT.BACKGND", image->numCols, image->numRows, PS_TYPE_F32); 108 backgroundRO->image = psImageAlloc(image->numCols, image->numRows, PS_TYPE_F32); 99 109 100 110 // linear interpolation to full-scale 101 if (!psImageUnbin (background ->image, modelRO->image, binning)) {111 if (!psImageUnbin (backgroundRO->image, modelRO->image, binning)) { 102 112 psError (PSPHOT_ERR_PROG, true, "inconsistent sizes for unbinning"); 103 113 psFree(binning); … … 105 115 } 106 116 psFree(binning); 107 psF32 **backData = background ->image->data.F32;117 psF32 **backData = backgroundRO->image->data.F32; 108 118 109 // Do the background subtraction119 // Undo the background subtraction 110 120 int numCols = image->numCols, numRows = image->numRows; // Size of image 111 121 long nancount = 0; … … 137 147 psWarning("%ld infinite pixels found in background %ld pixels were finite\n", nancount, finitecount); 138 148 } 139 pmFPAfileDropInternal(config->files, "PSPHOT.BACKGND");149 // pmFPAfileDropInternal(config->files, "PSPHOT.BACKGND"); 140 150 141 151 // Close chip
Note:
See TracChangeset
for help on using the changeset viewer.
