arpes.analysis.mask.apply_mask#

arpes.analysis.mask.apply_mask(data, mask, replace=nan, radius=0.0, *, invert=False)[source]#

Applies a logical mask, i.e. one given in terms of polygons, to a specific piece of data.

This can be used to set values outside or inside a series of polygon masks to a given value or to NaN.

Expanding or contracting the masked region can be accomplished with the radius argument, but by default strict inclusion is used.

Some masks include a fermi parameter which allows for clipping the detector boundaries in a semi-automated fashion. If this is included, only 200meV above the Fermi level will be included in the returned data. This helps to prevent very large and undesirable regions filled with only the replacement value which can complicate automated analyses that rely on masking.

Parameters:
  • data – Data to mask.

  • mask – Logical definition of the mask, appropriate for passing to polys_to_mask

  • replace – The value to substitute for pixels masked.

  • radius – Radius by which to expand the masked area.

  • invert – Allows logical inversion of the masked parts of the data. By default, the area inside the polygon sequence is replaced by replace.

Returns:

Data with values masked out.