ewoksid02.caving.get_mask_limits#

ewoksid02.caving.get_mask_limits(data_shape=None, center_x=None, center_y=None, x_shifted=None, y_shifted=None, only_x_dim=False, only_y_dim=False, use_cupy=False)[source]#

Mask limits is the primitive mask, it defines the area where the cave can be applied. It’s the area of the pixels whose centro-symmetric brother falls in the detector surface. If the center of the beam matches with the center of the detector, the whole detector area can be caved. If the center falls into the edge of the detector, no pixel can be caved.

Inputs:
  • data_shape (tuple): shape of the data array (2 dimensional)

  • center_x (int): beam center in the first data dimension

  • center_y (int): beam center in the second data dimension

  • x_shifted (numpy.ndarray) : shifted index vector along the first data dimension

  • y_shifted (numpy.ndarray) : shifted index vector along the second data dimension

  • only_x_dim (bool): if True, returns the mask of the first dimension limits

  • only_y_dim (bool): if True, returns the mask of the second dimension limits

  • use_cupy (bool): the return result is transfered to the GPU using cupy

Outputs:
  • numpy.ndarray / cupy.ndarray: array to mask the pixels whose centrosymmetric brother falls out of the detector area.

Parameters:
  • data_shape (tuple)

  • center_x (int)

  • center_y (int)

  • x_shifted (ndarray)

  • y_shifted (ndarray)

  • only_x_dim (bool)

  • only_y_dim (bool)

  • use_cupy (bool)