trajan.trajectory_accessor

Extending xarray Dataset with functionality specific to trajectory datasets.

Presently supporting Cf convention H.4.1 https://cfconventions.org/Data/cf-conventions/cf-conventions-1.10/cf-conventions.html#_multidimensional_array_representation_of_trajectories.

Module Contents

Classes

TrajAccessor

Attributes

logger

trajan.trajectory_accessor.logger
class trajan.trajectory_accessor.TrajAccessor(xarray_obj)
property plot
property ds
_ds :xarray.Dataset
__plot__ :trajan.plot.Plot
inner :trajan.traj.Traj
__getattr__(attr)

Forward all other method calls and attributes to traj instance.

time_to_next()

Returns time from one position to the next

Returned datatype is np.timedelta64 Last time is repeated for last position (which has no next position)

distance_to_next()

Returns distance in m from one position to the next

Last time is repeated for last position (which has no next position)

speed()

Returns the speed [m/s] along trajectories

index_of_last()

Find index of last valid position along each trajectory

insert_nan_where(condition)

Insert NaN-values in trajectories after given positions, shifting rest of trajectory

drop_where(condition)

Remove positions where condition is True, shifting rest of trajectory