geoviews.data.iris module#

class geoviews.data.iris.CubeInterface(*, name)[source]#

Bases: GridInterface

The CubeInterface provides allows HoloViews to interact with iris Cube data. When passing an iris Cube to a HoloViews Element the init method will infer the dimensions of the Cube from its coordinates. Currently the interface only provides the basic methods required for HoloViews to work with an object.

Methods

add_dimension(columns, dimension, dim_pos, ...)

Adding value dimensions not currently supported by iris interface.

aggregate(columns, kdims, function, **kwargs)

Aggregation currently not implemented.

applies(obj)

Indicates whether the interface is designed specifically to handle the supplied object's type.

assign(dataset, new_data)

Adds a dictionary containing data for multiple new dimensions to a copy of the dataset.data.

concat_dim(datasets, dim, vdims)

Concatenates datasets along one dimension.

coords(dataset, dim[, ordered, expanded])

Returns the coordinates along a dimension.

dtype(dataset, dimension)

Returns the dtype for the selected dimension.

groupby(dataset, dims[, container_type, ...])

Groups the data by one or more dimensions returning a container indexed by the grouped dimensions containing slices of the cube wrapped in the group_type.

irregular(dataset, dim)

CubeInterface does not support irregular data

length(dataset)

Returns the total number of samples in the dataset.

loaded()

Indicates whether the required dependencies are loaded.

range(dataset, dimension)

Computes the range along a particular dimension.

redim(dataset, dimensions)

Rename coords on the Cube.

reindex(dataset[, kdims, vdims])

Reindexes data given new key and value dimensions.

sample(dataset[, samples])

Sampling currently not implemented.

select(dataset[, selection_mask])

Apply a selection to the data.

select_to_constraint(dataset, selection)

Transform a selection dictionary to an iris Constraint.

shape(dataset[, gridded])

Returns the shape of the data.

sort(columns[, by, reverse])

Cubes are assumed to be sorted by default.

validate(dataset[, vdims])

Validation runs after the Dataset has been constructed and should validate that the Dataset is correctly formed and contains all declared dimensions.

values(dataset, dim[, expanded, flat, ...])

Returns an array of the values along the supplied dimension.

init

mask

packed

Parameter Definitions


classmethod add_dimension(columns, dimension, dim_pos, values, vdim)[source]#

Adding value dimensions not currently supported by iris interface.

Adding key dimensions not possible on dense interfaces.

classmethod aggregate(columns, kdims, function, **kwargs)[source]#

Aggregation currently not implemented.

classmethod applies(obj)[source]#

Indicates whether the interface is designed specifically to handle the supplied object’s type. By default simply checks if the object is one of the types declared on the class, however if the type is expensive to import at load time the method may be overridden.

classmethod assign(dataset, new_data)[source]#

Adds a dictionary containing data for multiple new dimensions to a copy of the dataset.data.

Parameters:
datasetDataset

The Dataset to add the dimension to

new_datapython:dict

Dictionary containing new data to add to the Dataset

Returns:
data

A copy of the data with the new data dimensions added

classmethod concat_dim(datasets, dim, vdims)[source]#

Concatenates datasets along one dimension.

classmethod coords(dataset, dim, ordered=False, expanded=False)[source]#

Returns the coordinates along a dimension. Ordered ensures coordinates are in ascending order and expanded creates ND-array matching the dimensionality of the dataset.

classmethod dtype(dataset, dimension)[source]#

Returns the dtype for the selected dimension.

Parameters:
datasetDataset

The dataset to query

dimensionpython:str or Dimension

Dimension to return the dtype for

Returns:
numpy.dtype

The dtype of the selected dimension

classmethod groupby(dataset, dims, container_type=<class 'holoviews.core.spaces.HoloMap'>, group_type=None, **kwargs)[source]#

Groups the data by one or more dimensions returning a container indexed by the grouped dimensions containing slices of the cube wrapped in the group_type. This makes it very easy to break up a high-dimensional dataset into smaller viewable chunks.

classmethod irregular(dataset, dim)[source]#

CubeInterface does not support irregular data

classmethod length(dataset)[source]#

Returns the total number of samples in the dataset.

classmethod loaded()[source]#

Indicates whether the required dependencies are loaded.

classmethod range(dataset, dimension)[source]#

Computes the range along a particular dimension.

classmethod redim(dataset, dimensions)[source]#

Rename coords on the Cube.

classmethod reindex(dataset, kdims=None, vdims=None)[source]#

Reindexes data given new key and value dimensions.

classmethod sample(dataset, samples=None)[source]#

Sampling currently not implemented.

classmethod select(dataset, selection_mask=None, **selection)[source]#

Apply a selection to the data.

classmethod select_to_constraint(dataset, selection)[source]#

Transform a selection dictionary to an iris Constraint.

classmethod shape(dataset, gridded=False)[source]#

Returns the shape of the data.

Parameters:
datasetDataset

The dataset to get the shape from

Returns:
python:tuple[python:int, python:int]

The shape of the data (rows, cols)

classmethod sort(columns, by=None, reverse=False)[source]#

Cubes are assumed to be sorted by default.

classmethod validate(dataset, vdims=True)[source]#

Validation runs after the Dataset has been constructed and should validate that the Dataset is correctly formed and contains all declared dimensions.

classmethod values(dataset, dim, expanded=True, flat=True, compute=True, keep_index=False)[source]#

Returns an array of the values along the supplied dimension.

geoviews.data.iris.coord_to_dimension(coord)[source]#

Converts an iris coordinate to a HoloViews dimension.

geoviews.data.iris.sort_coords(coord)[source]#

Sorts a list of DimCoords trying to ensure that dates and pressure levels appear first and the longitude and latitude appear last in the correct order.