-
Notifications
You must be signed in to change notification settings - Fork 9
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
Sentinel-2 BOA_ADD_OFFSET harmonisation #134
Comments
For reference for others, this is the function I've written to apply the offset - don't know if there is a better solution?
To use:
|
Thanks for opening this. xref #40. As you note the current workaround is for users to apply the offset themselves. This isn't great, and we're looking into how to make this better. I'll take a closer look at your function, but one thing I noticed: you might need to be careful with dtypes and wrapping around. I believe the raw data for some of those bands is uint16 so you need to ensure that values smaller than the offset don't wrap around before clipping. |
Also xref pytroll/satpy#1850, which (maybe?) handled this in satpy. I haven't looked too closely. |
Thanks Tom. Good point on wrapping hadn't thought of that. I've added an extra where call to set values > 10,000 to 0 as well. Bit of a hack, but it is a solution...
|
I haven't tested it yet, but I think that
should be equivalent and avoids the need to clip / |
Quick note: we have an example at https://planetarycomputer.microsoft.com/dataset/sentinel-2-l2a#Baseline-Change discussing this now. |
Thanks for sharing. There is a typo to fix perhaps, the clipped dataset is not returned. I am pasting here my version of that example which checks on the baseline instead of the date. Perhaps not needed, but I was wondering if all products on the 25th of Jan are with the new baseline...
|
Thanks
Can you expand on this? In
the clipped data should be in |
Sorry, I meant that the line:
in the example, should be:
that's the typo I was referring to. |
Whoops. I thought that |
microsoft/PlanetaryComputerExamples#249 updates the notebook. |
I would also like to know if there are plans to integrate the BOA_ADD_OFFSET. e.g.: item.assets.B04.s2:boa-add-offset |
stactools-packages/sentinel2#47 added it to the stactools package. We'll incorporate that into our pipeline at some point, but don't have an ETA right now. |
Hi all,
I wonder whether you might consider harmonisation of the Sentinel-2 data concerning the BOA_ADD_OFFSET, which was introduced in Jan 2022?
The Google Earth Engine do this (https://developers.google.com/earth-engine/datasets/catalog/sentinel-2) as does sentinel-hub (https://forum.sentinel-hub.com/t/sentinel-2-processing-baseline-changes-and-harmonizevalues/4635)
The BOA_ADD_OFFSET value is provided within the product-metadata XML file, but it is not very easy to read this offset when using several images. Even assuming the offset remains at -1000 and isn't read from the header file, it is still something that all users need to remember to apply, and this isn't documented on the planetary computer Sentinel-2 page.
Pete
The text was updated successfully, but these errors were encountered: