Closed svenseeberg closed 7 months ago
duplicate of #6 ?
I considered #6 to be about plotting the currents in the result image. If it is about animations, then yes, it is a duplicate.
When calling SIMULATION.animation()
with wind or current data, we always get the following error message. I seems we use different time zones or something like that for our input data? https://github.com/Unidata/cftime/issues/128
Traceback (most recent call last):
File "/code/leeway/simulation.py", line 112, in <module>
SIMULATION.animation(background=['x_wind', 'y_wind'], ocean_color='skyblue', land_color='burlywood', filename=f"{OUTFILE}-foo.mp4")
File "/code/opendrift/models/basemodel.py", line 3570, in animation
self.get_map_background(ax, background, crs,
File "/code/opendrift/models/basemodel.py", line 4540, in get_map_background
data = reader.get_variables(background, time, reader_x, reader_y, None)
File "/code/opendrift/readers/reader_lazy.py", line 48, in get_variables
return self.reader.get_variables(*args, **kwargs)
File "/code/opendrift/readers/reader_netCDF_CF_generic.py", line 355, in get_variables
self.nearest_time(time)
File "/code/opendrift/readers/basereader/variables.py", line 409, in nearest_time
if (time - time_before) < (time_after - time):
File "src/cftime/_cftime.pyx", line 1481, in cftime._cftime.datetime.__sub__
TypeError: cannot compute the time difference between dates with different calendars
We decided that an animation is not really help. A reduced map like discussed in #84 is much more helpful.
The simulation form should have an option to order different results: