pysteps.blending.utils.compute_smooth_dilated_mask

pysteps.blending.utils.compute_smooth_dilated_mask#

pysteps.blending.utils.compute_smooth_dilated_mask(original_mask, max_padding_size_in_px=0, gaussian_kernel_size=9, inverted=False, non_linear_growth_kernel_sizes=False)#

Compute a smooth dilated mask using Gaussian blur and dilation with varying kernel sizes.

Parameters:
  • original_mask (array_like) – Two-dimensional boolean array containing the input mask.

  • max_padding_size_in_px (int) – The maximum size of the padding in pixels. Default is 100.

  • gaussian_kernel_size (int, optional) – Size of the Gaussian kernel to use for blurring, this should be an uneven number. This option ensures that the nan-fields are large enough to start the smoothing. Without it, the method will also be applied to local nan-values in the radar domain. Default is 9, which is generally a recommended number to work with.

  • inverted (bool, optional) – Typically, the smoothed mask works from the outside of the radar domain inward, using the max_padding_size_in_px. If set to True, it works from the edge of the radar domain outward (generally not recommended). Default is False.

  • non_linear_growth_kernel_sizes (bool, optional) – If True, use non-linear growth for kernel sizes. Default is False.

Returns:

final_mask – The smooth dilated mask normalized to the range [0,1].

Return type:

array_like