nodata_below_threshold#

nodata_below_threshold(chip: ndarray, threshold: float, nodata_val: int = 0) bool[source]#

Check if proportion of nodata pixels is below the threshold.

Parameters
  • chip (np.ndarray) – Raster as (H, W) or (H, W, C) numpy array.

  • threshold (float) – Threshold to check the fraction of NODATA pixels against.

  • nodata_val (int, optional) – Value that represents NODATA pixels. Defaults to 0.

Returns

Whether the fraction of NODATA pixels is below the given

threshold.

Return type

bool