pangeo_fish.helpers.regrid_dataset#
- pangeo_fish.helpers.regrid_dataset(*, ds: Dataset, nside: int, min_vertices=1, rot={'lat': 0, 'lon': 0}, 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 datanside (
int) – Tesolution of the HEALPix gridmin_vertices (
int, default:1) – Minimum number of vertices for a valid transcriptionrot (mapping of
strtotupleoffloat, default:{"lat": 0, "lon": 0}) – Mapping of angles to rotate the HEALPix grid. It must contain the keys “lon” and “lat”dims (
listofstr, default:[``”cells”: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