Changeset 42382 for trunk/ppImage/src/ppImageDetrendReadout.c
- Timestamp:
- Feb 8, 2023, 11:57:40 AM (3 years ago)
- Location:
- trunk/ppImage
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/ppImageDetrendReadout.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20220316/ppImage (added) merged: 42148,42158,42161,42166-42167,42171,42185,42214,42372
- Property svn:mergeinfo changed
-
trunk/ppImage/src/ppImageDetrendReadout.c
r42340 r42382 63 63 // psLogMsg ("ppImage", 6, "check video: %f sec\n", psTimerMark ("detrend.readout")); 64 64 65 // XXX for GPC2, there are some bizzare cell levels that need to be filtered out 66 // Here I measure the median background before overscan subtraction, but an alternative 67 // is to use the overscan-subtracted image. 68 // XX if (0) { 69 // XX psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN); 70 // XX psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); 71 // XX psImageBackground (stats, NULL, input->image, NULL, 0xffff, rng); 72 // XX readoutBackground = stats->robustMedian; 73 // XX } 74 65 75 // Masking on the basis of pixel value needs to be done before anything else, so the values are pristine. 66 76 if (options->doMaskBuild) { … … 113 123 } 114 124 // psLogMsg ("ppImage", 6, "subtract overscan: %f sec\n", psTimerMark ("detrend.readout")); 125 } 126 127 // measure the overscan-subtracted readoutBackground here (or subtract the overscan value?) 128 // XXX this is the measurements and should be independent of the pattern masking 129 if (options->doPatternDeadCells) { 130 psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); 131 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); 132 psImageBackground (stats, NULL, input->image, NULL, 0xffff, rng); 133 134 // save this value somewhere 135 pmHDU *hdu = pmHDUFromReadout(input); // HDU of interest 136 psMetadataAddF32(hdu->header, PS_LIST_TAIL, "BACK_VAL", PS_META_REPLACE, "Median cell background", stats->robustMedian); 137 psMetadataAddF32(hdu->header, PS_LIST_TAIL, "BACK_ERR", PS_META_REPLACE, "Stdev of cell background", stats->robustStdev); 138 psFree (stats); 139 psFree (rng); 115 140 } 116 141
Note:
See TracChangeset
for help on using the changeset viewer.
