OpenDrift / opendrift

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

plot after run #812

Closed oceandiff closed 2 years ago

oceandiff commented 2 years ago

Hi, there is a way to plot or create an animation after the run without re-run the model? Thank you

gauteh commented 2 years ago

Try o.plot() or o.animation(), take a look at the examples for a quick tutorial.

tir. 21. des. 2021, 11:28 skrev oceandiff @.***>:

Hi, there is a way to plot or create an animation after the run without re-run the model? Thank you

— Reply to this email directly, view it on GitHub https://github.com/OpenDrift/opendrift/issues/812, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN36Y3YRJ74DVXLJ4JUA3USBJDDANCNFSM5KP2AWHA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

AndresSepulveda commented 2 years ago

I do this

import opendrift import numpy as np

o = opendrift.open("archivo.nc", elements=np.arange(0,392000,100)) o.plot(filename="archivo.png",linecolor="z",fast = True) o.animation(filename="archivo.mp4",linecolor="z",fast = True)

to plot a few trajectories, usefull if the plot takes too long.

You can also do

opendrift_animate.py openout.nc -f anim.mp4 opendrift_plot.py openout.nc -f plot.png

oceandiff commented 2 years ago

Thank you!