shnitsel.data.trajectory_format_wrapper

Functions

wrap_trajectory(ds)

Function to wrap a dataset or tree of datasets in a trajectory format.

_wrap_single_trajectory(ds)

Function to wrap a single dataset in a trajectory format.

Module Contents

wrap_trajectory(ds)

Function to wrap a dataset or tree of datasets in a trajectory format.

Used to hide the actual type logic of the Trajectory wrapper.

Parameters:

ds (Trajectory|ShnitselDB) – The dataset to wrap in a Trajectory instance. If provided a ShnitselDB tree, all datasets in the tree will be wrapped.

Returns:

The dataset wrapped in a Trajectory object or the original Trajectory instance. Alternatively, the DataTree with each individual dataset wrapped.

Return type:

Trajectory|ShnitselDB

_wrap_single_trajectory(ds)

Function to wrap a single dataset in a trajectory format.

Used to hide the actual type logic of the Trajectory wrapper.

Parameters:

ds (xr.Dataset | Trajectory) – The dataset or trajectory to (potentially) wrap in a Trajectory instance.

Returns:

The dataset wrapped in a Trajectory object or the original Trajectory instance.

Return type:

Trajectory