polartoolkit.get_min_max

Contents

polartoolkit.get_min_max#

get_min_max(values, shapefile=None, robust=False, region=None, hemisphere=None, epsg=None, absolute=False, robust_percentiles=(0.02, 0.98))[source]#

Get a grids max and min values.

Parameters:
  • values (DataArray | Series | ndarray[tuple[Any, ...], dtype[TypeVar(_ScalarT, bound= generic)]]) – values to find min or max for

  • shapefile (str | GeoDataFrame | None) – path or loaded shapefile to use for a mask, by default None

  • robust (bool) – choose whether to return the 2nd and 98th percentile values, instead of the min/max

  • region (tuple[float, float, float, float] | None) – give a subset region to get min and max values from, in format [xmin, xmax, ymin, ymax], by default None

  • hemisphere (str | None) – if using a shapefile to subset the data, set projection based on β€œnorth” or β€œsouth” hemispheres, by default None

  • epsg (str | None) – if using a shapefile to subset the data, set projection from EPSG code string (β€œ3031”), by default None

  • absolute (bool) – return the absolute min and max values, by default False

  • robust_percentiles (tuple[float, float]) – decimal percentiles to use for robust min and max, by default (0.02, 0.98)

Returns:

returns the min and max values.

Return type:

tuple[float, float]