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 in division operator overload for GeoRaster #170

Open
ra-tolson opened this issue Sep 13, 2019 · 2 comments
Open

Error in division operator overload for GeoRaster #170

ra-tolson opened this issue Sep 13, 2019 · 2 comments

Comments

@ra-tolson
Copy link

In the code I have:

            print("type of T:", type(T))
            print("type of (rad_toa_img[c] - lu):", type(rad_toa_img[c] - lu))
            rad_image[c] = (rad_toa_img[c] - lu) / T

And I get this output:

type of T: <class 'float'>
type of (rad_toa_img[c] - lu): <class 'gippy.gippy.GeoRaster'>
. . .
TypeError: unsupported operand type(s) for /: 'GeoRaster' and 'float'

But (rad_toa_img[c] - lu).__div__.(T) seems to work. My gippy version seems to be current (1.0.3).

@matthewhanson
Copy link
Member

Hello @ags-tolson, thanks for the bug report. I don't have much time to look into this right now, but the first thing I would check is the bit-depth of the float that is defined in gippy. Maybe two different overloads are necessary here for 32 and 64 bit floats.

Also, I would consider updating CImg to the latest version and compiling against that before debugging.

@ra-tolson
Copy link
Author

Okay, thanks for taking a minute to think about it (and the doc issue about GeoImage.open) in any case.

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