vslice#
- _HdfData.vslice(
- *args,
- unit=None,
- mesh=None,
- order=None,
- scales=True,
- bounds_error=True,
Read data by physical coordinate value with linear interpolation.
Extends
read()to accept physical coordinate values as positional arguments. A scalar orQuantityargument for an axis locates the two nearest grid points and linearly interpolates to the target value. Index-space arguments (None,int,slice) are handled identically toread().Attention
When reading/slicing data, the
*argsare always supplied in physical (e.g. \((r, \theta, \phi)\)) order. However, unless specified with theorderargument, the sliced data array will be returned in storage order.- Parameters:
- *args
QuantityLike|int|slice|None One argument per axis in physical
(r, t, p)order. Physical coordinate values trigger interpolation; index-space arguments do not.- unit
UnitLike|None, optional Output unit. Default is
None(code units).- mesh
MeshCodeType|None, optional Target stagger mesh. Default is
None.- order
ArrayOrdering|None, optional Transpose output if it differs from storage order. Default is
None.- scalesbool, optional
If
True(default), return coordinate slices alongside the data.- bounds_errorbool, optional
If
True(default), raiseValueErrorwhen a physical value is outside the coordinate range.
- *args
- Returns:
- Raises:
ValueErrorIf bounds_error is
Trueand a physical value falls outside the coordinate range.
Examples
>>> # Extract the r = 2.5 solar radii surface >>> data, r, t, p = reader.vslice(2.5 * u.R_sun)