Content
Data sample for test
xcs01116-r0144 event 10
Data with subtracted pedestals
ped = det.pedestals(run)
data_ped = det.raw(evt)-ped
This data has structure which can be corrected.
Old version of algorithm
EPIX100A has an option to turn on up to 3 regions for common mode correction, controlled by the bitword parameter #2:
- bit#1 - common mode for 352x96-pixel 16 banks,
- bit#2 - common mode for 96-pixel rows in 16 banks,
- bit#3 - common mode for 352-pixel columns in 16 banks
det.common_mode_apply(run, data_calib6, cmpars=(4,6,30,10))
New development
Silke Nelson has implemented similar algorithm in python, which visually demonstrates better performance
Implementation in ImgAlgos
Apparently the difference is that np.median() method in python returns median as a float value. In our old version median is integer - histogram bin number associated with integer ADU which is closest to the half histogram statistics.
A few algorithms with float common mode correction were tested and show about the same results
- meanInRegion - evaluates mean value in the range of intensities (-30,30),
- medianInRegionV2 - improved hisotgram-based algorithm; float correction to integer median position using histogram bins as weights,
- medianInRegionV3 - classic median algorithm for input array of data - this is set for production version.
det.common_mode_apply(run, data_calib6, cmpars=(4,6,30,10))
This algorithm reproduces result of Silke.
Check for other options of common mode algorithm
cmpars=(4,1,30,10)
bit#1 - common mode for 352x96-pixel 16 banks
cmpars=(4,2,30,10)
bit#2 - common mode for 96-pixel rows in 16 banks
cmpars=(4,4,30,10)
bit#3 - common mode for 352-pixel columns in 16 banks
cmpars=(4,7,30,10)
combination of all three corrections
Summary
Sufficient common mode correction can be acheived with parameters cmpars=(4,6,30,10)
References