pangeo_fish.helpers.regrid_dataset

Contents

pangeo_fish.helpers.regrid_dataset#

pangeo_fish.helpers.regrid_dataset(*, ds: Dataset, refinement_level: int, min_vertices=1, dims: list[str] = ['cells'], plot=False, save=False, target_root='.', storage_options: dict = None, **kwargs)#

Regrid a dataset as a HEALPix grid, whose primary advantage is that all its cells/pixels cover the same surface area.

Parameters:
  • ds (xarray.Dataset) – The DST data

  • refinement_level (int) – Refinement level, resolution of the HEALPix grid

  • min_vertices (int, default: 1) – Minimum number of vertices for a valid transcription

  • dims (list of str, default: [``”cells”:py:class:`]`) -- The list of the dimensions. Either ``["x", "y"] or ["cells"].

  • plot (bool, default: False) – Whether to return a plot of the dataset

  • save (bool, default: False) – Whether to save the dataset

  • target_root (str, default: ".") – Root of the folder to save the .zarr array (under {target_root}/diff-regridded.zarr). Only used if save=True

  • storage_options (mapping, optional) – Dictionary containing storage options for connecting to the S3 bucket. Only used if save=True

Returns:

  • reshaped (xarray.Dataset) – HEALPix version of ds

  • figure (plt.Figure or None) – The plot of reshaped, or None if plot=False