OpenDrift / opendrift

Open source framework for ocean trajectory modelling
https://opendrift.github.io
GNU General Public License v2.0
232 stars 113 forks source link

Allow usage of hours in age plot #1195

Closed svenseeberg closed 3 months ago

svenseeberg commented 7 months ago

Currently there is a parameter to plot the age of simulation in seconds (simulation.plot(linecolor="age_seconds")). As simulations in most cases probably run for hours or even days, hours or days as a scale would be very helpful for reading/interpreting the plot.

knutfrode commented 4 months ago

Hi, You can achive this with

age_seconds = o.get_property('age_seconds')[0]
o.plot(linecolor=age_seconds/3600, clabel=['Age  [hours]'])

I can also recommend having a look at TrajAn, which is a new package containing generic methods for analysis and plotting of trajectories, independent of whether data are from any trajectory model, or observations/drifters: https://opendrift.github.io/trajan/gallery/index.html This is still young, but should give even more flexibility than using methods included in OpenDrift.