plots.sources.xarray

Classes

XarraySource

Source class for xarray data.

Module Contents

class plots.sources.xarray.XarraySource

Bases: earthkit.plots.sources.single.SingleSource

Source class for xarray data.

Parameters:
  • data (xarray.Dataset) – The data to be plotted.

  • x (str, optional) – The x-coordinate variable in data.

  • y (str, optional) – The y-coordinate variable in data.

  • z (str, optional) – The z-coordinate variable in data.

  • u (str, optional) – The u-component variable in data.

  • v (str, optional) – The v-component variable in data.

  • crs (cartopy.crs.CRS, optional) – The CRS of the data.

  • **kwargs – Metadata keys and values to attach to this Source.

property coordinate_axis
The coordinate axis of the data. One of 'x' or 'y'.
property crs
The CRS of the data.
property data
The underlying xarray data.
datetime()

Get the datetime of the data.

property dims
The dimensions of the data.
extract_u()

Extract the u values of the data.

extract_v()

Extract the v values of the data.

extract_x()

Extract the x values of the data.

extract_xy()

Extract the x and y values from the data.

extract_xyz()

Extract the x, y and z values from the data.

extract_y()

Extract the y values of the data.

extract_z()

Extract the z values of the data.

property magnitude_values
The magnitude values of the data.
metadata(key, default=None)

Extract metadata from the data.

Parameters:
  • key (str) – The metadata key to extract.

  • default (any, optional) – The default value to return if the key is not found.

property u_values
The u values of the data.
property v_values
The v values of the data.
property x_values
The x values of the data.
property y_values
The y values of the data.
property z_values
The z values of the data.