- Timestamp:
- Feb 11, 2013, 4:50:12 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20130211/ppImage/src/ppImageDetrendPattern.c
r33243 r35149 18 18 pmCell *cell = NULL; 19 19 20 assert(options->doPatternRow || options->doPatternCell || options->doPatternContinuity); // do not call if not needed 20 assert(options->doPatternMedian || options->doPatternRow || 21 options->doPatternCell || options->doPatternContinuity); // do not call if not needed 21 22 assert(inputView->chip != -1); 22 23 assert(inputView->cell == -1); … … 35 36 // chip. 36 37 38 if (options->doPatternMedian) { 39 // bool status; 40 int numCells = chip->cells->n; // Number of cells 41 psVector *tweak = psVectorAlloc(numCells, PS_TYPE_U8); // Tweak cell? 42 // pmFPAfile *input = psMetadataLookupPtr(&status, config->files, "PPIMAGE.INPUT"); 43 pmFPAview *view = pmFPAviewAlloc(0); // View for local processing 44 45 46 pmHDU *hdu = pmHDUFromChip(chip); 47 if (psMetadataLookupBool(NULL,hdu->header, "PTRN_MED")) { 48 psLogMsg("ppImage", PS_LOG_INFO, "Not performing median pattern correction as it has already been done."); 49 goto pattern_row; 50 } 51 for (int i = 0; i < chip->cells->n; i++) { 52 view->cell = i; 53 54 pmCell *cell = chip->cells->data[i]; // Cell of interest 55 56 if (cell->readouts->n > 1) { 57 psLogMsg("ppImage", PS_LOG_INFO, "Not performing cell continuity correction on video cell."); 58 continue; 59 } 60 61 bool doPattern = false; 62 if (!doPatternForView(&doPattern, config, chip, view, RECIPE_NAME, "PATTERN.CONTINUITY.SUBSET")) { 63 ESCAPE(false, "Unable to determine whether row pattern matching should be applied."); 64 } 65 if (doPattern) { 66 tweak->data.U8[i] = 0xFF; 67 } 68 } 69 70 // Tweak the cells 71 if (!pmPatternMedian(chip, tweak, options->patternCellBG, options->patternCellMean, 72 options->maskValue, options->darkMask,true,true)) { 73 psFree(tweak); 74 psFree(view); 75 return false; 76 } 77 psFree(tweak); 78 psFree(view); 79 80 psMetadataAddBool(hdu->header, PS_LIST_TAIL, "PTRN_MED",PS_META_REPLACE,"PATTERN.MEDIAN correction applied",true); 81 82 } 83 pattern_row: 37 84 if (options->doPatternRow) { 38 85 bool status;
Note:
See TracChangeset
for help on using the changeset viewer.
