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?
Proper HLS data averaging for a desert
-
amigdala999
- Posts: 2
- Joined: Tue Nov 11, 2025 2:24 pm America/New_York
-
LP DAAC - dgolon
- User Services

- Posts: 181
- Joined: Tue Dec 03, 2024 2:37 pm America/New_York
- Endorsed: 2 times
Re: Proper HLS data averaging for a desert
Hello @amigdala999 Apologies for the delay in response. We are looking into your question. In your post you mentioned you attached pictures but we do not see any. Please try attaching them again or email them to us at lpdaac@usgs.gov and reference this post. Thanks -- Danielle
Subscribe to the LP DAAC listserv by sending a blank email to lpdaac-join@lists.nasa.gov.
Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.
Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.
-
LP DAAC - dgolon
- User Services

- Posts: 181
- Joined: Tue Dec 03, 2024 2:37 pm America/New_York
- Endorsed: 2 times
Re: Proper HLS data averaging for a desert
Hi @amigdala999 Please ensure you are using the quality flag to properly filter out the data. It sounds like you are doing so, and if so then that is how the quality of the data is and filtering by quality will filter down to a smaller amount of data. However, we are happy to review the quality portion of your workflow for you, if you are interested, to ensure it is not overly filtering data out by accident. If interested, please email it to us at lpdaac@usgs.gov. Thanks --Danielle
Subscribe to the LP DAAC listserv by sending a blank email to lpdaac-join@lists.nasa.gov.
Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.
Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.