OpenDrift / trajan

Trajectory analysis package for simulated and observed trajectories
https://opendrift.github.io/trajan/
GNU General Public License v2.0
11 stars 5 forks source link

Add selobs/seltrajectory method #138

Open gauteh opened 6 days ago

gauteh commented 6 days ago

Often you want to iterate over trajectories and get the data in the time vs variable format. As long as you only have one trajectory you can reduce the observation layout to just 1d time layout. Would be nice if this works with groupby as well.

ds.traj.iseltraj(0)

gives a ds in (trajectory, time) format (except trajectory is size 1).

ds.traj.grouptraj().map(lambda t: t....)
gauteh commented 5 days ago

Will be fixed by #104 and the to_1d() method:

ds.isel(trajectory=0).traj.to_1d()