_HdfData

Contents

_HdfData#

class _HdfData(ifile, dataset_id=None, **kwargs)[source]#

Bases: _HdfArray, ABC

Abstract base class for a PSI MAS or POT3D HDF data reader.

Extends _HdfArray with file lifecycle management, coordinate scale readers, value-space slicing, and spatial interpolation. Concrete implementations are H4Data (HDF4 backend) and H5Data (HDF5 backend).

Instances should be obtained via PsiData(), not constructed directly.

Attributes:
_filepathpathlib.Path

Absolute path to the open HDF file.

_icacheRegularGridInterpolator | None

Cached scipy interpolator, or None if not yet built.

See also

H4Data

HDF4 concrete implementation.

H5Data

HDF5 concrete implementation.

PsiData

Public factory function.

Methods

clear([data, interp, recursive])

Release cached data and/or the cached interpolator.

close()

Close the open file handle and set the internal reference to None.

delete()

Release the file handle during garbage collection (called by __del__).

interp(data[, unit])

Interpolate the dataset at arbitrary spatial positions.

load([interp, recursive])

Load the data array and optionally build the interpolator into memory.

open()

Re-open the file handle if it was previously closed.

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

Read data by index with optional unit conversion and coordinate scales.

validate_metadata()

Validate data-reader metadata including model, scale, and shape consistency.

vslice(*args[, unit, mesh, order, scales, ...])

Read data by physical coordinate value with linear interpolation.

Class Methods

read_file(ifile)

Open the HDF file at ifile and return the format-specific file handle.

Properties

interp_cached

Whether a RegularGridInterpolator is cached.

model

PSI model type string.

scales

Named tuple of coordinate scale readers (r, t, p).

sequence

Time-step sequence number extracted from the filename or file attributes.