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/conda1/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/conda2conda1/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.

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 = np.uint8Mask(det, **kwa)

m = Mask(det) # minimal version.
Code Block
titleCombined and separate mask methods
m.set_mask(**kwa) # forced update of cached mask.
mask = om._mask_default(dtype=DTYPE_MASK)(**kwa) # returns cached mask.
mask = om._mask_calibdefault()
mask = om._mask_calib_or_default(dtype=DTYPE_MASK)) # if available returns mask from "pixel_mask" calibration type, otherwise array of ones.
mask = om._mask_from_status(status_bits=0xffff, stextra_bits:(1<<64)-1, gain_range_inds=(0,1,2,3,4), dtype=DTYPE_MASK, **kwa)
mask = om._mask_neighbors(mask, rad=9, ptrn='r')
mask = o._mask_edges(width=0, edge_rows=1, edge_cols=1, dtype=DTYPE_MASK, **kwa)
mask = om._mask_center(wcenter=0, center_rows=1, center_cols=1, dtype=DTYPE_MASK, **kwa)
mask = om._mask(status=True, status_bits=0xffff, gain_range_inds=(0,1,2,3,4)\
               neighbors=False, rad=3_neighbors(mask, rad=9, ptrn='r',\
               edges)
  • default combined mask parameters (status=True,

...

  • neighbors=

...

  • False, edges=False, center=False, calib=False, umask=None) are set to define mask for pixel_status only.
  • mask is used in det.raw.calib/image mask at evaluation of common mode correction, but by default it is not applied to data.
  • to apply mask to data use multiplication calib *= mask.

Other useful area detector methods

...