GispoCoding / eis_toolkit

Python library for mineral prospectivity mapping
https://eis-he.eu/
European Union Public License 1.2
26 stars 8 forks source link

fuzzy sum logic #380

Closed RichardScottOZ closed 6 months ago

RichardScottOZ commented 6 months ago

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 commented 6 months ago

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