Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of bounds error when using 'pf.get_transect' #178

Open
mzapponi opened this issue Jul 21, 2022 · 1 comment
Open

Out of bounds error when using 'pf.get_transect' #178

mzapponi opened this issue Jul 21, 2022 · 1 comment

Comments

@mzapponi
Copy link
Contributor

mzapponi commented Jul 21, 2022

  • pyfesom2 version: newest
  • Python version: 3.9.12
  • Operating System: Linux

Description

When calling the function pf.get_transect with the new version of pyfesom an error Index out of bounds is returned.

What I Did

dist, transect_data = pf.get_transect(temp, mesh, lonlat)

Traceback:

File "/work/ba1264/a270210/miniconda3/lib/python3.9/site-packages/pyfesom2/[transect.py](https://transect.py/)", line 92, in get_transect
    transect_data = transect_get_data(data, nodes, mask2d)
  File "/work/ba1264/a270210/miniconda3/lib/python3.9/site-packages/pyfesom2/[transect.py](https://transect.py/)", line 58, in transect_get_data
    transect_data = data3d[nodes,:]
IndexError: index 412253 is out of bounds for axis 0 with size 79
@mzapponi
Copy link
Contributor Author

As suggested by @koldunovn the error is due to the switched dimensions in the new version of fesom. A workaround has been suggested as passing the transposed data:

dist, transect_data = pf.get_transect(temp.T, mesh, lonlat)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant