Ive been working on a Sentinel-2 median dataset at the country level using Open Data Cube. While my methodology works fine for the majority of areas, it performs poorly where there is an overlap of S-2 granules (between 2-5 depending on orbit).To bypass this problem, I've been using load_ard with a combination of "group_by", "min_gooddata" and "predicate" flags to filter granules so that the returned imagery completely contains the AOI is contained (thus only returning a single granule i.e. "01GEM").
My issue is that for the remaining AOIS, the overlap is still causing issues, particularly in bands with less range in DN. Top image is 32bit RGB (S2 bands 432) and bottom image is false colour (S2 bands 132).
I suspect this effect is caused as granules can occur on different dates and filtered out depending on cloud cover. Ive also tried the same AOIs but excluded the min_gooddata flag so all images are used in the median. Unfortunately this had a similar result.
For those interested a cutdown version of the code is here
Any ideas on a potential solution? Or how I could reduce the effect of this problem? It must be fairly common.