Sentinel2.mask_clouds_and_shadows add optional argument fill value #63
Replies: 4 comments
-
Hi Lukas,
what about a datatype check on the user entry?
Fabio Oriani
Researcher - Agroscope, Mountain Grassland Team
Earth Observation for Agroecosystems (EOA) Team
https://www.eoa-team.nethttps://www.eoa-team.net/profile/FabioOriani/
Associate Editor - Computers & Geosciences
https://www.journals.elsevier.com/computers-and-geosciences/
Inviato da Proton Mail mobile
…-------- Messaggio originale --------
Il 5 mag 2023, 20:14, Lukas Valentin Graf ha scritto:
Hi ***@***.***(https://github.com/orianif)
this is a great idea. The only challenge that I see here is the data type issue. E.g., 'nan' requires floating points but many remote sensing data sources use integers. So the question is, would should happen if a user fills in a "wrong" fill value in terms of data type? Casting data might be not efficient/ desired.
Any suggestions?
Cheers,
Lukas
—
Reply to this email directly, [view it on GitHub](#54 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AISYTSCSV472OOIONBJV4TDXEU7QFANCNFSM6AAAAAAXUGS3QQ).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi @orianif thanks for the suggestions. While I think we can discuss about fill values, I have two comments: First: The mask method actually should not alter data values. It uses Second, I think a major issue with using custom fill values is the data type. 'nan' will produce an error when working with integer values, which are widely used for remote sensing data products (e.g., 16bit integers for Sentinel-2). So, the question would be how to handle such "wrong" fill values? Best, |
Beta Was this translation helpful? Give feedback.
-
Hi @orianif, is this issue still applicable? If so, can you please post a minimum reproducible example so that I can see what's going on in your case? |
Beta Was this translation helpful? Give feedback.
-
Since we now fixed several bugs related to the numpy data type and fill value of masked array I'd close this discussion for the time being. |
Beta Was this translation helpful? Give feedback.
-
It would be great if the method Sentinel2.mask_clouds_and_shadows would have an optional argument to specify the filling value, which for now is 0 by default. In case raw pixel values are extracted and treated programmatically one may want to label missing values differently (e.g. as nans).
Best,
Fabio
Beta Was this translation helpful? Give feedback.
All reactions