Versions Compared

Key

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

...

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 = np.uint8 {'status':True, 'status_bits':0xffff, '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.

Combined and separate mask methods

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, gain_range_inds=(0,1,2,3,4), dtype=DTYPE_MASK, **kwa)
mask = o._mask_neighbors(mask, rad=9, ptrn='r')
mask = o._m.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_neighbors(mask, rad=39, 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

...