sertit / eoreader

Remote-sensing opensource python library reading optical and SAR sensors, loading and stacking bands, clouds, DEM and spectral indices in a sensor-agnostic way.
https://eoreader.readthedocs.io/en/latest/
Apache License 2.0
278 stars 22 forks source link

Name collision between Spectral and Cloud bands #131

Closed BastienKovac closed 6 months ago

BastienKovac commented 6 months ago

Describe the bug

The CloudsBandNames.CIRRUS and SpectralBandNames.SWIR_CIRRUS have the same string name ("CIRRUS"), meaning getting the Cloud band by name by using the _toband() method is currently impossible (as the spectral one is tried first)

Code To Reproduce

from eoreader.bands import to_band
print(to_band("CIRRUS"))

Output

[<SpectralBandNames.SWIR_CIRRUS: 'CIRRUS'>]

Environment:

remi-braun commented 6 months ago

Good one this one 😅

remi-braun commented 6 months ago

This should be corrected 😅 Do you need a release for that or using the latest version from Github is enough for now?

BastienKovac commented 6 months ago

Thanks for the quick fix !

I've implemented a quick work-around for my use-case so it can definitely wait for a future release

remi-braun commented 6 months ago

Thanks :)