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
'NoData' area is not black(clean) in the Sentinel-2 MSI output #1727
Comments
Thanks @yukaribbba for reporting this issue. It is strange, but maybe the no data value is wrongly assigné in the msi safe reader? I will try to have a look on Monday if no one beats me to it. |
@mraspaud Thanks. I just discovered it yesterday but I think it could’ve been here for some time since it also exists in the images generated several months ago. |
Ah, the problem is that the data is integers. We should convert it to floats in the reader. |
@yukaribbba ok, I had a better look, and the problem is simply that the no-data value is never defined in the reader. According to the MTD file, it should be zero. I don't have much time right now, so if you want to give it a try... it's just about replacing zeros in the data with |
@mraspaud Sorry I'm not good at coding...so could you give me more hints about this? Thanks |
I was thinking that around here: https://github.com/pytroll/satpy/blob/main/satpy/readers/msi_safe.py#L79 But I can try to do a PR later today |
@mraspaud I just found an image created last April, by 0.20 or 0.21, not sure. No problem there. So maybe it's due to the changes of some dependencies? |
@yukaribbba I now completed the PR I made earlier (#1628) and added the masking of the invalid data. I also added tests, so hopefully that PR can now be merged. Would you mind testing this and tell me if it fixes your problem? |
@mraspaud It truely works. I've tested about 100 datasets and both issues got fixed. Thank you! |
Thanks for testing! I will merge the PR now. |
Describe the bug
I generate an image with
fill_value=0
option, but the result is 1. This will cause problems when doing mosaic.Without
fill_value=0
, there should be an alpha band with transparent area, however the outcome is black this time. Also the alpha band is completely white.This happens on every 'edge' dataset I've tested, whether atmospheric corrected or not.
To Reproduce
Expected behavior
'NoData' area should be set correctly.
Environment Info:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: