Hi,
For getting Telemac results into Python for further processing or plotting I still use the following really very old but efficient solution. No need to use other Python libraries than the ones provided by Telemac and no need to compile Telemac with Hermes.
For the interpolation to raster etc. or plotting you will find a lot of examples in the internet.
______________________________________________________
import sys
from os import path
sys.path.append(path.join( path.dirname(sys.argv[0]), r'C:\Opentelemac\v8p3r1\scripts\python3'))
from data_manip.formats.selafin import Selafin
import numpy as np
slf = Selafin('res.slf')
def Get_Values(var_name, frames):
var_names=[item.rstrip() for item in slf.varnames]
z_var = []
for i in frames:
z_var.append(slf.get_variables_at(i, [var_names.index(var_name)]))
z_var = np.squeeze(z_var, axis=None) # remove one-dimensional entries
return z_var
times = slf.tags["times"]
print (times)
print (len(slf.meshx))
print (len(slf.ikle3))
frames = range(0,len(times))
# e.g. get the water depths for all frames
depths = Get_Values('WATER DEPTH', frames)
print (depths.shape)
Maybe it helps,
Clemens
________________________________________________