polyTEM.crystal_peaks.flow_fields.shift_mask¶
- polyTEM.crystal_peaks.flow_fields.shift_mask(mask, target_array_shape, shift)¶
Moves a mask by an integer number of spaces in each direction. This allows a shape such as an ellipse to be drawn at any point on a matrix, and is faster than methods like np.roll. Inputs:
mask: output of an np.where() function that you would like to move target_array_shape: shape of the array that was used in the np.where() function shift: tuple or numpy array of the number of spaces to move in each direction.
- Ouputs:
formatted_mask: shifted mask in the same format as the original mask