Changeset 31066 for trunk/ppImage
- Timestamp:
- Mar 27, 2011, 12:08:17 PM (15 years ago)
- Location:
- trunk/ppImage/src
- Files:
-
- 2 edited
-
ppImageDetrendPattern.c (modified) (6 diffs)
-
ppImageOptions.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageDetrendPattern.c
r30860 r31066 23 23 assert(inputView->readout == -1); 24 24 25 // PATTERN.ROW is selected by the recipe. If it is selected, we search for the table 26 // PATTERN.ROW.SUBSET. If this is found in our format file, we use that version; 27 // otherwise, we use the table provided in the recipe file "ppImage.config". Within that 28 // table, we select the entry that matches our CHIP.NAME. This will be either a boolean or 29 // a string of bits. If it is a boolean, it specified whether or not to correct the entire 30 // chip; if it is a string, the bits specify which cells to correct (sequence is order of 31 // CELLS in the format:CHIPS metadata table) 32 33 // We also check the chip header for the boolean 'PTRN_ROW' : if this is true, we have 34 // already applied this correct to this data, so we simply skip the correction for this 35 // chip. 36 25 37 if (options->doPatternRow) { 26 38 bool status; … … 28 40 if (psMetadataLookupBool(NULL,hdu->header,"PTRN_ROW")) { 29 41 psLogMsg("ppImage", PS_LOG_INFO, "Not performing row pattern correction as it has already been done."); 42 goto pattern_cell; 30 43 } 31 else { 32 pmFPAfile *input = psMetadataLookupPtr(&status, config->files, "PPIMAGE.INPUT");33 pmFPAview *view = pmFPAviewAlloc(0); // View for local processing34 *view = *inputView;35 while ((cell = pmFPAviewNextCell(view, input->fpa, 1)) != NULL) {44 45 pmFPAfile *input = psMetadataLookupPtr(&status, config->files, "PPIMAGE.INPUT"); 46 pmFPAview *view = pmFPAviewAlloc(0); // View for local processing 47 *view = *inputView; 48 while ((cell = pmFPAviewNextCell(view, input->fpa, 1)) != NULL) { 36 49 if (!cell->process || !cell->file_exists) { 37 continue;50 continue; 38 51 } 39 52 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 40 ESCAPE(false, "load failure for Cell");53 ESCAPE(false, "load failure for Cell"); 41 54 } 42 55 … … 56 69 if (!doPattern) continue; 57 70 71 // A very detailed log message. 58 72 const char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); 59 73 const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); 60 psLogMsg("ppImage", PS_LOG_INFO, "Performing row pattern correction for %s, %s\n", 61 chipName, cellName); 74 psLogMsg("ppImage", PS_LOG_INFO, "Performing row pattern correction for %s, %s\n", chipName, cellName); 62 75 63 76 // process each of the readouts … … 80 93 } 81 94 82 }83 psMetadataAddBool(hdu->header, PS_LIST_TAIL, "PTRN_ROW",PS_META_REPLACE,"PATTERN.ROW correction applied",true);84 psFree(view);85 95 } 96 psMetadataAddBool(hdu->header, PS_LIST_TAIL, "PTRN_ROW",PS_META_REPLACE,"PATTERN.ROW correction applied",true); 97 psFree(view); 86 98 } 99 100 pattern_cell: 101 102 // see the comment for PATTERN.ROW; the same rules apply for PATTERN.CELL 87 103 88 104 if (options->doPatternCell) { … … 95 111 if (psMetadataLookupBool(NULL,hdu->header,"PTRN_CEL")) { 96 112 psLogMsg("ppImage", PS_LOG_INFO, "Not performing cell pattern correction as it has already been done."); 113 goto pattern_done; 97 114 } 98 else { 99 for (int i = 0; i < chip->cells->n; i++) {115 116 for (int i = 0; i < chip->cells->n; i++) { 100 117 view->cell = i; 101 118 … … 115 132 } 116 133 117 }134 } 118 135 119 // Tweak the cells120 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);136 // Tweak the cells 137 if (!pmPatternCell(chip, tweak, options->patternCellBG, options->patternCellMean, 138 options->maskValue, options->darkMask)) { 139 psFree(tweak); 140 psFree(view); 141 return false; 142 } 143 psFree(tweak); 144 psFree(view); 128 145 129 psMetadataAddBool(hdu->header, PS_LIST_TAIL, "PTRN_CEL",PS_META_REPLACE,"PATTERN.CELL correction applied",true); 130 } 146 psMetadataAddBool(hdu->header, PS_LIST_TAIL, "PTRN_CEL",PS_META_REPLACE,"PATTERN.CELL correction applied",true); 131 147 } 132 148 149 pattern_done: 133 150 return(true); 134 151 } -
trunk/ppImage/src/ppImageOptions.c
r30878 r31066 239 239 options->doShutter = psMetadataLookupBool(NULL, recipe, "SHUTTER"); 240 240 241 // Look for pattern correction options in the camera format. If not found, look in the recipe. 242 /* if (psMetadataLookup(format, "PATTERN.ROW")) { */ 243 /* options->doPatternRow = psMetadataLookupBool(NULL, format, "PATTERN.ROW"); */ 244 /* } */ 245 /* else { */ 241 // PATTERN.ROW is selected by the recipe. If it is selected, we search for the table 242 // PATTERN.ROW.SUBSET. If this is found in our format file, we use that version; 243 // otherwise, we use the table provided in the recipe file "ppImage.config". Within that 244 // table, we select the entry that matches our CHIP.NAME. This will be either a boolean or 245 // a string of bits. If it is a boolean, it specified whether or not to correct the entire 246 // chip; if it is a string, the bits specify which cells to correct (sequence is order of 247 // CELLS in the format:CHIPS metadata table) 248 249 // We also check the chip header for the boolean 'PTRN_ROW' : if this is true, we have 250 // already applied this correct to this data, so we simply skip the correction for this 251 // chip. 252 246 253 options->doPatternRow = psMetadataLookupBool(NULL, recipe, "PATTERN.ROW"); 247 /* } */248 /* if (psMetadataLookup(format, "PATTERN.CELL")) { */249 /* options->doPatternCell = psMetadataLookupBool(NULL, format, "PATTERN.CELL"); */250 /* } */251 /* else { */252 254 options->doPatternCell = psMetadataLookupBool(NULL, recipe, "PATTERN.CELL"); 253 /* } */ 255 254 256 options->doMaskStats = psMetadataLookupBool(NULL, recipe, "MASK.STATS"); 255 257 options->addNoise = psMetadataLookupBool(NULL, recipe, "ADDNOISE");
Note:
See TracChangeset
for help on using the changeset viewer.
