opendrift
opendrift copied to clipboard
animation gif example_leeway
Hello,
Im new on opendrift and python , and I'd like to know how to save and generate a gif animation.
Im using WScode and conda.
Im performing the example_leeway.py

You can add filename='filename.gif' to save animation to file.
But .mp4 generates much smaller files, that also can be paused.
Ok thanks, I did it but I dont see any files , Is there another comands lilke save or anything else?

You add that inside the call to animation
lw.animation(background=['x_sea_water_velocity', 'y_sea_water_velocity'], skip=5,filename='filename.mp4', # show every 5th vector cmap=cmocean.cm.speed, vmin=0, vmax=.8, bgalpha=.7, land_color='#666666', fast=True)
Thanks so much, It works!!!
I suppose for generating images like png files is similar

Same, inside the call
lw.plot(fast=True,filename1='filename1.png')
Thanks so much, It works!!