cfdm.CellConnectivitySubarray


class cfdm.CellConnectivitySubarray(data=None, indices=None, shape=None, compressed_dimensions=None, dtype=None, start_index=None, cell_dimension=None, source=None, copy=True, context_manager=None)[source]

Bases: MeshSubarray

A cell connectivity subarray defined by UGRID connectivity.

A subarray describes a unique part of the uncompressed array.

A UGRID connectivity variable contains indices which map each cell to its neighbours, as found in a UGRID “face_face_connectivity” variable.

Added in version (cfdm): 1.11.0.0

Initialisation

Parameters:
data: array_like

A 2-d integer array that contains zero-based indices that identifies UGRID nodes for each cell, as found in a UGRID connectivity variable. This array contains the indices for all subarrays.

indices: tuple of slice

The indices of data that define this subarray.

shape: tuple of int

The shape of the uncompressed subarray.

compressed_dimensions: dict

Mapping of compressed to uncompressed dimensions.

A dictionary key is a position of a dimension in the compressed data, with a value of the positions of the corresponding dimensions in the uncompressed data. Compressed array dimensions that are not compressed must be omitted from the mapping.

start_index: int

The base of the indices provided by the integer index array. Must be 0 or 1 for zero- or one-based indices respectively.

cell_dimension: int

The position of the data dimension that indexes the cells, either 0 or 1.

source: optional

Convert source, which can be any type of object, to a CellConnectivitySubarray instance.

All other parameters, apart from copy, are ignored and their values are instead inferred from source by assuming that it has the CellConnectivitySubarray API. Any parameters that can not be retrieved from source in this way are assumed to have their default value.

Note that if x is also a CellConnectivitySubarray instance then cfdm.CellConnectivitySubarray(source=x) is equivalent to x.copy().

copy: bool, optional

If True (the default) then deep copy the input parameters prior to initialisation. By default the parameters are not deep copied.

context_manager: function, optional

A context manager that provides a runtime context for the conversion of data to a numpy array.

Methods

Methods

Units

The Units object containing the units of the array.

array

Return an independent numpy array containing the data.

astype

Cast the data to a specified type.

cell_dimension

The position of the dimension that indexes the cells.

compressed_dimensions

Mapping of compressed to uncompressed dimensions.

copy

Return a deep copy of the array.

data

The full compressed array spanning all subarrays.

dtype

The data-type of the uncompressed data.

get_attributes

The attributes of the array.

get_calendar

The calendar of the array.

get_compression_type

Returns the array's compression type.

get_filename

Return the name of the file containing the data.

get_units

The units of the array.

indices

The indices of the data that define this subarray.

ndim

Number of array dimensions.

shape

The shape of the uncompressed data.

size

Number of elements in the array.

start_index

The start index of values in the compressed data.