Changeset 33243 for trunk/ppImage/src
- Timestamp:
- Feb 10, 2012, 6:07:30 PM (14 years ago)
- Location:
- trunk/ppImage/src
- Files:
-
- 4 edited
-
ppImage.h (modified) (2 diffs)
-
ppImageDetrendPattern.c (modified) (4 diffs)
-
ppImageLoop.c (modified) (1 diff)
-
ppImageOptions.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImage.h
r30655 r33243 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 … … 109 110 psStatsOptions patternCellMean; // Statistic for mean 110 111 112 int patternContinuityEdgeWidth; // Size of box to use for edge matching. 113 111 114 int remnanceSize; // Size for remnance detection 112 115 float remnanceThresh; // Threshold for remnance detection -
trunk/ppImage/src/ppImageDetrendPattern.c
r31066 r33243 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 -
trunk/ppImage/src/ppImageLoop.c
r30655 r33243 170 170 171 171 // Apply the pattern correction 172 if (options->doPatternRow || options->doPatternCell ) {172 if (options->doPatternRow || options->doPatternCell || options->doPatternContinuity) { 173 173 if (!ppImageDetrendPatternApply(config,chip,view,options)) { 174 174 ESCAPE("Unable to apply pattern corrections"); -
trunk/ppImage/src/ppImageOptions.c
r31066 r33243 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 … … 253 254 options->doPatternRow = psMetadataLookupBool(NULL, recipe, "PATTERN.ROW"); 254 255 options->doPatternCell = psMetadataLookupBool(NULL, recipe, "PATTERN.CELL"); 256 options->doPatternContinuity = psMetadataLookupBool(NULL, recipe, "PATTERN.CONTINUITY"); 255 257 256 258 options->doMaskStats = psMetadataLookupBool(NULL, recipe, "MASK.STATS"); … … 408 410 } 409 411 412 if (psMetadataLookup(format, "PATTERN.CONTINUITY.WIDTH")) { 413 options->patternContinuityEdgeWidth = psMetadataLookupS32(NULL, format, "PATTERN.CONTINUITY.WIDTH"); 414 } 415 else { 416 options->patternContinuityEdgeWidth = psMetadataLookupS32(NULL, recipe, "PATTERN.CONTINUITY.WIDTH"); 417 } 418 410 419 411 420 // Remnance options
Note:
See TracChangeset
for help on using the changeset viewer.
