oceanspy.OceanDataset

class oceanspy.OceanDataset(dataset)[source]

OceanDataset combines a xarray.Dataset with other objects used by OceanSpy (e.g., xgcm.Grid).

Additional objects are attached to the xarray.Dataset as global attributes.

__init__(dataset)[source]
Parameters:
dataset: xarray.Dataset

The multi-dimensional, in memory, array database.

References

http://xarray.pydata.org/en/stable/generated/xarray.Dataset.html

Methods

__init__(dataset)

Parameters:

create_tree([grid_pos])

Create a scipy.spatial.cKDTree for quick nearest-neighbor lookup.

manipulate_coords([fillna, coords1Dfrom2D, ...])

Manipulate coordinates to make them compatible with OceanSpy.

merge_into_oceandataset(obj[, overwrite])

Merge a Dataset or DataArray into the OceanDataset.

set_aliases(aliases[, overwrite])

Set aliases to connect custom variables names to OceanSpy reference names.

set_description(description[, overwrite])

Set description of the OceanDataset.

set_face_connections(face_connections)

Set face conections that define the grid topology that gets read by xgcm.Grid Parameters ---------- face_connections: dict Dictionary the connections of each face along each direction.

set_grid_coords(grid_coords[, add_midp, ...])

Set grid coordinates used by xgcm.Grid.

set_grid_periodic(grid_periodic)

Set grid axes that will be treated as periodic by xgcm.Grid.

set_name(name[, overwrite])

Set name of the OceanDataset.

set_parameters(parameters)

Set model parameters used by OceanSpy.

set_projection(projection, **kwargs)

Set Cartopy projection of the OceanDataset.

shift_averages([averageList])

Shift average variables to time_midp.

to_netcdf(path, **kwargs)

Write contents to a netCDF file.

to_zarr(path, **kwargs)

Write contents to a zarr group.

Attributes

aliases

A dictionary to connect custom variable names to OceanSpy reference names.

animate

Access oceanspy.animate functions.

compute

Access oceanspy.compute functions, and merge the computed Dataset into the OceanDataset.

dataset

xarray.Dataset: A multi-dimensional, in memory, array database.

description

Description of the OceanDataset.

face_connections

Defines the topology of the grid used by xgcm.Grid.

grid

xgcm.Grid: A collection of axes, which is a group of coordinates that all lie along the same physical dimension but describe different positions relative to a grid cell.

grid_coords

Grid coordinates used by xgcm.Grid.

grid_periodic

List of xgcm.Grid axes that are periodic.

name

Name of the OceanDataset.

parameters

A dictionary defining model parameters that are used by OceanSpy.

plot

Access oceanspy.plot functions.

projection

Cartopy projection of the OceanDataset.

subsample

Access oceanspy.subsample functions.