xdas.virtual#

VirtualArray#

Base class for all virtual array types.

Attributes

VirtualArray.shape

Tuple of array dimensions (abstract — must be overridden).

VirtualArray.dtype

NumPy dtype of the array elements (abstract — must be overridden).

VirtualArray.ndim

Number of dimensions.

VirtualArray.size

Total number of elements.

VirtualArray.nbytes

Total number of bytes occupied by the array elements.

VirtualArray.empty

True if the array contains no elements.

Methods

VirtualArray.to_dataset(file_or_group, name)

Write this virtual array as an HDF5 dataset (abstract — must be overridden).

VirtualSource#

A lazy pointer to a single dataset inside an HDF5/NetCDF4 file.

Constructor

VirtualSource(path_or_dataset[, name, ...])

A lazy array object pointing toward a netCDF4/HDF5 file.

Attributes

VirtualSource.vsource

Underlying h5py.VirtualSource with the current selection applied.

VirtualSource.shape

Shape of the selected region of the source dataset.

VirtualSource.dtype

NumPy dtype of the source dataset.

VirtualSource.ndim

Number of dimensions.

VirtualSource.size

Total number of elements.

VirtualSource.nbytes

Total number of bytes occupied by the array elements.

VirtualSource.empty

True if the array contains no elements.

Methods

VirtualSource.to_dataset(file_or_group, name)

Write this source as an HDF5 virtual dataset in file_or_group.

VirtualStack#

A lazy concatenation of multiple VirtualSource objects along one axis.

Constructor

VirtualStack([sources, axis])

Lazy concatenation of multiple VirtualSource objects along one axis.

Attributes

VirtualStack.sources

List of VirtualSource objects in the stack.

VirtualStack.axis

Concatenation axis index.

VirtualStack.shape

Shape of the concatenated virtual array.

VirtualStack.dtype

NumPy dtype shared by all sources in the stack.

VirtualStack.ndim

Number of dimensions.

VirtualStack.size

Total number of elements.

VirtualStack.nbytes

Total number of bytes occupied by the array elements.

VirtualStack.empty

True if the array contains no elements.

Methods

VirtualStack.append(source)

Append source to the stack.

VirtualStack.extend(sources)

Extend the stack with an iterable of sources.

VirtualStack.to_dataset(file_or_group, name)

Write the stacked virtual array as an HDF5 virtual dataset.

VirtualLayout#

Internal HDF5 virtual dataset layout object.

VirtualLayout(shape, dtype[, maxshape, filename])

A lazy array layout pointing toward multiple netCDF4/HDF5 files.

Attributes

VirtualLayout.shape

Shape of the layout after any lazy selections.

VirtualLayout.dtype

NumPy dtype of the layout.

Methods

VirtualLayout.to_dataset(file_or_group, name)

Write the layout as an HDF5 virtual dataset in file_or_group.

Selection#

Selection(shape)

Used to perform lazy selection.

Attributes

Selection.shape

Shape of the array after all selections are applied.

Selection.ndim

Number of dimensions remaining after selections.

Methods

Selection.get_indexer()

Return a tuple of slices/ints that materialises the accumulated selections.