This note describes raw intensity correction algorithms in the method Detector.calib and their variation on detector type.
LCLS (1) Detector Interface
det.calib algorithms
Generic form of this method is
arr = det.calib(evt, cmpars=None, **kwargs)
Regular sequence of applied algorithms
- pedestals subtraction from calib/.../pedestals
- common mode correction depending on cmpars or calib/.../common_mode or default from PSCalib.CalibParsBase*V1.py
- gain correction with gain factors from calib/.../pixel_gain
- apply mask depending on **kwargs
regular formula: (common_mode(raw - peds))/gain * mask(**kwargs)
Mask
To construct the mask use **kwargs and algorithms from method mask_v2 from AreaDetector.
TURN OFF common mode correction
For cmpars = None - default constants are used
For regular detectors: cmpars = 0 or cmpars[0] = 0 - OFF
For epix10ka and Jungfrau cmpars[1] = 0 - OFF
See also Common mode correction algorithms.
Detector dependent algorithms
Spreadsheet below contains comments on detector specific application
Detector type | pedestal subtraction | common mode correction | gain | mask | formula | comments |
---|---|---|---|---|---|---|
LCLS (1) | ||||||
CSPAD | + | default cmpars = (1, 25, 25, 100) cmpars = 0 or cmpars[0] = 0 | *gainmask det.set_gain_mask_factor(gfactor=6.85) | + | gain map extracted from detector configuration data and applied with gfactor gainmask is applied before regular gain factor | |
CSPAD2x2 | + | shape=(185, 388, 2) → common_mode shape=(2, 185, 388) → back to (185, 388, 2) default cmpars = (1,25,25,100) | + | + | shape is converted before common mode correction in order to apply regular CSPAD algorithm then it is converted back to daq shape. | |
epix100a | + | default cmpars =(4,6,30,30) | + | + | ||
pnCCD | + | default cmpars =(3,350,350,128) or alg #8 (8,5,500) | + | + | ||
Andor3d | + | default cmpars =(2,10,10,cols) | + | + | ||
Princeton | + | default cmpars =(1,50,50,100,1,size,1) | + | + | ||
Camera | + | other Cameras default cmpars = (0,0,0,0), cmpars = 0 or cmpars[0] = 0 - OFF | + | + | ||
epix10ka | + |
| pixel_gain constants are used and per event depending on gain range | + | (common_mode(raw - peds)/gain * mask | UtilsEpix10ka.calib_epix10ka_any(det, evt, cmpars=None, **kwa) offsets are already accounted at deployment of pedestals in calib/.../pedestals |
Jungfrau | + | applied for pixels in high gain mode only in combination with mask
| pixel_gain and pixel_offset are used and per event depend on gain range | + | (common_mode(raw - peds - offset))/gain * mask | UtilsJungfrau.calib_jungfrau(det, evt, cmpars=(7,3,200,10), **kwa) |
LCLS-II Detector Interface
from psana import DataSource ds = DataSource(exp=<experiment>,run=<run-number>) orun = next(ds.runs()) det = orun.Detector(<detector-name>) for nevt,evt in enumerate(orun.events()): print('det.raw.raw(evt).shape :', det.raw.raw(evt).shape) print('det.raw.calib(evt).shape:', det.raw.calib(evt).shape) print('det.raw.image(evt).shape:', det.raw.image(evt).shape)
Generic form of this method is
arr = det.raw.calib(evt, **kwa)
Regular formula
common_mode(raw-peds)/gain
Mask
Mask is derived and applied separately as explained in Area detector mask examples or Detector interfase in LCLS-II.
Detector type | pedestal subtraction | common mode correction | gain | mask | formula | comments |
---|---|---|---|---|---|---|
LCLS-II | ||||||
epix10ka | + | cmpars=(7,2,100,10) | + | - | calib_epix10ka_any(det.raw, evt, cmpars=None, **kwa) see UtilsEpix10ka | |
epix100a | + | cmpars = (7,7,100,10) | + | - | calib_epix100(det.raw, evt, cmpars=None, **kwa) | |
opal | + | - | + | - | (raw-peds)/gain | opal_base |
piranha4 | + | - | + | - | (raw-peds)/gain | piranha4_base |