Hi Everyone,
I am trying to use Postel scripts (python3) for creating a longitudinal salinity figure, specifically the TelemacFile/get_data_on_vertical_plane function which is exemplified inside of the notebooks.
The script runs nicely when I use only one line segment, as you can see on the next figure:
However, if I define a polyline with more than two points, it returns some error related to linspace function:
IndexError Traceback (most recent call last)
<ipython-input-29-0499fe6c294b> in <module>
1 # slice at initial time step (0) of the elevation variable
2 xx, abs_curv, values_poly_Z=\
----> 3 slf3d.get_data_on_vertical_plane('ELEVATION Z', 721, ppol, poly_number)
C:\\opentelemac-mascaret\\v8p1\\scripts\\python3\data_manip\extraction\telemac_file.py in get_data_on_vertical_plane(self, varname, record, polyline_points, discretized_number)
737 nplan = self.nplan
738 polygone_discretized_points = linspace_poly(\
--> 739 polyline_points, discretized_number)
740 npoly = len(polygone_discretized_points)
741 values_polylines = np.zeros((npoly, nplan), dtype=np.float64)
C:\\opentelemac-mascaret\\v8p1\\scripts\\python3\data_manip\extraction\linspace.py in linspace_poly(poly_points, poly_number)
36 list_seg = []
37 for i in range(len(poly_points)):
---> 38 lin = linspace_seg(poly_points, poly_points[i+1], poly_number,\
39 end=False)
40 list_seg.append(lin)
IndexError: list index out of range
Has someone already used it as polyline?
Thanks in advance,