cfdm.RaggedArray


class cfdm.RaggedArray(*args, **kwargs)[source]

Bases: CompressedArray

An underlying ragged array.

See CF section 9 “Discrete Sampling Geometries”

Added in version (cfdm): 1.10.0.0

Initialisation

Parameters:
compressed_array: array_like

The compressed data.

shape: tuple

The shape of the uncompressed array.

compressed_dimensions: dict

Mapping of dimensions of the compressed array to their corresponding dimensions in the uncompressed array. Compressed array dimensions that are not compressed must be omitted from the mapping.

Parameter example:

{0: (0, 1)}

Parameter example:

{0: (0, 1, 2)}

count_variable: Count, optional

A count variable for uncompressing the data, corresponding to a CF-netCDF count variable, if required by the decompression method.

index_variable: Index, optional

An index variable for uncompressing the data, corresponding to a CF-netCDF count variable, if required by the decompression method.

source: optional

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

All other parameters, apart from copy, are ignored and their values are instead inferred from source by assuming that it has the RaggedArray 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 RaggedArray instance then cfdm.RaggedArray(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.

Methods

Methods

Units

The Units object containing the units of the array.

array

Returns a numpy array containing the uncompressed data.

astype

Cast the data to a specified type.

compressed_array

Returns an independent numpy array with the compressed data.

compressed_dimensions

Mapping of compressed to uncompressed dimensions.

conformed_data

The data as required by the decompression algorithm.

copy

Return a deep copy of the array.

dtype

Data-type of the uncompressed data.

get_Subarray

Return the Subarray class.

get_attributes

The attributes of the array.

get_calendar

The calendar of the array.

get_compressed_axes

Return axes that are compressed in the underlying array.

get_compressed_dimension

Returns the compressed dimension's position in the array.

get_compression_type

Returns the array's compression type.

get_count

Return the count variable for the compressed array.

get_filename

Return the name of the file containing the compressed data.

get_index

Return the index variable for the compressed array.

get_units

The units of the array.

ndim

Number of array dimensions.

shape

Shape of the uncompressed data.

size

Number of elements in the array.

source

Return the underlying array object.

subarray_parameters

Non-data parameters required by the Subarray class.

subarray_shapes

Create the subarray shapes along each uncompressed dimension.

subarrays

Return descriptors for every subarray.

to_memory

Bring data on disk into memory.