get_coords#

mhm_tools.common.cli_utils.get_coords(lonlatbox=None, mask_file=None, lon_min=None, lon_max=None, lat_min=None, lat_max=None, raise_exception=True, mask_var=None, resolutions=None)[source]#

Get coordinate bounds from a lonlatbox string, mask file, or explicit values.

Parameters:
  • lonlatbox (str, optional) – Comma-separated ‘lon_min,lon_max,lat_min,lat_max’.

  • mask_file (str, optional) – Path to a mask NetCDF file.

  • lon_min, lon_max, lat_min, lat_max (float, optional) – Explicit coordinate bounds.

  • raise_exception (bool) – If True, raise ValueError when inputs are insufficient.

Returns:

(lon_min, lon_max, lat_min, lat_max, mask_dataarray or None)

Return type:

tuple