Changeset 41857
- Timestamp:
- Oct 23, 2021, 1:48:37 PM (5 years ago)
- Location:
- branches/eam_branches/ipp-dev-20210817/ppImage/src
- Files:
-
- 3 edited
-
ppImageArguments.c (modified) (1 diff)
-
ppImageDetrendPattern.c (modified) (4 diffs)
-
ppImageParseCamera.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-dev-20210817/ppImage/src/ppImageArguments.c
r35685 r41857 116 116 pmConfigFileSetsMD (config->arguments, &argc, argv, "FRINGE", "-fringe", "-fringelist"); 117 117 pmConfigFileSetsMD (config->arguments, &argc, argv, "LINEARITY", "-linearity", "-linearlist"); 118 pmConfigFileSetsMD (config->arguments, &argc, argv, "PATTERN.ROW.AMP", "-pattern-row-amplitude", "-not-defined"); 118 119 119 120 if ((argnum = psArgumentGet(argc, argv, "-burntool"))) { -
branches/eam_branches/ipp-dev-20210817/ppImage/src/ppImageDetrendPattern.c
r41807 r41857 31 31 // CELLS in the format:CHIPS metadata table) 32 32 33 // New 2021 October : During ppImageParseCamera, we have loaded a file identified by 34 // PPIMAGE.PATTERN.ROW.AMP on config->files. This file contains a collection of FITS 35 // tables, one per chip. Each table lists the typical bias-drift amplitude for cell, 36 // measured from a collection of dark images. These values are passed (via 37 // cell->analysis) to pmPatternRow which choosed to apply the correction based on the 38 // ratio of the poisson noise due to the median background (+ read noise) and the 39 // typical amplitude. Tests show that if the amplitude / noise < 1/6, then the 40 // row-by-row variations are insignificant. 41 33 42 // We also check the chip header for the boolean 'PTRN_ROW' : if this is true, we have 34 43 // already applied this correct to this data, so we simply skip the correction for this … … 53 62 pmFPAfile *input = psMetadataLookupPtr(&status, config->files, "PPIMAGE.INPUT"); 54 63 64 // grab the KH correction file 65 pmFPAfile *PRAfile = psMetadataLookupPtr (NULL, config->files, "PPIMAGE.PATTERN.ROW.AMP"); 66 if (!PRAfile) { 67 psLogMsg("ppImage", PS_LOG_INFO, "Pattern Row Amplitude file not found, applying to all (with limits from ROW.SUBSET) "); 68 } 69 55 70 pmFPAview *view = pmFPAviewAlloc(0); // View for local processing 56 71 *view = *inputView; … … 75 90 continue; 76 91 } 92 93 // grab the corresponding cell 94 if (PRAfile) { 95 pmCell *PRAcell = pmFPAviewThisCell (view, PRAfile->fpa); 96 psAssert (PRAcell, "found Pattern Row Amplitude file, but not cell?"); 97 98 // find the nominal signal amplitude (check the ghost and/or crosstalk recipe file) 99 float amplitude = psMetadataLookupF32 (&status, PRAcell->analysis, "PTN.ROW.AMP"); 100 if (!status) amplitude = NAN; 101 102 // put the value on the science cell 103 psMetadataAddF32 (cell->analysis, PS_LIST_TAIL, "PTN.ROW.AMP", PS_META_REPLACE, "", amplitude); 104 } 77 105 78 106 bool doPattern = false; … … 280 308 bool ppImageDetrendPatternApplyCell (pmConfig *config, pmFPA *fpa, pmChip *chip, pmCell *cell, pmFPAview *view, ppImageOptions *options) { 281 309 282 // A very detailed log message.283 const char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME");284 const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME");285 psLogMsg("ppImage", PS_LOG_INFO, "Performing row pattern correction for %s, %s\n", chipName, cellName);286 287 310 // process each of the readouts 288 311 pmReadout *readout; // Readout from cell -
branches/eam_branches/ipp-dev-20210817/ppImage/src/ppImageParseCamera.c
r41812 r41857 181 181 psError (PS_ERR_IO, false, "Can't find a fringe image source"); 182 182 return NULL; 183 } 184 } 185 186 if (options->doPatternRow) { 187 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.PATTERN.ROW.AMP", "PATTERN.ROW.AMP", 188 PM_FPA_FILE_PATTERN_ROW_AMP, PM_DETREND_TYPE_PATTERN_ROW_AMP)) { 189 psWarning ("Can't find a pattern row amplitude source, will apply to all cells or defined subset"); 190 // an empty or invalid file may have been generated -- we want to skip, not raise an error 191 pmFPAfile *PRAfile = psMetadataLookupPtr (NULL, config->files, "PPIMAGE.PATTERN.ROW.AMP"); 192 if (PRAfile) { 193 PRAfile->state |= PM_FPA_STATE_INACTIVE; 194 } 183 195 } 184 196 }
Note:
See TracChangeset
for help on using the changeset viewer.
