Changeset 42158
- Timestamp:
- Apr 4, 2022, 4:01:04 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20220316/ppImage/src/ppImageDetrendReadout.c
r39501 r42158 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 if (1) { 129 psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN); 130 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); 131 psImageBackground (stats, NULL, input->image, NULL, 0xffff, rng); 132 133 // save this value somewhere 134 pmHDU *hdu = pmHDUFromReadout(input); // HDU of interest 135 psMetadataAddF32(hdu->header, PS_LIST_TAIL, "BACK_VAL", PS_META_REPLACE, "Median cell background", stats->robustMedian); 136 psFree (stats); 137 psFree (rng); 115 138 } 116 139
Note:
See TracChangeset
for help on using the changeset viewer.
