Changeset 30835
- Timestamp:
- Mar 9, 2011, 11:57:26 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImageDetrendPattern.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageDetrendPattern.c
r30831 r30835 25 25 if (options->doPatternRow) { 26 26 bool status; 27 pmFPAfile *input = psMetadataLookupPtr(&status, config->files, "PPIMAGE.INPUT"); 28 pmFPAview *view = pmFPAviewAlloc(0); // View for local processing 29 *view = *inputView; 30 while ((cell = pmFPAviewNextCell(view, input->fpa, 1)) != NULL) { 27 pmHDU *hdu = pmHDUFromChip(chip); 28 if (psMetadataLookupBool(NULL,hdu->header,"PTRN_ROW")) { 29 psLogMsg("ppImage", PS_LOG_INFO, "Not performing row pattern correction as it has already been done."); 30 } 31 else { 32 pmFPAfile *input = psMetadataLookupPtr(&status, config->files, "PPIMAGE.INPUT"); 33 pmFPAview *view = pmFPAviewAlloc(0); // View for local processing 34 *view = *inputView; 35 while ((cell = pmFPAviewNextCell(view, input->fpa, 1)) != NULL) { 31 36 if (!cell->process || !cell->file_exists) { 32 continue;37 continue; 33 38 } 34 39 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 35 40 ESCAPE(false, "load failure for Cell"); 36 41 } 37 42 38 43 if (!cell->data_exists) { 39 44 continue; … … 74 79 } 75 80 } 76 } 77 psFree(view); 81 82 } 83 psMetadataAddBool(hdu->header, PS_LIST_TAIL, "PTRN_ROW",PS_META_REPLACE,"PATTERN.ROW correction applied",true); 84 psFree(view); 85 } 78 86 } 79 87 … … 83 91 pmFPAview *view = pmFPAviewAlloc(0); // View for local processing 84 92 *view = *inputView; 85 for (int i = 0; i < chip->cells->n; i++) { 93 94 pmHDU *hdu = pmHDUFromCell(cell); 95 if (psMetadataLookupBool(NULL,hdu->header,"PTRN_CEL")) { 96 psLogMsg("ppImage", PS_LOG_INFO, "Not performing cell pattern correction as it has already been done."); 97 } 98 else { 99 for (int i = 0; i < chip->cells->n; i++) { 86 100 view->cell = i; 87 101 88 102 pmCell *cell = chip->cells->data[i]; // Cell of interest 103 89 104 if (cell->readouts->n > 1) { 90 105 psLogMsg("ppImage", PS_LOG_INFO, "Not performing cell pattern correction on video cell."); … … 99 114 tweak->data.U8[i] = 0xFF; 100 115 } 101 }102 116 103 // Tweak the cells 104 if (!pmPatternCell(chip, tweak, options->patternCellBG, options->patternCellMean, 105 options->maskValue, options->darkMask)) { 106 psFree(tweak); 107 psFree(view); 108 return false; 109 } 110 psFree(tweak); 111 psFree(view); 117 } 118 119 // Tweak the cells 120 if (!pmPatternCell(chip, tweak, options->patternCellBG, options->patternCellMean, 121 options->maskValue, options->darkMask)) { 122 psFree(tweak); 123 psFree(view); 124 return false; 125 } 126 psFree(tweak); 127 psFree(view); 128 129 psMetadataAddBool(hdu->header, PS_LIST_TAIL, "PTRN_CEL",PS_META_REPLACE,"PATTERN.CELL correction applied",true); 130 } 112 131 } 113 132
Note:
See TracChangeset
for help on using the changeset viewer.
