Page History
...
Dark data processing algorithms include pixel status evaluation which is saved in calibration files of type pixel_status. This note explains how to find definition and statistics of the bad pixel bits.
Finding Bad Pixel status information
Algorithm
Bad pixel statistics
Dark data processing scripts dumps in the log file The best source of information about bad pixel content and statistics is the log file. Another option is to look at code. Tables of this note contain references to both sources of information for different type of commands/detectors.
LCLS
...
statistics, for example in case of jungfrau:
Code Block | ||
---|---|---|
| ||
raw data found/selected in 999 events
[I] L0688 begin data summary stage
[I] L0111 evaluate_limits RMS: ave=4.783 std=1.303 limits low=0.001 high=12.604
[I] L0111 evaluate_limits AVE: ave=14191.873 std=457.903 limits low=11444.455 high=16000.000
[I] L0733 bad pixel status:
status 1: 244 pixel rms > 12.604
status 2: 550 pixel rms < 0.001
status 4: 418 pixel intensity > 16000 in more than 0.1 fraction of events
status 8: 132 pixel intensity < 1 in more than 0.1 fraction of events
status 16: 0 pixel average > 16000
status 32: 918 pixel average < 11444.5
[I] L0108 status 64: 139 pixel with bad gain mode switch for jungfrau only! |
Dark data processing algorithm
Dark data processing algorithm evolved for a long time. The most advanced version, implemented for calibration of jungfrau panels, is described here.
- dark raw data is accumulated in array block[nrecs1,<2d-shape-of-data>] for a portion of events nrecs1=50. It would be nice to accumulate it for entire volume of events (nrecs=1000), but some of detectors are too big, that causes problem with memory.
- pre-process data from block, use median and quantile for fraclo=0.05 and fcachi=0.95 fraction of spectral events to estimate mean value and valid gate intensity limits, resperctively.
- use gated average algorithm to process events in block and all other events (nrecs=1000) requested for dark processing.
- in summary, evaluate mean, rms, max/min values, and process a few statistical cumulative arrays, which produces information about bad pixels.
Bad pixel status algorithms
For arrays of per-pixel mean intensity and rms, obtained in gated average algorithm, we use parameters of absolute limits and number of sigma
int_lo=1, int_hi=16000, intnlo=6, intnhi=6
rms_lo=0.001, rms_hi=16000, rmsnlo=6, rmsnhi=6
and dynamically evaluate limits for good parameters from spectra.
Code Block | ||||
---|---|---|---|---|
| ||||
def evaluate_limits(arr, nneg=5, npos=5, lim_lo=1, lim_hi=16000, ...):
ave, std = (arr.mean(), arr.std())
lo = ave-nneg*std if nneg>0 else lim_lo
hi = ave+npos*std if npos>0 else lim_hi
lo, hi = max(lo, lim_lo), min(hi, lim_hi)
return lo, hi |
Bad pixel bits assignment
status 0: good pixel
status 1: pixel rms exceeds its maximal value for good pixels defined by rms_hi=16000, rmsnhi=6
status 2: pixel rms lower than its minimal value for good pixels defined by rms_lo=0.001, rmsnlo=6
status 4: pixel intensity exceeds int_hi=16000 in more than fraclm=0.1 fraction of events
status 8: pixel intensity lower than int_lo=1 in more than fraclm=0.1 fraction of events
status 16: pixel average intensity exceeds its maximal value for good pixels defined by int_hi=16000, intnhi=6
status 32: pixel average intensity lower than its minimal value for good pixels defined by int_lo=1, intnlo=6
status 64: for jungfrau only pixel with bad gain mode switch.
Finding Bad Pixel status information
Due to algorithms evolution precise bad pixel bit assignment may be different from description above. The best source of true information about bad pixel content and statistics is the log file. Another option is to look at code. Tables of this note contain references to both sources of information for different type of commands/detectors.
LCLS
Detector | Dark processing command | Log files directory | Log file name | Code |
---|---|---|---|---|
epix10ka | epix10ka_pedestals_calibration | /reg/g/psdm/detector/gains/epix10k/panels/logs/<year>/ | <timestamp>_log_epix10ka_pedestals_calibration_<uid>.txt | UtilsEpix10kaCalib.py#L522 |
jungfrau | jungfrau_dark_proc | /reg/g/psdm/detector/gains/jungfrau/panels/logs/<year>/ | <timestamp>_log_jungfrau_dark_proc_<uid>.txt | UtilsCalib.py#L727 |
other detectors | calibrun → det_ndarr_dark_proc | /reg/g/psdm/logs/calibman/<year>/<month>/ | <time-stamp>-log-<login>-<job-id>.txt | det_ndarr_raw_proc#L337 |
Examples
Code Block | ||||
---|---|---|---|---|
| ||||
process panel:15 id:0000000002-0173621761-3221225494-1014046789-0019435010-0000000000-0000000000
[I] L0111 evaluate_limits RMS: ave=3.418 std=0.344 limits low=1.353 high=5.483
[I] L0111 evaluate_limits AVE: ave=3155.633 std=147.439 limits low=2271.000 high=4040.267
[I] L0528 Bad pixel status:
status 1: 35 pixel rms > 5.483
status 2 |
Examples
Code Block | ||||
---|---|---|---|---|
| ||||
process panel:15 id:0000000002-0173621761-3221225494-1014046789-0019435010-0000000000-0000000000
[I] L0111 evaluate_limits RMS: ave=3.418 std=0.344 limits low=1.353 high=5.483
[I] L0111 evaluate_limits AVE: ave=3155.633 std=147.439 limits low=2271.000 high=4040.267
[I] L0528 Bad pixel status:
status 1: 35 pixel rms > 5.483
status 2: 0 pixel rms < 1.353
status 4: 0 pixel intensity > 16000 in more than 0.1 fraction of events
status 8: 0 pixel intensity < 1 in more than 0.1 fraction of events
status 16: 13 pixel average > 4040.27
status 32: 354 pixel average < 2271 |
Code Block | ||||
---|---|---|---|---|
| ||||
raw data found/selected in 999 events
[I] L0688 begin data summary stage
[I] L0111 evaluate_limits RMS: ave=4.783 std=1.303 limits low=0.001 high=12.604
[I] L0111 evaluate_limits AVE: ave=14191.873 std=457.903 limits low=11444.455 high=16000.000
[I] L0733 bad pixel status:
status 1: 244 pixel rms > 12.604
status 2: 550 pixel rms < 0.001
status 4: 418 pixel intensity > 16000 in more than 0.1 fraction of events
status 8: 132 pixel intensity < 1 in more than 0.1 fraction of events
status 16: 0 pixel average > 16000
status 32: 918 pixel average < 11444.5
[I] L0108
status 64: 139 pixel with bad gain mode switch |
Code Block | ||||
---|---|---|---|---|
| ||||
Raw data for XcsEndstation.0:Epix100a.1 found/selected in 1001 events , begin data summary stage evaluate_limits: RMS ave, std = 3.411, 0.276 low, high limits = 1.500, 7.000 evaluate_limits: AVE ave, std = 4515.065, 203.890 low, high limits = 10.000, 10000.000 Bad pixel status: status 1: 134 pixel rms > 7.000 status 8: 5 pixel rms < 1.500 status 2: 6 pixel intensity > 10000 in more than 0.1 fraction of events status 4: 0 pixel intensity < 10 in more than 0.1 fraction of events status 16: 0 pixel rms average >< 100001.353 status 324: 50 pixel average < 10 |
LCLS-II
...
intensity > 16000 in more than 0.1 fraction of events
status 8: 0 pixel intensity < 1 in more than 0.1 fraction of events
status 16: 13 pixel average > 4040.27
status 32: 354 pixel average < 2271 |
Code Block | ||||
---|---|---|---|---|
| ||||
raw data found/selected in 999 events
[I] L0688 begin data summary stage
[I] L0111 evaluate_limits RMS: ave=4.783 std=1.303 limits low=0.001 high=12.604
[I] L0111 evaluate_limits AVE: ave=14191.873 std=457.903 limits low=11444.455 high=16000.000
[I] L0733 bad pixel status:
status 1: 244 |
Examples
Code Block | ||||
---|---|---|---|---|
| ||||
[I] L0230 ________________________________________________________________________________ raw data found/selected in 1000 events [I] L0233 begin data summary stage [I] L0279 bad pixel status: status 1: 300 pixel rms > 612.533604 status 2: 1550 pixel rms < 0.001 status 4: 1434 418 pixel intensity > 16000 in more than 0.1 fraction of events status 8: 10170132 pixel intensity < 1 in more than 0.1 fraction of events status 16: 31 0 pixel average > 5280.3416000 status 32: 2918 pixel average < 2692.911444.5 [I] L0108 status 64: 139 pixel with bad gain mode switch |
Code Block | ||||
---|---|---|---|---|
| ||||
[I]Raw L0275data Pre-processing time 16.339 sec Results for median over pixels intensities: 0.500 fraction of the event spectrum is below 2901.542 ADU - pedestal estimator 0.050 fraction of the event spectrum is below 2896.826 ADU - gate low limit 0.950 fraction of the event spectrum is below 2906.187 ADU - gate upper limit event spectrum spread median(abs(raw-med)): 1.869 ADU - spectral peak width estimator [I] L0361 Bad pixel status: status 1: 6for XcsEndstation.0:Epix100a.1 found/selected in 1001 events , begin data summary stage evaluate_limits: RMS ave, std = 3.411, 0.276 low, high limits = 1.500, 7.000 evaluate_limits: AVE ave, std = 4515.065, 203.890 low, high limits = 10.000, 10000.000 Bad pixel status: status 1: 134 pixel rms > 7.000 status 8: 5 pixel rms >< 31.898500 status 2: 06 pixel intensity rms> 10000 in more than 0.1 fraction <of 0.944events status 4: 0 pixel intensity >< 1600010 in more than 0.1 fraction of events status 816: 0 pixel intensityaverage < 1 in more than 0.1 fraction of events status 16: 2 pixel average > 3821.78> 10000 status 32: 05 pixel average < 1986.12 |
Algorithm
Bad pixel statistics output
raw data found/selected in 999 events
[I] L0688 begin data summary stage
[I] L0111 evaluate_limits RMS: ave=4.783 std=1.303 limits low=0.001 high=12.604
[I] L0111 evaluate_limits AVE: ave=14191.873 std=457.903 limits low=11444.455 high=16000.000
[I] L0733 bad pixel status:
status 1: 244 pixel rms > 12.604
status 2: 550 pixel rms < 0.001
status 4: 418 pixel intensity > 16000 in more than 0.1 fraction of events
status 8: 132 pixel intensity < 1 in more than 0.1 fraction of events
status 16: 0 pixel average > 16000
status 32: 918 pixel average < 11444.5
[I] L0108 status 64: 139 pixel with bad gain mode switch for jungfrau only!
Dark data processing algorithm
It was evolved for a long time. The most advanced version, implemented for calibration of jungfrau panels, is described here.
- dark raw data is accumulated in array block[nrecs1,<2d-shape-of-data>] for a portion of events nrecs1=50. It would be nice to accumulate it for entire volume of events (nrecs=1000), but some of detectors are too big, that causes problem with memory.
- pre-process data from block, use median and quantile for fraclo=0.05 and fcachi=0.95 fraction of spectral events to estimate mean value and valid gate intensity limits, resperctively.
- use gated average algorithm to process events in block and all other events (nrecs=1000) requested for dark processing.
- in summary, evaluate mean, rms, max/min values, and process a few statistical cumulative arrays, which produces information about bad pixels.
Bad pixel status algorithms
For arrays of per-pixel mean intensity and rms, obtained in gated average algorithm, we use parameters of absolute limits and number of sigma
int_lo=1, int_hi=16000, intnlo=6, intnhi=6
rms_lo=0.001, rms_hi=16000, rmsnlo=6, rmsnhi=6
and dynamically evaluate limits for good parameters from spectra.
Code Block | ||||
---|---|---|---|---|
| ||||
def evaluate_limits(arr, nneg=5, npos=5, lim_lo=1, lim_hi=16000, ...):
ave, std = (arr.mean(), arr.std())
lo = ave-nneg*std if nneg>0 else lim_lo
hi = ave+npos*std if npos>0 else lim_hi
lo, hi = max(lo, lim_lo), min(hi, lim_hi)
return lo, hi |
status 1: pixel rms exceeds its maximal value for good pixels defined by rms_hi=16000, rmsnhi=6
status 2: pixel rms lower than its minimal value for good pixels defined by rms_lo=0.001, rmsnlo=6
status 4: pixel intensity exceeds int_hi=16000 in more than fraclm=0.1 fraction of events
status 8: pixel intensity lower than int_lo=1 in more than fraclm=0.1 fraction of events
status 16: pixel average intensity exceeds its maximal value for good pixels defined by int_hi=16000, intnhi=6
status 32: pixel average intensity lower than its minimal value for good pixels defined by int_lo=1, intnlo=6
...
10 |
LCLS-II
Detector | Dark processing command | Log file directory | Log file name | Code |
---|---|---|---|---|
epix10ka | epix10ka_pedestals_calibration | /cds/group/psdm/detector/gains2/epix10ka/panels/logs/<year>/ | <time-stamp>_log_epix10ka_pedestals_calibration_<uid>txt | UtilsEpix10kaCalib.py#L355 |
epix100a/opal/etc | det_dark_proc | /cds/group/psdm/detector/calib2/epix100/logs/<year>/ | <time-stamp>_log_det_dark_proc_<uid>.txt | UtilsCalib.py#L281 |
Examples
Code Block | ||||
---|---|---|---|---|
| ||||
[I] L0230 ________________________________________________________________________________
raw data found/selected in 1000 events
[I] L0233 begin data summary stage
[I] L0279 bad pixel status:
status 1: 300 pixel rms > 6.533
status 2: 1 pixel rms < 0.001
status 4: 1434 pixel intensity > 16000 in more than 0.1 fraction of events
status 8: 10170 pixel intensity < 1 in more than 0.1 fraction of events
status 16: 31 pixel average > 5280.34
status 32: 2 pixel average < 2692.9 |
Code Block | ||||
---|---|---|---|---|
| ||||
[I] L0275 Pre-processing time 16.339 sec
Results for median over pixels intensities:
0.500 fraction of the event spectrum is below 2901.542 ADU - pedestal estimator
0.050 fraction of the event spectrum is below 2896.826 ADU - gate low limit
0.950 fraction of the event spectrum is below 2906.187 ADU - gate upper limit
event spectrum spread median(abs(raw-med)): 1.869 ADU - spectral peak width estimator
[I] L0361 Bad pixel status:
status 1: 6 pixel rms > 3.898
status 2: 0 pixel rms < 0.944
status 4: 0 pixel intensity > 16000 in more than 0.1 fraction of events
status 8: 0 pixel intensity < 1 in more than 0.1 fraction of events
status 16: 2 pixel average > 3821.78
status 32: 0 pixel average < 1986.12 |
References
- Calibration Scripts Repository and Logging
- calibrun - LCLS CLI for dark processing
- Dark processing for LCLS2 area detectors
- Jungfrau and Epix10ka Calibration