Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleLogin to psana node and set lcls2 environment on pcds
collapsetrue
ssh -Y pslogin.slac.stanford.edu
ssh -Y psana
source /cds/sw/ds/ana/conda2conda1/manage/bin/psconda.sh
Code Block
titleLogin to psana node and set lcls2 environment on s3df
ssh -Y s3dflogin.slac.stanford.edu
ssh -Y psana
source /sdf/group/lcls/ds/ana/sw/conda1/manage/bin/psconda.sh

Code examples

...

Code Block
kwa = <dict-of-mask-parameters>
a = o.calib(evt, cmpars=(7,2,100,10), **kwa)
a = o.image(evt, nda=None, **kwa) # reduced shape for available segment only
a = o.image(evt, nda=None, value_for_missing_segments=800, **kwa) # full image including missing segments

Calibration constants

All detector calibration constants (np.array) and associated  metadata (dict) are available through the dictionary det.calibconst with calibration type as a key. For example:

...

See for details Area detector mask examples.Instantiation of the Mask object

Code Block
titleInstantiation of the Mask object
from psana.detector.mask import Mask, DTYPE_MASK

kwa = {'status':True, 'status_bits':0xffff, 'stextra_bits':(1<<64)-1, 'gain_range_inds':(0,1,2,3,4),\
       'neighbors':False, 'rad':3, 'ptrn':'r',\
       'edges':False, 'width':0, 'edge_rows':10, 'edge_cols':5,\
       'center':False, 'wcenter':0, 'center_rows':5, 'center_cols':3,\
       'calib':False,\
       'umask':None,\
       'force_update':False, 'dtype':DTYPE_MASK}

m = Mask(det, **kwa)

m = Mask(det) # minimal version.

...

Code Block
titleCombined and separate mask methods
m.set_mask(**kwa) # forced update of cached mask.
mask = m.mask(**kwa) # returns cached mask.
mask = m.mask_default()
mask = m.mask_calib_or_default() # if available returns mask from "pixel_mask" calibration type, otherwise array of ones.
mask = m.mask_from_status(status_bits=0xffff, stextra_bits:(1<<64)-1, gain_range_inds=(0,1,2,3,4), dtype=DTYPE_MASK)
mask = m.mask_edges(width=0, edge_rows=1, edge_cols=1, dtype=DTYPE_MASK)
mask = m.mask_center(wcenter=0, center_rows=1, center_cols=1, dtype=DTYPE_MASK)
mask = m.mask_neighbors(mask, rad=9, ptrn='r')

...