Lineout¶
-
nata.containers.GridDataset.
lineout
(dataset: nata.containers.GridDataset, fixed: Union[str, int], value: float) → nata.containers.GridDataset¶ Takes a lineout across a two-dimensional, single/multiple iteration
nata.containers.GridDataset
:- Parameters
fixed (:class:
str
or :class:int
) –Selection of the axes along which the taken lineout is constant.
if it is a string, then it must match the
name
property of an existing grid axis indataset
.if it is an integer, then it must match the index of a grid axis in
dataset
(i.e.0
or1
).
value (scalar) – Value between the minimum and maximum of the axes selected through
fixed
over which the lineout is taken.
- Returns
nata.containers.GridDataset
– One-dimensionalnata.containers.GridDataset
.
Examples
The following example shows how to obtain a lineout from a two-dimensional
nata.containers.GridDataset
. Since no axes are attributed to the dataset in this example, they are automatically generated with no names, andfixed
must be an integer.>>> from nata.containers import GridDataset >>> import numpy as np >>> arr = np.arange(25).reshape((5,5)) >>> ds = GridDataset(arr[np.newaxis]) >>> lo = ds.lineout(fixed=0, value=2) >>> lo.data array([10, 11, 12, 13, 14])