digitalfabrik / opendrift-leeway-webgui

OpenDrift Leeway simulations for Search and Rescue operations (experimental!)
https://leeway.tuerantuer.org/
Apache License 2.0
12 stars 3 forks source link

Add animation of wind & sea as outputs #63

Closed svenseeberg closed 7 months ago

svenseeberg commented 1 year ago

The simulation form should have an option to order different results:

julled commented 1 year ago

duplicate of #6 ?

svenseeberg commented 1 year ago

I considered #6 to be about plotting the currents in the result image. If it is about animations, then yes, it is a duplicate.

svenseeberg commented 1 year ago

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
svenseeberg commented 7 months ago

We decided that an animation is not really help. A reduced map like discussed in #84 is much more helpful.