Skip to content

Commit 8ecfc8e

Browse files
authored
Merge pull request #1792 from knutfrode/dev
[run-ex] Default value of skip For animation with background vectors,…
2 parents 16ed785 + 35f7688 commit 8ecfc8e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

opendrift/models/basemodel/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2660,7 +2660,7 @@ def animation(self,
26602660
vmax=None,
26612661
drifter=None,
26622662
shapefiles=None,
2663-
skip=None,
2663+
skip='auto',
26642664
scale=None,
26652665
color=False,
26662666
clabel=None,
@@ -2895,6 +2895,10 @@ def plot_timestep(i):
28952895
vmax=vmax,
28962896
cmap=cmap,
28972897
transform=self.crs_lonlat)
2898+
if skip == 'auto': # We use a suitable number of vectors
2899+
ny, nx = scalar.shape
2900+
skip = max(1, max(nx, ny) // 30)
2901+
28982902
if type(background) is list:
28992903
bg_quiv = ax.quiver(map_x[::skip, ::skip],
29002904
map_y[::skip, ::skip],

0 commit comments

Comments
 (0)