You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Code examples

Most truthful description is on git: detector/areadetector.py

Create DataSource, Run, and Detector objects

    from psana import DataSource
    ds = DataSource(exp='tmoc00318',run=10)
    orun = next(ds.runs())
    det = orun.Detector('epix100')

Loop over events and access detector data

Methods guaranteed for all area detectors - raw, calib, and image:

    for evt orun.events():
        raw = det.raw.raw(evt)
        clb = det.raw.calib(evt)
        img = det.raw.image(evt)

Optional parameters

a = det.raw.calib(evt, cmpars=(7,2,100,10), mbits=0o7, mask=None, edge_rows=10, edge_cols=10, center_rows=5, center_cols=5)
a = det.raw.image(self, evt, nda=None, **kwa)

Other useful area detector methods

# access calibration constants and derived arrays
peds = det.raw._pedestals()
gain = det.raw._gain() # ADU/keV
gfac = det.raw._gain_factor() # keV/ADU
rms = det.raw._rms()
status = det.raw._status()
mask = det.raw._mask_calib()
mask = det.raw._mask_from_status()
mask = det.raw._mask_edges()
mask = det.raw._mask(calib=False, status=False, edges=False, **kwa)
mask = det.raw._mask_comb(mbits=0o377, **kwa)

arrx, arry, arrz = det.raw._pixel_coords(do_tilt=True, cframe=0)
indx, indy, indz = det.raw._pixel_coord_indexes(pix_scale_size_um=None, xy0_off_pix=None, do_tilt=True, cframe=0)
  
# array of the common mode increment
incr = det.raw._common_mode_increment(evt, cmpars=(0,7,100,10))

References

  • No labels