Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/MNHPy/misc_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ def oblique_proj(var, ni, nj, lvl, i_beg, j_beg, i_end, j_end):
a = RectBivariateSpline(nj, ni, var[k, :, :], kx=1, ky=1)
for m in range(int(dist_seg) + 1):
# La fonction ev de RectBivariate retourne la valeur la plus proche du point considéré
out_var[k, m] = a.ev(axe_m_coord[m][1], axe_m_coord[m][0])
result = a.ev(axe_m_coord[m][1], axe_m_coord[m][0])
out_var[k, m] = result.item()
else: # 2D variables to project
a = RectBivariateSpline(nj, ni, var[:, :], kx=1, ky=1)
for m in range(int(dist_seg) + 1):
out_var[m] = a.ev(axe_m_coord[m][1], axe_m_coord[m][0])
result = a.ev(axe_m_coord[m][1], axe_m_coord[m][0])
out_var[m] = result.item()

angle_proj = math.acos((ni[i_end] - ni[i_beg]) / axe_m[-1])
return angle_proj, out_var, axe_m
Expand Down