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

Type casting problems with SRTM DEM #5

Closed
mbjoseph opened this issue Dec 14, 2016 · 4 comments
Closed

Type casting problems with SRTM DEM #5

mbjoseph opened this issue Dec 14, 2016 · 4 comments
Assignees
Labels

Comments

@mbjoseph
Copy link

I was hoping to compute slope and aspect for some digital elevation models from the NASA SRTM mission, and ran into a type error that seems to be related to the _find_flats_edges function.

Here's a reproducible example Jupyter notebook that demonstrates the problem: https://gist.github.com/mbjoseph/9934454330b5715db9529502cf415f72#file-pydem-srtm-example-ipynb

A TypeError is raised:

TypeError: Cannot cast ufunc add output from dtype('float64') to dtype('bool') with casting rule 'same_kind'

It seems like similar issues have arisen elsewhere, e.g., numpy/numpy#7225

@mpu-creare
Copy link
Contributor

mpu-creare commented Dec 15, 2016

@mbjoseph I'll have a look later today. I'd rather not intentionally cast unsafely, I'll see if there's another fix.

Thanks for finding this! I haven't kept up with changes in numpy -- evidently. Are you up and running at least? Are you on a windows machine?

@mpu-creare
Copy link
Contributor

@mbjoseph could you try the proposed fix in 311d217 ? It's on the develop branch.

@mpu-creare mpu-creare self-assigned this Dec 15, 2016
@mpu-creare mpu-creare added the bug label Dec 15, 2016
@mbjoseph
Copy link
Author

mbjoseph commented Dec 15, 2016

Your fix with 311d217 worked beautifully, thanks! Also I was able to replicate this on OSX and Ubuntu - I haven't tried on a Windows machine.

@mpu-creare
Copy link
Contributor

Excellent, I'll push it into master for the next release.

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

No branches or pull requests

2 participants