Accessors API#

The main xoa accessor is registered when xoa is imported. The meta and decode_sigma accessors are available as subaccessors of it, like da.xoa.meta and ds.xoa.decode_sigma (the latter for datasets only), and can also be registered at the top level with xoa.register_accessors(), like ds.meta and ds.decode_sigma().

DataArray#

Attributes#

DataArray.xoa.xdim

X dimension

DataArray.xoa.ydim

Y dimension name

DataArray.xoa.zdim

Z dimension name

DataArray.xoa.tdim

T (time) dimension name

DataArray.xoa.name

Get the generic name that matches this array

DataArray.xoa.attrs

Get the generic attributes that matches this array

DataArray.xoa.coords

Sub-accessor for coords only

DataArray.xoa.data_vars

Sub-accessor for data_vars only

DataArray.xoa.meta

The MetaDataArrayAccessor subaccessor

Methods#

DataArray.xoa.set_meta_specs(meta_specs)

Set the internal MetaSpecs used by this accessor

DataArray.xoa.get_meta_specs()

Get the internal MetaSpecs instance used by this accessor

DataArray.xoa.decode(**kwargs)

Rename variables and coordinates to generic names

DataArray.xoa.encode(**kwargs)

Rename variables and coordinates to specialized names

DataArray.xoa.auto_format(**kwargs)

Rename variables and coordinates and fill their attributes

DataArray.xoa.fill_attrs(**kwargs)

Fill missing attributes

DataArray.xoa.infer_coords(**kwargs)

Infer coordinates and set them as coordinates

DataArray.xoa.get(meta_name[, loc, single, ...])

Search for a data array or coordinate knowing its generic CF name

DataArray.xoa.get_coord(meta_name[, loc, ...])

Search for a coordinate knowing its generic CF name

DataArray.xoa.get_z([errors])

Get the z, positive up, as computed or recognized by the MetaSpecs()

DataArray.xoa.get_depth([errors])

Get the depth, positive down, as computed or recognized by the MetaSpecs()

DataArray.xoa.interp(dst_lon, dst_lat[, ...])

Interpolate to arbitrary destination points

DataArray.xoa.regrid(dst[, method, ...])

Regrid horizontally, and optionally in time, to a destination grid

DataArray.xoa.get_geos([dx, dy])

Get the geostrophic currents, see xoa.dyn.get_geos()

DataArray.xoa.get_cyclogeos(**kwargs)

Get the cyclogeostrophic currents, see xoa.dyn.get_cyclogeos()

DataArray.xoa.harmonic_analysis(**kwargs)

Get the tidal harmonic coefficients, see xoa.tide.harmonic_analysis()

DataArray.xoa.tidal_filter(filter_name, **kwargs)

Filter the tide, see xoa.tide.tidal_filter()

DataArray.xoa.get_polygon_mask(polygon[, ...])

Get a mask of the cells that are inside polygons, see xoa.mask.get_polygon_mask()

DataArray.xoa.get_neighbors(target[, k, ...])

Find the neighbors of target points, see xoa.geo.get_neighbors()

DataArray.xoa.get_geosel(*args[, sphere_radius])

Select the points near a point or in a shape, see xoa.geo.get_geosel()

DataArray.xoa.geosel(*args[, mask])

Select the object in a box, a circle or a polygon, or at the nearest point

Dataset#

Attributes#

Dataset.xoa.coords

Sub-accessor for coords only

Dataset.xoa.data_vars

Sub-accessor for data_vars only

Dataset.xoa.meta

The MetaDatasetAccessor subaccessor

Dataset.xoa.decode_sigma

The SigmaAccessor subaccessor for sigma coordinates

Methods#

Dataset.xoa.set_meta_specs(meta_specs)

Set the internal MetaSpecs used by this accessor

Dataset.xoa.get_meta_specs()

Get the internal MetaSpecs instance used by this accessor

Dataset.xoa.decode(**kwargs)

Rename variables and coordinates to generic names

Dataset.xoa.encode(**kwargs)

Rename variables and coordinates to specialized names

Dataset.xoa.auto_format(**kwargs)

Rename variables and coordinates and fill their attributes

Dataset.xoa.fill_attrs(**kwargs)

Fill missing attributes

Dataset.xoa.infer_coords(**kwargs)

Infer coordinates and set them as coordinates

Dataset.xoa.get(meta_name[, loc, single, errors])

Search for a data array or coordinate knowing its generic CF name

Dataset.xoa.get_coord(meta_name[, loc, ...])

Search for a coordinate knowing its generic CF name

Dataset.xoa.get_z([errors])

Get the z, positive up, as computed or recognized by the MetaSpecs()

Dataset.xoa.get_depth([errors])

Get the depth, positive down, as computed or recognized by the MetaSpecs()

Dataset.xoa.interp(dst_lon, dst_lat[, ...])

Interpolate to arbitrary destination points

Dataset.xoa.regrid(dst[, method, dst_time, ...])

Regrid horizontally, and optionally in time, to a destination grid

Dataset.xoa.get_relvort([dx, dy, z])

Get the relative vorticity, see xoa.dyn.get_relvort()

Dataset.xoa.get_rossby([dx, dy, z])

Get the Rossby number, see xoa.numbers.get_rossby()

Dataset.xoa.get_div([dx, dy, z, normalize])

Get the horizontal divergence, see xoa.dyn.get_div()

Dataset.xoa.get_strain([dx, dy, z, normalize])

Get the normal and shear strains, see xoa.dyn.get_strain()

Dataset.xoa.get_okuboweiss([dx, dy, z, ...])

Get the Okubo-Weiss parameter, see xoa.dyn.get_okuboweiss()

Dataset.xoa.harmonic_predict(t_out, **kwargs)

Predict the tide from harmonic coefficients, see xoa.tide.harmonic_predict()

Dataset.xoa.get_polygon_mask(polygon[, ...])

Get a mask of the cells that are inside polygons, see xoa.mask.get_polygon_mask()

Dataset.xoa.get_neighbors(target[, k, ...])

Find the neighbors of target points, see xoa.geo.get_neighbors()

Dataset.xoa.get_geosel(*args[, sphere_radius])

Select the points near a point or in a shape, see xoa.geo.get_geosel()

Dataset.xoa.geosel(*args[, mask])

Select the object in a box, a circle or a polygon, or at the nearest point

Dataset.decode_sigma.decode([rename, ref, ...])

Compute depth from sigma coordinates

Dataset.decode_sigma.get_sigma_terms([loc, ...])

Call get_sigma_terms() on the dataset

Callables#

Dataset.decode_sigma(**kwargs)

Shortcut to decode()

Plotting#

The plot attribute of the xoa accessors, like da.xoa.plot.field(), has the following methods.

class xoa.accessors.XoaPlotAccessor(obj)[source]

Plotting methods of the main xoa accessors, that call the xoa.plot functions

The accessed array or dataset is passed as the first argument.

field(*args, **kwargs)[source]

Plot a field on a map, see xoa.plot.plot_field()

grid(*args, **kwargs)[source]

Plot a grid, see xoa.plot.plot_grid()

rose(*args, **kwargs)[source]

Plot a wind or wave rose, see xoa.plot.plot_rose()

section(*args, **kwargs)[source]

Plot a vertical section, see xoa.plot.plot_section()

stick(*args, **kwargs)[source]

Plot sticks of currents, see xoa.plot.plot_stick()

taylor(ref, *args, **kwargs)[source]

Plot a Taylor diagram against a reference, see xoa.plot.plot_taylor()