Closed bosmanoglu closed 4 years ago
The accumulation function takes the flow direction file as input. Therefore:
grid.accumulation(data='inflated_dem', dirmap=dirmap, out_name='acc')
Should be:
grid.accumulation(data='dir', dirmap=dirmap, out_name='acc')
Yes, it looks like I made a copy paste error. With your suggested correction we were able to get results.
This ticket can be closed.
First, I would like to thank you very much for developing this tool. It's well written and documented allowing me to integrate in one of our projects.
I am working on calculating HAND for a given area with detected flood extent. It's a fairly large area so I am separating each contiguous flood extent as one object and processing a rectangular area encompassing each object individually. Following your examples, I am using the following code to process each of these:
Here is a look at the DEM:
What I notice is that the accumulation result is all 1, as seen below:
The flow_dir looks reasonable though:
Because accumulation was all 1's I set the
grid.acc >0
in compute_hand calculation, despite noticing that in the test_grid.py you have it set asgrid.acc > 100
. As a result HAND is all 0's except a single row/column of nan's surrounding it.It's likely that I did something wrong, and there is nothing wrong with pysheds. Could you please take a look and let me know which is true? If my method/input is correct but there is a glitch in pysheds, if you can give me pointers to look into, I'm happy to check and let you know what I find.