_HdfArray

Contents

_HdfArray#

class _HdfArray(*args, cache='lazy', **kwargs)[source]#

Bases: ABC

Abstract base class for a single HDF dataset with optional caching.

Provides the common interface for both data arrays (_HdfData) and coordinate scale arrays (_HdfScale). Concrete subclasses supply the HDF-version-specific implementations of the abstract properties (_shape, dtype, size, nbytes, ndim, attrs) and the _dataset() factory.

Subclasses must not be instantiated directly. Use PsiData() or the concrete classes H4Data, H5Data, H4Scale, and H5Scale.

Attributes:
_vcachenp.ndarray | None

In-memory copy of the full dataset array, or None when not cached.

_cacheCacheType

Active cache mode: 'lazy', 'eager', or None.

See also

_HdfData

Subclass that adds interpolation and scale management.

_HdfScale

Subclass for one-dimensional coordinate arrays.

PsiData

Public factory function.

Methods

clear(**kwargs)

Release the in-memory data cache.

load(**kwargs)

Load the full dataset into the in-memory cache.

read(*args[, unit, mesh, order, scales])

Read data by index with optional unit conversion.

select(id_)

Return the HDF dataset or sub-dataset identified by id_.

slice(*args, **kwargs)

Alias for read().

validate_metadata()

Validate resolved metadata and emit MetaDataWarning for any issues.

Properties

attrs

HDF dataset-level attributes as a plain Python dictionary.

cache

Active cache mode.

cached

Alias for data_cached.

data_cached

Whether the full data array is currently held in memory.

dataset

The primary HDF dataset object for this reader.

desc

Human-readable description of the physical quantity.

dtype

Element data type of the HDF dataset.

mesh

Yee-grid stagger code for this dataset.

name

Canonical lower-case quantity identifier.

nbytes

Dataset size in bytes.

ndim

Number of spatial dimensions in the dataset.

order

Memory layout of the stored array.

shape

Array shape in physical (r, t, p) order.

size

Total number of elements in the dataset.

unit

Astropy unit for converting from code units to physical units.