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

fuzzy sum logic #380

Closed
RichardScottOZ opened this issue Apr 28, 2024 · 1 comment · Fixed by #381
Closed

fuzzy sum logic #380

RichardScottOZ opened this issue Apr 28, 2024 · 1 comment · Fixed by #381

Comments

@RichardScottOZ
Copy link
Contributor

If you are looking to end up with a number between 0 and 1:

 return data.sum(axis=0) - np.prod(data, axis=0)

This is clearly wrong.

Consider 3 rasters where the pixel value is 0.4 at a given index = 0.4 + 0.4 + 0.4 - 040.40.4 > 1

what you actually want if you are trying to match something a la giant company version

product_term =np.prod(1 - data, axis=0)
fuzzysum = 1 - product_term
@nmaarnio
Copy link
Collaborator

Yeah you are right. Thanks for noticing and pointing this out. I'll go ahead and fix this like you suggested

@nmaarnio nmaarnio linked a pull request Apr 28, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants