check_resolutions#

mhm_tools.common.esri_grid.check_resolutions(cellsize_1, cellsize_2, first_finer=False, name_1='LA', name_2='LB', tol=1e-07)[source]#

Check two resolutions for compatibility.

Parameters:
  • cellsize_1 (float) – First cell-size to compare (i.e. finer resolution)

  • cellsize_2 (float) – Second cell-size to compare (i.e. coarser resolution)

  • first_finer (bool, optional) – Whether to force the first given cell-size to be finer, by default False

  • name_1 (str, optional) – Name of the first grid/level, by default “LA”

  • name_2 (str, optional) – Name of the second grid/level, by default “LB”

Returns:

ratio – Cell-size ratio of coarse/fine.

Return type:

int

Raises:
  • ValueError – If a should be finer than b but isn’t.

  • ValueError – If cell factor is not an integer.