Hi Jose,
Thanks for your response. My aim is to convert my result file (Telemac2D) to NetCDF format to use it on the GNOME oil spill trajectory (NOAA) model. GNOME has the model input file format descriptions in NetCDF format for our Telemac results. So tried the code from the forum to convert to .nc format and it works fine I thought of modifying it for the GNOME instructed format.
I encountered the following error while trying the script.
Script called : slf2nc.py
Opening .slf file
Opening .r2s file
Writing velocity_u | | ---s 0.00 B/s
Traceback (most recent call last):
File "slf2nc.py", line 258, in <module>
NetCdf.writenc(cdffile,times,xm,ym,ikle,X,Y,names,vnames,units)
File "slf2nc.py", line 214, in writenc
zi = Telemac.trinterp(xm,ym,trgl,X,Y,z)
File "slf2nc.py", line 119, in trinterp
zi = I(xi, yi)
File "C:\Users\Sathish_Kumar\AppData\Roaming\Python\Python38\site-packages\matplotlib\tri\triinterpolate.py", line 421, in __call__
return self._interpolate_multikeys(x, y, tri_index=None,
File "C:\Users\Sathish_Kumar\AppData\Roaming\Python\Python38\site-packages\matplotlib\tri\triinterpolate.py", line 171, in _interpolate_multikeys
tri_index = self._trifinder(x, y)
File "C:\Users\Sathish_Kumar\AppData\Roaming\Python\Python38\site-packages\matplotlib\tri\trifinder.py", line 61, in __call__
indices = (self._cpp_trifinder.find_many(x.ravel(), y.ravel())
ValueError: x and y must be array-like with same shape
regards
Sathish