Note
Go to the end to download the full example code.
Analysing a drifter dataset#
import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import xarray as xr
import trajan as ta
Importing a dataset with two drifters in the Barents Sea
ds = xr.open_dataset(ta.DATA_DIR + 'barents.nc')
This follows the CF convention for trajectories https://cfconventions.org/Data/cf-conventions/cf-conventions-1.10/cf-conventions.html#_multidimensional_array_representation_of_trajectories
print(ds)
<xarray.Dataset> Size: 110kB
Dimensions: (trajectory: 2, obs: 2287)
Dimensions without coordinates: trajectory, obs
Data variables:
lon (trajectory, obs) float64 37kB ...
lat (trajectory, obs) float64 37kB ...
time (trajectory, obs) datetime64[ns] 37kB ...
drifter_names (trajectory) <U16 128B ...
Attributes: (12/13)
Conventions: CF-1.10
featureType: trajectory
geospatial_lat_min: 74.5454462
geospatial_lat_max: 77.4774768
geospatial_lon_min: 17.2058074
geospatial_lon_max: 29.8523485
... ...
time_coverage_end: 2022-11-23T13:30:28
creator_email: gauteh@met.no, knutfd@met.no
creator_name: Gaute Hope and Knut Frode Dagestad
creator_url: https://github.com/OpenDrift/opendrift
summary: Two drifters in the Barents Sea. One stranded at Ho...
title: Barents Sea drifters
A basic plot can be made very simply with Trajan

2026-07-28 18:03:58 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:03:58 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting time-variable for "obs"..
2026-07-28 18:03:58 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: obs, detected time-variable: time.
2026-07-28 18:03:58 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Ragged trajectory dataset
2026-07-28 18:03:58 runnervmvrwv9 trajan.traj[4232] DEBUG Setting up new plot object.
2026-07-28 18:03:58 runnervmvrwv9 trajan.plot[4232] DEBUG Plotting lines
2026-07-28 18:03:58 runnervmvrwv9 trajan.plot[4232] DEBUG Creating new figure and axes..
Cropping to a smaller geographical area

2026-07-28 18:03:58 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:03:58 runnervmvrwv9 trajan.accessor[4232] DEBUG trajectory_id is drifter_names, but dimensions have other names: {str(list(trajectory_var.sizes))}
2026-07-28 18:03:58 runnervmvrwv9 trajan.accessor[4232] DEBUG No trajectory_id attribute/variable found, trying to identify by name.
2026-07-28 18:03:58 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting time-variable for "obs"..
2026-07-28 18:03:58 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: obs, detected time-variable: time.
2026-07-28 18:03:58 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Ragged trajectory dataset
2026-07-28 18:03:58 runnervmvrwv9 trajan.traj[4232] DEBUG Setting up new plot object.
2026-07-28 18:03:58 runnervmvrwv9 trajan.plot[4232] DEBUG Plotting lines
2026-07-28 18:03:58 runnervmvrwv9 trajan.plot[4232] DEBUG Creating new figure and axes..
The figure can be customized, combining functionality from Trajan, Xarray and Matplotlib
ds.isel(trajectory=1).traj.plot(color='b', label=ds.trajectory[1].values,
land='mask', margin=3)
ds.isel(trajectory=0).traj.plot(color='r', label=ds.trajectory[0].values)
plt.legend()
plt.title('Two drifters in the Barents Sea')
plt.show()

2026-07-28 18:03:59 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:03:59 runnervmvrwv9 trajan.accessor[4232] DEBUG Single trajectory, a trajectory dimension will be added
2026-07-28 18:03:59 runnervmvrwv9 trajan.accessor[4232] DEBUG Using trajectory_id variable name (drifter_names) as trajectory dimension name
2026-07-28 18:03:59 runnervmvrwv9 root[4232] DEBUG <xarray.Dataset> Size: 55kB
Dimensions: (drifter_names: 1, obs: 2287)
Coordinates:
drifter_names (drifter_names) <U16 64B 'UIB-2022-TILL-02'
Dimensions without coordinates: obs
Data variables:
lon (drifter_names, obs) float64 18kB 27.82 27.8 ... 21.14 21.15
lat (drifter_names, obs) float64 18kB 77.11 77.11 ... 74.58 74.58
time (drifter_names, obs) datetime64[ns] 18kB 2022-10-07T00:00:...
Attributes: (12/13)
Conventions: CF-1.10
featureType: trajectory
geospatial_lat_min: 74.5454462
geospatial_lat_max: 77.4774768
geospatial_lon_min: 17.2058074
geospatial_lon_max: 29.8523485
... ...
time_coverage_end: 2022-11-23T13:30:28
creator_email: gauteh@met.no, knutfd@met.no
creator_name: Gaute Hope and Knut Frode Dagestad
creator_url: https://github.com/OpenDrift/opendrift
summary: Two drifters in the Barents Sea. One stranded at Ho...
title: Barents Sea drifters has tx.dims = ('obs',) which is of dimension 1 but is not index; this is a bit unusual; try to parse with Orthogonal or Ragged
2026-07-28 18:03:59 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting time-variable for "obs"..
2026-07-28 18:03:59 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: obs, detected time-variable: time.
2026-07-28 18:03:59 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Ragged trajectory dataset
2026-07-28 18:03:59 runnervmvrwv9 trajan.traj[4232] DEBUG Setting up new plot object.
2026-07-28 18:03:59 runnervmvrwv9 trajan.plot[4232] DEBUG Plotting lines
2026-07-28 18:03:59 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:03:59 runnervmvrwv9 trajan.accessor[4232] DEBUG Found CF trajectory dimension "drifter_names"
2026-07-28 18:03:59 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting time-variable for "obs"..
2026-07-28 18:03:59 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: obs, detected time-variable: time.
2026-07-28 18:03:59 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Ragged trajectory dataset
2026-07-28 18:03:59 runnervmvrwv9 trajan.plot[4232] DEBUG Creating new figure and axes..
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Single trajectory, a trajectory dimension will be added
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Using trajectory_id variable name (drifter_names) as trajectory dimension name
2026-07-28 18:04:00 runnervmvrwv9 root[4232] DEBUG <xarray.Dataset> Size: 55kB
Dimensions: (drifter_names: 1, obs: 2287)
Coordinates:
drifter_names (drifter_names) <U16 64B 'UIB-2022-TILL-01'
Dimensions without coordinates: obs
Data variables:
lon (drifter_names, obs) float64 18kB 29.85 29.83 ... nan nan
lat (drifter_names, obs) float64 18kB 77.3 77.31 ... nan nan
time (drifter_names, obs) datetime64[ns] 18kB 2022-10-07T00:00:...
Attributes: (12/13)
Conventions: CF-1.10
featureType: trajectory
geospatial_lat_min: 74.5454462
geospatial_lat_max: 77.4774768
geospatial_lon_min: 17.2058074
geospatial_lon_max: 29.8523485
... ...
time_coverage_end: 2022-11-23T13:30:28
creator_email: gauteh@met.no, knutfd@met.no
creator_name: Gaute Hope and Knut Frode Dagestad
creator_url: https://github.com/OpenDrift/opendrift
summary: Two drifters in the Barents Sea. One stranded at Ho...
title: Barents Sea drifters has tx.dims = ('obs',) which is of dimension 1 but is not index; this is a bit unusual; try to parse with Orthogonal or Ragged
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting time-variable for "obs"..
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: obs, detected time-variable: time.
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Ragged trajectory dataset
2026-07-28 18:04:00 runnervmvrwv9 trajan.traj[4232] DEBUG Setting up new plot object.
2026-07-28 18:04:00 runnervmvrwv9 trajan.plot[4232] DEBUG Plotting lines
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Found CF trajectory dimension "drifter_names"
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting time-variable for "obs"..
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: obs, detected time-variable: time.
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Ragged trajectory dataset
2026-07-28 18:04:00 runnervmvrwv9 trajan.plot[4232] DEBUG Axes already exist on existing figure
Trajan includes methods to e.g. calculate the speed of the drifters
Max speed 1008.360274201437 m/s
We see that the max speed > 1000 m/s, which is a numerical error due to some cases with GPS positions reported with very small time interval. By removing all positions where time interval < 5 min, we avoid this problem.
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting time-variable for "obs"..
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: obs, detected time-variable: time.
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Ragged trajectory dataset
Max speed 1.2873047098224348 m/s
Likewise, one can insert breaks (NaN) in the trajectories whenever the time between points exceed a desired threshold, e.g. 3 hours
ds = ds.traj.insert_nan_where(ds.traj.time_to_next()>np.timedelta64(3, 'h'))
Plotting trajectories colored by drifter speed

2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting time-variable for "obs"..
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: obs, detected time-variable: time.
2026-07-28 18:04:00 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Ragged trajectory dataset
2026-07-28 18:04:00 runnervmvrwv9 trajan.traj[4232] DEBUG Setting up new plot object.
2026-07-28 18:04:00 runnervmvrwv9 trajan.plot[4232] DEBUG Plotting lines
2026-07-28 18:04:00 runnervmvrwv9 trajan.plot[4232] DEBUG Creating new figure and axes..
2026-07-28 18:04:00 runnervmvrwv9 trajan.plot[4232] DEBUG Plotting trajectory 0 of 2 with color
2026-07-28 18:04:01 runnervmvrwv9 trajan.plot[4232] DEBUG Plotting trajectory 1 of 2 with color
2026-07-28 18:04:02 runnervmvrwv9 matplotlib.colorbar[4232] DEBUG locator: <matplotlib.ticker.AutoLocator object at 0x7fef31097e30>
Histogram of drifter speeds.
speed = ds.traj.speed()
plt.hist(speed.values[~np.isnan(speed.values)], 100)
plt.xlabel('Drifter speed [m/s]')
plt.ylabel('Number')
plt.show()

The peak at speed=0m/s is from the period where one of the drifters are on land (Hopen island). This can be removed simply:
speed = speed.where(speed>0.01)
plt.hist(speed.values[~np.isnan(speed.values)], 100)
plt.xlabel('Drifter speed [m/s]')
plt.ylabel('Number')
plt.show()

The positions of GPS based drifters are normally given at slightly irregular time intervals, as drifters may be without GPS coverage for periods, and may get GPX fixes irregularly. TrajAn contains the method gridtime to interpolate positions to a regular time intervel, e.g. hourly:
dh = ds.traj.gridtime('1h')
ds.traj.plot(color='r', label='raw data', land='mask')
dh.traj.plot(color='b', label='hourly')
plt.gca().set_extent([23.8, 25.0, 76.8, 77], crs=ccrs.PlateCarree()) # Zooming in to highliht differences
plt.legend()
plt.show()

2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting time-variable for "obs"..
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: obs, detected time-variable: time.
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Ragged trajectory dataset
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: time, detected time-variable: time.
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Orthogonal trajectory dataset
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting time-variable for "obs"..
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: obs, detected time-variable: time.
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Ragged trajectory dataset
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: time, detected time-variable: time.
2026-07-28 18:04:02 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Orthogonal trajectory dataset
2026-07-28 18:04:02 runnervmvrwv9 trajan.plot[4232] DEBUG Plotting lines
2026-07-28 18:04:02 runnervmvrwv9 trajan.plot[4232] DEBUG Creating new figure and axes..
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: time, detected time-variable: time.
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Orthogonal trajectory dataset
2026-07-28 18:04:03 runnervmvrwv9 trajan.traj[4232] DEBUG Setting up new plot object.
2026-07-28 18:04:03 runnervmvrwv9 trajan.plot[4232] DEBUG Plotting lines
2026-07-28 18:04:03 runnervmvrwv9 trajan.plot[4232] DEBUG Axes already exist on existing figure
Having the dataset on a regular time interval makes it simpler to compare with e.g. drift models, and also makes some analyses simpler
dh.isel(trajectory=0).traj.plot(color='r', label='Full trajectory')
dh.isel(trajectory=0).sel(time=slice('2022-10-10', '2022-10-12')).traj.plot(
color='k', linewidth=2, label='10-12 Oct 2022')
plt.legend()
plt.show()

2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Single trajectory, a trajectory dimension will be added
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Using trajectory_id variable name (drifter_names) as trajectory dimension name
2026-07-28 18:04:03 runnervmvrwv9 root[4232] DEBUG <xarray.Dataset> Size: 28kB
Dimensions: (drifter_names: 1, time: 1143)
Coordinates:
drifter_names (drifter_names) <U16 64B 'UIB-2022-TILL-01'
* time (time) datetime64[ns] 9kB 2022-10-07 ... 2022-11-23T14:00:00
trajectory int64 8B 0
Data variables:
lon (drifter_names, time) float64 9kB 29.85 29.82 ... nan nan
lat (drifter_names, time) float64 9kB 77.3 77.31 ... nan nan
Attributes: (12/13)
Conventions: CF-1.10
featureType: trajectory
geospatial_lat_min: 74.5454462
geospatial_lat_max: 77.4774768
geospatial_lon_min: 17.2058074
geospatial_lon_max: 29.8523485
... ...
time_coverage_end: 2022-11-23T13:30:28
creator_email: gauteh@met.no, knutfd@met.no
creator_name: Gaute Hope and Knut Frode Dagestad
creator_url: https://github.com/OpenDrift/opendrift
summary: Two drifters in the Barents Sea. One stranded at Ho...
title: Barents Sea drifters has tx.dims = ('time',) which is of dimension 1 but is not index; this is a bit unusual; try to parse with Orthogonal or Ragged
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: time, detected time-variable: time.
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Orthogonal trajectory dataset
2026-07-28 18:04:03 runnervmvrwv9 trajan.traj[4232] DEBUG Setting up new plot object.
2026-07-28 18:04:03 runnervmvrwv9 trajan.plot[4232] DEBUG Plotting lines
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Found CF trajectory dimension "drifter_names"
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: time, detected time-variable: time.
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Orthogonal trajectory dataset
2026-07-28 18:04:03 runnervmvrwv9 trajan.plot[4232] DEBUG Creating new figure and axes..
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Single trajectory, a trajectory dimension will be added
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Using trajectory_id variable name (drifter_names) as trajectory dimension name
2026-07-28 18:04:03 runnervmvrwv9 root[4232] DEBUG <xarray.Dataset> Size: 2kB
Dimensions: (drifter_names: 1, time: 72)
Coordinates:
drifter_names (drifter_names) <U16 64B 'UIB-2022-TILL-01'
* time (time) datetime64[ns] 576B 2022-10-10 ... 2022-10-12T23:00:00
trajectory int64 8B 0
Data variables:
lon (drifter_names, time) float64 576B 27.04 27.04 ... 25.88
lat (drifter_names, time) float64 576B 77.47 77.46 ... 77.23
Attributes: (12/13)
Conventions: CF-1.10
featureType: trajectory
geospatial_lat_min: 74.5454462
geospatial_lat_max: 77.4774768
geospatial_lon_min: 17.2058074
geospatial_lon_max: 29.8523485
... ...
time_coverage_end: 2022-11-23T13:30:28
creator_email: gauteh@met.no, knutfd@met.no
creator_name: Gaute Hope and Knut Frode Dagestad
creator_url: https://github.com/OpenDrift/opendrift
summary: Two drifters in the Barents Sea. One stranded at Ho...
title: Barents Sea drifters has tx.dims = ('time',) which is of dimension 1 but is not index; this is a bit unusual; try to parse with Orthogonal or Ragged
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: time, detected time-variable: time.
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Orthogonal trajectory dataset
2026-07-28 18:04:03 runnervmvrwv9 trajan.traj[4232] DEBUG Setting up new plot object.
2026-07-28 18:04:03 runnervmvrwv9 trajan.plot[4232] DEBUG Plotting lines
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Found CF trajectory dimension "drifter_names"
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: time, detected time-variable: time.
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Orthogonal trajectory dataset
2026-07-28 18:04:03 runnervmvrwv9 trajan.plot[4232] DEBUG Axes already exist on existing figure
The original dataset had two dimensions (trajectory, obs) (see top of page), and time is a 2D variable. For the gridded dataset (as with datasets imported from some trajectory models), dimensions are (trajectory, time) and time is a 1D Xarray dimension coordinate
print(dh)
<xarray.Dataset> Size: 46kB
Dimensions: (trajectory: 2, time: 1143)
Coordinates:
* time (time) datetime64[ns] 9kB 2022-10-07 ... 2022-11-23T14:00:00
* trajectory (trajectory) int64 16B 0 1
Data variables:
lon (trajectory, time) float64 18kB 29.85 29.82 ... 21.14 21.15
lat (trajectory, time) float64 18kB 77.3 77.31 ... 74.58 74.58
drifter_names (trajectory) <U16 128B 'UIB-2022-TILL-01' 'UIB-2022-TILL-02'
Attributes: (12/13)
Conventions: CF-1.10
featureType: trajectory
geospatial_lat_min: 74.5454462
geospatial_lat_max: 77.4774768
geospatial_lon_min: 17.2058074
geospatial_lon_max: 29.8523485
... ...
time_coverage_end: 2022-11-23T13:30:28
creator_email: gauteh@met.no, knutfd@met.no
creator_name: Gaute Hope and Knut Frode Dagestad
creator_url: https://github.com/OpenDrift/opendrift
summary: Two drifters in the Barents Sea. One stranded at Ho...
title: Barents Sea drifters
Plotting the velocity spectrum for one drifter

2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Single trajectory, a trajectory dimension will be added
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Using trajectory_id variable name (drifter_names) as trajectory dimension name
2026-07-28 18:04:03 runnervmvrwv9 root[4232] DEBUG <xarray.Dataset> Size: 28kB
Dimensions: (drifter_names: 1, time: 1143)
Coordinates:
drifter_names (drifter_names) <U16 64B 'UIB-2022-TILL-02'
* time (time) datetime64[ns] 9kB 2022-10-07 ... 2022-11-23T14:00:00
trajectory int64 8B 1
Data variables:
lon (drifter_names, time) float64 9kB 27.82 27.78 ... 21.14 21.15
lat (drifter_names, time) float64 9kB 77.11 77.11 ... 74.58 74.58
Attributes: (12/13)
Conventions: CF-1.10
featureType: trajectory
geospatial_lat_min: 74.5454462
geospatial_lat_max: 77.4774768
geospatial_lon_min: 17.2058074
geospatial_lon_max: 29.8523485
... ...
time_coverage_end: 2022-11-23T13:30:28
creator_email: gauteh@met.no, knutfd@met.no
creator_name: Gaute Hope and Knut Frode Dagestad
creator_url: https://github.com/OpenDrift/opendrift
summary: Two drifters in the Barents Sea. One stranded at Ho...
title: Barents Sea drifters has tx.dims = ('time',) which is of dimension 1 but is not index; this is a bit unusual; try to parse with Orthogonal or Ragged
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: time, detected time-variable: time.
2026-07-28 18:04:03 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Orthogonal trajectory dataset
Do a basic animation of the drift of the drifters
ds.traj.animate().show()

2026-07-28 18:04:04 runnervmvrwv9 trajan.plot[4232] DEBUG Creating new figure and axes..
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting time-variable for "obs"..
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: obs, detected time-variable: time.
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Ragged trajectory dataset
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: time, detected time-variable: time.
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Orthogonal trajectory dataset
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting time-variable for "obs"..
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: obs, detected time-variable: time.
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Ragged trajectory dataset
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: time, detected time-variable: time.
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Orthogonal trajectory dataset
2026-07-28 18:04:04 runnervmvrwv9 trajan.animation[4232] DEBUG Gridded dataset to 0 days 00:30:00
2026-07-28 18:04:04 runnervmvrwv9 trajan.animation[4232] DEBUG Building animation: 2285 frames
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detecting trajectory dimension
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected obs-dim: time, detected time-variable: time.
2026-07-28 18:04:04 runnervmvrwv9 trajan.accessor[4232] DEBUG Detected Orthogonal trajectory dataset