Use Telemac (selafin) output

# tuto
from datetime import timedelta
import numpy as np
from os import sep
from pyproj import Proj
from opendrift.readers import reader_telemac_selafin
from opendrift.readers import reader_global_landmask
from opendrift.models.oceandrift import OceanDrift

o = OceanDrift(loglevel=0)
#Lambert North
proj="+proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 \
     +k_0=0.999877341 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 \
      +units=m +no_defs"
selafin = reader_telemac_selafin.Reader(filename=filename,proj4 = proj)
o.set_config('general:coastline_action', 'previous')
start_time = selafin.start_time
time_step = timedelta(seconds=selafin.slf.tags["times"][1])
num_steps = len(selafin.slf.tags["times"])

# center seeds in the middle
lon, lat =

o.seed_elements(lon=lon, lat=lat, radius=20000, number= 200, z= 0, \
   time= start_time), duration=length)

Total running time of the script: ( 0 minutes 0.000 seconds)

Gallery generated by Sphinx-Gallery