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 (xarray.DataArray or pandas.Series or numpy.ndarray) – values to find min or max for

  • shapefile (Union[str or geopandas.GeoDataFrame], optional) – path or loaded shapefile to use for a mask, by default None

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

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

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

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

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

  • robust_percentiles (tuple[float, float], optional) – 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]