Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Sentinel2.mask_clouds_and_shadows add optional argument fill value #54

Closed
orianif opened this issue May 3, 2023 · 3 comments
Closed

Comments

@orianif
Copy link
Collaborator

orianif commented May 3, 2023

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

@orianif
Copy link
Collaborator Author

orianif commented May 5, 2023 via email

@lukasValentin
Copy link
Collaborator

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 np.ma.MaskedArray to mask out pixels by setting their entry in the mask part of the MaskedArray to False. Operations in EOdal always check for the is_masked_array attribute to handle these arrays correctly. So, it should not happen that data values are set to zero (which is the no-data value of Sentinel-2 defined by ESA by the way). In case it happens, could you please post a code snippet for reproducing the issue?

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,
Lukas

@lukasValentin
Copy link
Collaborator

lukasValentin commented May 30, 2023

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?

@EOA-team EOA-team locked and limited conversation to collaborators May 30, 2023
@lukasValentin lukasValentin converted this issue into discussion #63 May 30, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants