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

Error "Input vector should be 1-D" when generating mesh #102

Open
zhaoshaohua21 opened this issue Jul 15, 2024 · 5 comments
Open

Error "Input vector should be 1-D" when generating mesh #102

zhaoshaohua21 opened this issue Jul 15, 2024 · 5 comments

Comments

@zhaoshaohua21
Copy link

Hello, I'm trying to use RivGraph for River Examples. The issue I'm facing arises when I try to use the computer_mesh() function.
**>>> brahma.compute_mesh()
Generating mesh...
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\rivgraph\classes.py", line 856, in compute_mesh
self.meshlines, self.meshpolys, self.centerline_smooth = ru.valleyline_mesh(self.centerline, self.avg_chan_width, buf_halfwidth, grid_spacing, smoothing=smoothing)
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\rivgraph\rivers\river_utils.py", line 769, in valleyline_mesh
llines, lmap = iterative_cl_pt_mapping(cl2, bdists, 'left')
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\rivgraph\rivers\river_utils.py", line 608, in iterative_cl_pt_mapping
distance, path = fastdtw(Ao, An, dist=euclidean)
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\fastdtw\fastdtw.py", line 53, in fastdtw
return __fastdtw(x, y, radius, dist)
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\fastdtw\fastdtw.py", line 73, in __fastdtw
__fastdtw(x_shrinked, y_shrinked, radius=radius, dist=dist)
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\fastdtw\fastdtw.py", line 73, in __fastdtw
__fastdtw(x_shrinked, y_shrinked, radius=radius, dist=dist)
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\fastdtw\fastdtw.py", line 73, in __fastdtw
__fastdtw(x_shrinked, y_shrinked, radius=radius, dist=dist)
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\fastdtw\fastdtw.py", line 68, in __fastdtw
return dtw(x, y, dist=dist)
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\fastdtw\fastdtw.py", line 130, in dtw
return __dtw(x, y, None, dist)
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\fastdtw\fastdtw.py", line 141, in __dtw
dt = dist(x[i-1], y[j-1])
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\scipy\spatial\distance.py", line 520, in euclidean
return minkowski(u, v, p=2, w=w)
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\scipy\spatial\distance.py", line 463, in minkowski
u = _validate_vector(u)
File "C:\Users\zsh.conda\envs\rivgraph_env\lib\site-packages\scipy\spatial\distance.py", line 302, in _validate_vector
raise ValueError("Input vector should be 1-D.")
ValueError: Input vector should be 1-D.

@jonschwenk
Copy link
Collaborator

Hi @zhaoshaohua21, this error almost certainly indicates that something is wrong in your upstream processing, OR that the default parameters to compute_mesh() are insufficient for your case. There is no way for us to know without having a minimal, reproducible example to process ourselves. Can you share the mask that you're processing so we can take a look?

@zhaoshaohua21
Copy link
Author

zhaoshaohua21 commented Aug 8, 2024 via email

@zhaoshaohua21
Copy link
Author

zhaoshaohua21 commented Aug 8, 2024 via email

@jonschwenk
Copy link
Collaborator

jonschwenk commented Aug 8, 2024 via email

@zhaoshaohua21
Copy link
Author

zhaoshaohua21 commented Aug 9, 2024 via email

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

2 participants