Proper HLS data averaging for a desert
Posted: Wed Nov 12, 2025 2:52 am America/New_York
Hi,
I would like to get an average image of HLS S30 granule for a certain month. It must contaiin a minimal possible SR, so during the averaging I choose a pixel with a minimal value. For that I'm fetching a monthly B02-B04 granules across different years. Then I'm averaging this COG files considering their FMask to filter some pixel types. The FMask values of averaged pixels is OR'ed. After that I build a rgb thumbnail from averaged B02-B04 result with an official python script.
My first results had some color artifact for a desert areas (image1 attached, this is a tile 37RDM averaged from 109 granules).
I believe this is because I filtered only "Cirrus | Cloud | AdjCloud | ShadowCloud | Water" pixels and left Aerosol* ones. And pixels marked as Aerosol* often contain a big negative values. At least AerosolHigh for sure.
So I deside to filer an Aerosol* pixels too. And end up with nothing to average, bcs all pixels for this desert region were marked with Aerosol*.
Then I exclude only AerosolHigh (0b11000000) pixels and leave AerosolLow and AerosolModerate as is. This produces an image which is only a little better.
And at the end I additionally excluded all pixels with values < 0 from averaging. And got image3, which is a much better. But it still contains a few bad (pink) pixels in it.
I also can see some bad pixels if their valies are really averaged (not chosen by min), but a fewer (image5).
The question is: could there be any recommendation on filtering outlier aerosol pixels values other than throwing out negative values?
I would like to get an average image of HLS S30 granule for a certain month. It must contaiin a minimal possible SR, so during the averaging I choose a pixel with a minimal value. For that I'm fetching a monthly B02-B04 granules across different years. Then I'm averaging this COG files considering their FMask to filter some pixel types. The FMask values of averaged pixels is OR'ed. After that I build a rgb thumbnail from averaged B02-B04 result with an official python script.
My first results had some color artifact for a desert areas (image1 attached, this is a tile 37RDM averaged from 109 granules).
I believe this is because I filtered only "Cirrus | Cloud | AdjCloud | ShadowCloud | Water" pixels and left Aerosol* ones. And pixels marked as Aerosol* often contain a big negative values. At least AerosolHigh for sure.
So I deside to filer an Aerosol* pixels too. And end up with nothing to average, bcs all pixels for this desert region were marked with Aerosol*.
Then I exclude only AerosolHigh (0b11000000) pixels and leave AerosolLow and AerosolModerate as is. This produces an image which is only a little better.
And at the end I additionally excluded all pixels with values < 0 from averaging. And got image3, which is a much better. But it still contains a few bad (pink) pixels in it.
I also can see some bad pixels if their valies are really averaged (not chosen by min), but a fewer (image5).
The question is: could there be any recommendation on filtering outlier aerosol pixels values other than throwing out negative values?