fmemuir / COASTGUARD

Coastal Observation + Analysis using Satellite-derived Timeseries, Generated Using AI + Real-time Data
28 stars 3 forks source link

QA 60 Band Issue in Sentinel-2 images #13

Closed IdhamN closed 3 days ago

IdhamN commented 1 week ago

Hi Freya,

I encountered a problem when I attempted to extract the vegetation edge in year 2024 using Sentinel-2 images. I received the error message "Image does not contain the band QA60". However, when I change the date to 2023, it works as expected.

QA 60 band issue

fmemuir commented 1 week ago

Thanks for raising this @IdhamN, will investigate with some test ee.Image Sentinel-2 objects for 2024!

fmemuir commented 1 week ago

After some research, the only relevant issue I can see is here: https://issuetracker.google.com/issues/324827389?pli=1 Basically the newest Sentinel-2 images have changed the QA band names, so they are no longer QA10, QA20 and QA60 but MSK_CLASSI_OPAQUE, MSK_CLASSI_CIRRUS and MSK_CLASSI_SNOW_ICE. The Sentinel-2 documentation doesn't list QA bands either, but 'Scene classification', 'Cloud probability' and 'Snow probability' (https://documentation.dataspace.copernicus.eu/Data/SentinelMissions/Sentinel2.html#sentinel-2-level-1c-top-of-atmosphere-toa).

I'll add a try/except to use MSK_CLASSI_OPAQUE if QA60 isn't available, as opaque clouds are what we care about masking. However, I'll do some more digging to make sure this is the correct cloud mask band to use from now on, or if this is a temporary band for only some new images.

fmemuir commented 3 days ago

I've now added a bug report to the GEE issue tracker for this (https://issuetracker.google.com/issues/351040913), and the condition I added for using the old vs. new band names (in https://github.com/fmemuir/COASTGUARD/commit/938523e7c4251edad12e924ca4bbc328c3ca56e1) will have to suffice for now.