Changeset 33243 for trunk/ppImage/src/ppImageDetrendPattern.c
- Timestamp:
- Feb 10, 2012, 6:07:30 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImageDetrendPattern.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.
