shnitsel.data.shnitsel_db.db_trajectory_data¶
Attributes¶
Classes¶
DataTree node to keep track of a single trajectory entry |
Module Contents¶
- T¶
- class TrajectoryData(dataset=None, name=None)¶
Bases:
xarray.DataTreeDataTree 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
- 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: