shnitsel.data.shnitsel_db.db_trajectory_data

Attributes

T

Classes

TrajectoryData

DataTree node to keep track of a single trajectory entry

Module Contents

T
class TrajectoryData(dataset=None, name=None)

Bases: xarray.DataTree

DataTree node to keep track of a single trajectory entry

Parameters:
  • dataset (xarray.Dataset | shnitsel.data.trajectory_format.Trajectory | None)

  • name (str | None)

is_level(target_level)

Check whether we are at a certain level

Parameters:

target_level (str) – Desired level to check for

Returns:

True if this level satisfies the requirements

Return type:

bool

collect_trajectories()

Function to retrieve all trajectories in this subtree

Returns:

List of all nodes with TrajectoryData type

Return type:

List[TrajectoryData]

map_over_trajectories(map_func, result_as_dict=False, result_var_name='result')

Method to apply a function to all trajectories in this subtree.

Parameters:
  • map_func (Callable[[Trajectory], T]) – Function to be applied to each individual trajectory in this database structure.

  • result_as_dict (bool, optional) – Whether to return the result as a dict or as a TrajectoryData structure. Defaults to False which yields a CompoundGroup.

  • result_var_name (str,optional) – The name of the result variable to be assigned in either the result dataset or in the result dict.

Returns:

The result, either again as a TrajectoryData structure or as a layered dict structure.

Return type:

TrajectoryData|dict