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 datarefinement_level (
int) – Refinement level, resolution of the HEALPix gridmin_vertices (
int, default:1) – Minimum number of vertices for a valid transcriptiondims (
listofstr, 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 datasettarget_root (
str, default:".") – Root of the folder to save the.zarrarray (under{target_root}/diff-regridded.zarr). Only used ifsave=Truestorage_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 dsfigure (
plt.FigureorNone) – The plot of reshaped, or None if plot=False