Changeset 34800 for trunk/ppBackground/src/ppBackgroundRestore.c
- Timestamp:
- Dec 11, 2012, 2:04:31 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppBackground/src/ppBackgroundRestore.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
trunk/ppBackground/src/ppBackgroundRestore.c
r34298 r34800 5 5 6 6 #include "ppBackground.h" 7 8 psImageBinning *ppBackgroundBinningByRecipe(const psImage *image, // Image for which to generate a bg model 9 const pmConfig *config, // Configuration 10 psString recipe_name, 11 psString Xbin_name, 12 psString Ybin_name 13 ) 14 { 15 bool status = true; 16 17 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, recipe_name); 18 assert (recipe); 19 20 // I have the fine image size, I know the binning factor, determine the ruff image size 21 psImageBinning *binning = psImageBinningAlloc(); 22 binning->nXfine = image->numCols; 23 binning->nYfine = image->numRows; 24 binning->nXbin = psMetadataLookupS32(&status, recipe, Xbin_name); 25 binning->nYbin = psMetadataLookupS32(&status, recipe, Ybin_name); 26 27 psImageBinningSetRuffSize(binning, PS_IMAGE_BINNING_CENTER); 28 psImageBinningSetSkip(binning, image); 29 30 return binning; 31 } 32 33 34 7 35 8 36 bool ppBackgroundRestore(pmChip *chip, const pmChip *background, const pmChip *pattern, … … 27 55 if (background) { 28 56 pmReadout *bgRO = pmFPAviewThisReadout(view, background->parent); // Readout with background 29 psImageBinning *binning = psphotBackgroundBinning(image, config); 57 58 psImageBinning *binning; 59 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPBACKGROUND_RECIPE); // Recipe 60 if (!recipe) { 61 binning = psphotBackgroundBinning(image, config); 62 } 63 else { 64 binning = ppBackgroundBinningByRecipe(image,config, 65 psMetadataLookupStr(NULL,recipe,"BINNING_RECIPE"), 66 psMetadataLookupStr(NULL,recipe,"BINNING_XNAME"), 67 psMetadataLookupStr(NULL,recipe,"BINNING_YNAME")); 68 } 69 70 fprintf(stderr,"%d %d %d %d\n",binning->nXfine,binning->nYfine,binning->nXbin,binning->nYbin); 30 71 if (!binning) { 31 72 psError(psErrorCodeLast(), false, "Unable to find background binning"); … … 49 90 for (int y = 0; y < numRows; y++) { 50 91 for (int x = 0; x < numCols; x++) { 92 if ((y % 250 == 0)&&(x % 250 == 0)) { 93 printf("%d %d %g\n",x,y,bgImage->data.F32[y][x]); 94 } 51 95 image->data.F32[y][x] += bgImage->data.F32[y][x]; 96 52 97 } 53 98 }
Note:
See TracChangeset
for help on using the changeset viewer.
