Versions Compared

Key

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

...

At instantiation of class Mask object, passed parameters used to evaluate requested combined mask and cache it in det._mask_ property. If this property is None - mask is re-evaluated. Currently default combined mask is evaluated for status only: status=True, neighbors=False, edges=False, center=False, calib=False, umask=None.

Code Block
from psana.detector.mask import Mask, DTYPE_MASK

m = Mask(det,\
         status=True, status_bits=0xffff, gain_range_inds=(0,1,2,3,4),\
         neighbors=True, rad=5, ptrn='r',\
         edges=True, width=0, edge_rows=10, edge_cols=5,\
         center=True, wcenter=0, center_rows=5, center_cols=3,\
         calib=True,\
         umask=test_umask(det),\
         force_update=False, dtype=DTYPE_MASK)

m = Mask(det) # minimal version of the Mask object instantiation.

# All other methods are shotcuts to .

Class Mask access methods

All other methods of the class Mask are shotcuts to det._mask*

...

methods

...

without "_".

Code Block

m = Mask(det)
m.set_mask(**kwa) # forced update of cached mask, **kwa - the same list of keyword arguments as in class Mask w/o det.
mask = m.mask(**kwa) # returns cached mask, **kwa - the same list of keyword arguments as in class Mask w/o det.
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, 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')

...