read

Contents

read#

_HdfArray.read(*args, unit=None, mesh=None, order=None, scales=False)[source]#

Read data by index with optional unit conversion.

Attention

When reading/slicing data, the *args are always supplied in physical (e.g. \((r, \theta, \phi)\)) order. However, unless specified with the order argument, the sliced data array will be returned in storage order.

Attention

The scales argument is only functional on the main data array reader (_HdfData). It is accepted by scale readers (_HdfScale) for pass-through compatibility but has no effect there.

Parameters:
*argsint | tuple | slice | None

Index-space axis arguments in physical (r, t, p) order.

unitUnitLike | None, optional

Output unit. Default is None (code units).

meshMeshLike | None, optional

Target stagger mesh. Default is None (no remeshing).

orderArrayOrdering | None, optional

Transpose the output if it differs from storage order. Default is None.

scalesbool, optional

If True (default), return coordinate slices alongside data.

Returns:
dataQuantity

Sliced data array with the specified mesh staggering, units, and ordering applied.

*scalesQuantity

Sliced scales (only returned when scales is True).

Examples

>>> data, = reader.read(scales=True)