polartoolkit.grid_compare

Contents

polartoolkit.grid_compare#

grid_compare(da1, da2, plot=True, plot_type=None, robust=False, **kwargs)[source]#

Find the difference between 2 grids and plot the results, if necessary resample and cut grids to match

Parameters:
  • da1 (DataArray | str) – first grid, loaded grid of filename

  • da2 (DataArray | str) – second grid, loaded grid of filename

  • plot (bool) – plot the results, by default True

  • plot_type (Any | None) – this argument has been deprecated and will default to ‘pygmt’

  • robust (bool) – use xarray robust color lims instead of min and max, by default is False.

  • kwargs (Any)

Keyword Arguments:
  • shp_mask (str) – deprecated, use shapefile instead,

  • shapefile (str or geopandas.GeoDataFrame) – shapefile or filename to use to mask the grids for setting the color range.

  • robust (bool) – use xarray robust color lims instead of min and max, by default is False.

  • region (tuple[float, float, float, float]) – choose a specific region to compare, in format [xmin, xmax, ymin, ymax].

  • rmse_in_title (bool) – add the RMSE to the title, by default is True.

  • cpt_lims (tuple[float, float]) – set the colorbar limits for the two grids.

  • diff_lims (tuple[float, float]) – set the colorbar limits for the difference grid.

Returns:

three xarray.DataArrays: (diff, resampled grid1, resampled grid2)

Return type:

tuple[DataArray, DataArray, DataArray]