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

Speed up calculation of drainage map #635

Open
vgro opened this issue Dec 10, 2024 · 0 comments
Open

Speed up calculation of drainage map #635

vgro opened this issue Dec 10, 2024 · 0 comments
Assignees

Comments

@vgro
Copy link
Collaborator

vgro commented Dec 10, 2024

The drainage map defines the direction of water flow across the grid based on a digital elevation model. The current implementation in 'calculate_drainage_map' is very slow and will likely not run properly with a realistic grid size, see

def calculate_drainage_map(grid: Grid, elevation: np.ndarray) -> dict[int, list[int]]:

The two functions find_lowest_neighbour() and find_upstream_cells(lowest_neighbours) are super inefficient. I do not have a specific solution in mind, it might need a completely different approach. It is also worth considering if this should move somewhere more central as something similar might be required for the animals.

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

When branches are created from issues, their pull requests are automatically linked.

2 participants