Changeset 33638 for branches/eam_branches/ipp-20111122/ppImage/src
- Timestamp:
- Mar 30, 2012, 2:49:37 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/ppImage/src
- Files:
-
- 7 edited
- 1 copied
-
. (modified) (1 prop)
-
Makefile.am (modified) (1 diff)
-
ppImage.h (modified) (4 diffs)
-
ppImageCheckNoise.c (copied) (copied from trunk/ppImage/src/ppImageCheckNoise.c )
-
ppImageDetrendPattern.c (modified) (4 diffs)
-
ppImageDetrendReadout.c (modified) (2 diffs)
-
ppImageLoop.c (modified) (2 diffs)
-
ppImageOptions.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/ppImage/src
- Property svn:mergeinfo changed
/trunk/ppImage/src merged: 33030,33243,33590
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20111122/ppImage/src/Makefile.am
r30655 r33638 59 59 ppImageParityFlip.c \ 60 60 ppImageCheckCTE.c \ 61 ppImageCheckNoise.c \ 61 62 ppImageFileCheck.c \ 62 63 ppImageVersion.c \ -
branches/eam_branches/ipp-20111122/ppImage/src/ppImage.h
r30655 r33638 40 40 bool doPatternRow; // Row pattern correction 41 41 bool doPatternCell; // Cell pattern correction 42 bool doPatternContinuity; // Cell continuity correction 42 43 bool doFringe; // Fringe subtraction 43 44 bool doPhotom; // Source identification and photometry … … 47 48 bool doStats; // call ppStats on the image 48 49 bool checkCTE; // measure pixel-based variance 50 bool checkNoise; // measure cell-level variance 49 51 bool applyParity; // Apply Cell parities 50 52 … … 109 111 psStatsOptions patternCellMean; // Statistic for mean 110 112 113 int patternContinuityEdgeWidth; // Size of box to use for edge matching. 114 111 115 int remnanceSize; // Size for remnance detection 112 116 float remnanceThresh; // Threshold for remnance detection … … 169 173 bool ppImageCheckCTE(pmConfig *config, ppImageOptions *options, pmFPAview *view); 170 174 175 bool ppImageCheckNoise(pmConfig *config, ppImageOptions *options, pmFPAview *view); 176 171 177 bool ppImageBurntoolMask(pmConfig *config, ppImageOptions *options, pmFPAview *view, pmReadout *mask); 172 178 -
branches/eam_branches/ipp-20111122/ppImage/src/ppImageDetrendPattern.c
r31066 r33638 18 18 pmCell *cell = NULL; 19 19 20 assert(options->doPatternRow || options->doPatternCell ); // do not call if not needed20 assert(options->doPatternRow || options->doPatternCell || options->doPatternContinuity); // do not call if not needed 21 21 assert(inputView->chip != -1); 22 22 assert(inputView->cell == -1); … … 40 40 if (psMetadataLookupBool(NULL,hdu->header,"PTRN_ROW")) { 41 41 psLogMsg("ppImage", PS_LOG_INFO, "Not performing row pattern correction as it has already been done."); 42 goto pattern_c ell;42 goto pattern_continuity; 43 43 } 44 44 … … 98 98 } 99 99 100 pattern_continuity: 101 102 // see the comment for PATTERN.ROW; the same rules apply for PATTERN.CELL 103 104 if (options->doPatternContinuity) { 105 int numCells = chip->cells->n; // Number of cells 106 psVector *tweak = psVectorAlloc(numCells, PS_TYPE_U8); // Tweak cell? 107 pmFPAview *view = pmFPAviewAlloc(0); // View for local processing 108 *view = *inputView; 109 110 pmHDU *hdu = pmHDUFromChip(chip); 111 if (psMetadataLookupBool(NULL,hdu->header,"PTRN_CON")) { 112 psLogMsg("ppImage", PS_LOG_INFO, "Not performing cell continuity correction as it has already been done."); 113 goto pattern_cell; 114 } 115 116 for (int i = 0; i < chip->cells->n; i++) { 117 view->cell = i; 118 119 pmCell *cell = chip->cells->data[i]; // Cell of interest 120 121 if (cell->readouts->n > 1) { 122 psLogMsg("ppImage", PS_LOG_INFO, "Not performing cell continuity correction on video cell."); 123 continue; 124 } 125 126 bool doPattern = false; 127 if (!doPatternForView(&doPattern, config, chip, view, RECIPE_NAME, "PATTERN.CONTINUITY.SUBSET")) { 128 ESCAPE(false, "Unable to determine whether row pattern matching should be applied."); 129 } 130 if (doPattern) { 131 tweak->data.U8[i] = 0xFF; 132 } 133 } 134 135 // Tweak the cells 136 if (!pmPatternContinuity(chip, tweak, options->patternCellBG, options->patternCellMean, 137 options->maskValue, options->darkMask,options->patternContinuityEdgeWidth)) { 138 psFree(tweak); 139 psFree(view); 140 return false; 141 } 142 psFree(tweak); 143 psFree(view); 144 145 psMetadataAddBool(hdu->header, PS_LIST_TAIL, "PTRN_CON",PS_META_REPLACE,"PATTERN.CONTINUITY correction applied",true); 146 } 147 100 148 pattern_cell: 101 102 // see the comment for PATTERN.ROW; the same rules apply for PATTERN.CELL 103 149 104 150 if (options->doPatternCell) { 105 151 int numCells = chip->cells->n; // Number of cells … … 131 177 tweak->data.U8[i] = 0xFF; 132 178 } 133 134 179 } 135 180 -
branches/eam_branches/ipp-20111122/ppImage/src/ppImageDetrendReadout.c
r29926 r33638 110 110 // offset information, we are not really getting exactly the right mapping from the 111 111 // original file. 112 // CZW 2012-03-21: I do not believe this is true anymore. In any case, this seems to be what 113 // ppImageReplaceBackground does to do sky subtraction. 112 114 psImageBinning *binning = psImageBinningAlloc(); 113 115 binning->nXruff = noiseMap->image->numCols; … … 119 121 psImageUnbin (noiseImage, noiseMap->image, binning); 120 122 psFree (binning); 123 // Stolen from pmSkySubtract.c 124 // CZW: Unneeded, as psImageUnbin does the bilinear interpolation? It still looks blocky. 125 /* psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, RECIPE_NAME); // Recipe */ 126 /* psAssert(recipe, "Should be there!"); */ 127 128 /* psS32 xBinFactor = psMetadataLookupS32(NULL,recipe,"NOISE.XBIN"); */ 129 /* psS32 yBinFactor = psMetadataLookupS32(NULL,recipe,"NOISE.YBIN"); */ 130 /* psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR, */ 131 /* noiseMap->image, */ 132 /* NULL, NULL, */ 133 /* 0, 0.0, 0.0, 0, 0, 0.0); */ 134 /* for (psS32 row = 0; row < input->image->numRows; row++) { */ 135 /* for (psS32 col = 0; col < input->image->numCols; col++) { */ 136 /* // We calculate the F32 value of the pixel coordinates in the */ 137 /* // binned image and then use a pixel interpolation routine to */ 138 /* // determine the value of the pixel at that location. */ 139 /* psF32 binRowF64 = ((psF32) row) / ((psF32) yBinFactor); */ 140 /* psF32 binColF64 = ((psF32) col) / ((psF32) xBinFactor); */ 141 /* // We add 0.5 to the pixel locations since the pixel */ 142 /* // interpolation routine defines the location of pixel */ 143 /* // (i, j) as (i+0.5, j+0.5). */ 144 /* binRowF64+= 0.5; */ 145 /* binColF64+= 0.5; */ 146 147 /* double binPixel; */ 148 /* if (!psImagePixelInterpolate(&binPixel, NULL, NULL, binColF64, binRowF64, interp)) { */ 149 /* psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); */ 150 /* psFree(interp); */ 151 /* psFree(noiseImage); */ 152 /* return NULL; */ 153 /* } */ 154 /* noiseImage->data.F32[row][col] = binPixel; */ 155 /* } */ 156 /* } */ 157 /* psFree(interp); */ 121 158 } 122 159 -
branches/eam_branches/ipp-20111122/ppImage/src/ppImageLoop.c
r30655 r33638 126 126 } 127 127 128 if (!ppImageCheckNoise (config, options, view)) { 129 ESCAPE("Unable to generate noisemap"); 130 } 131 128 132 // optionally degrade a MD image to 3pi exposure times 129 133 if (!ppImageAddNoise(config, options, view, input->fpa)){ … … 170 174 171 175 // Apply the pattern correction 172 if (options->doPatternRow || options->doPatternCell ) {176 if (options->doPatternRow || options->doPatternCell || options->doPatternContinuity) { 173 177 if (!ppImageDetrendPatternApply(config,chip,view,options)) { 174 178 ESCAPE("Unable to apply pattern corrections"); -
branches/eam_branches/ipp-20111122/ppImage/src/ppImageOptions.c
r31066 r33638 34 34 options->doPatternRow = false; // Row pattern correction 35 35 options->doPatternCell = false; // Cell pattern correction 36 options->doPatternContinuity = false; // Cell continuity correction 36 37 options->doFringe = false; // Fringe subtraction 37 38 options->doPhotom = false; // Source identification and photometry … … 40 41 options->doStats = false; // Measure and save image statistics 41 42 options->checkCTE = false; // Measure pixel-based variance 43 options->checkNoise = false; // Measure cell-level variances. 42 44 options->applyParity = false; // Apply Cell parities 43 45 options->doMaskStats = false; // Calculate mask fractions … … 253 255 options->doPatternRow = psMetadataLookupBool(NULL, recipe, "PATTERN.ROW"); 254 256 options->doPatternCell = psMetadataLookupBool(NULL, recipe, "PATTERN.CELL"); 257 options->doPatternContinuity = psMetadataLookupBool(NULL, recipe, "PATTERN.CONTINUITY"); 255 258 256 259 options->doMaskStats = psMetadataLookupBool(NULL, recipe, "MASK.STATS"); … … 317 320 318 321 options->checkCTE = psMetadataLookupBool(NULL, recipe, "CHECK.CTE"); 322 options->checkNoise = psMetadataLookupBool(NULL, recipe, "CHECK.NOISE"); 319 323 320 324 /* doMaskBuild : there are some cases where we require a mask, so we force doMaskBuild to be set even if the user specified 'FALSE' … … 408 412 } 409 413 414 if (psMetadataLookup(format, "PATTERN.CONTINUITY.WIDTH")) { 415 options->patternContinuityEdgeWidth = psMetadataLookupS32(NULL, format, "PATTERN.CONTINUITY.WIDTH"); 416 } 417 else { 418 options->patternContinuityEdgeWidth = psMetadataLookupS32(NULL, recipe, "PATTERN.CONTINUITY.WIDTH"); 419 } 420 410 421 411 422 // Remnance options
Note:
See TracChangeset
for help on using the changeset viewer.
