centreborelli / tsd

Time Series Downloader for satellite images
GNU Affero General Public License v3.0
40 stars 19 forks source link

(almost) duplicated images for Landsat 8 #26

Closed chlsl closed 4 years ago

chlsl commented 4 years ago

I believe I'm not reporting an issue here, but rather trying to understand tsd's output: sometimes I get two slightly different images of the same place taken the same day.

The command

python3 tsd/get_landsat.py --lat 41.008932 --lon 28.971928 --start-date 2020-04-12 --end-date 2020-04-13 --band B4 -o test

finds 2 images and downloads them:

$ ls -1 test
2020-04-12_L8_OLITIRS_LC81800312020103LGN00_band_B4.tif
2020-04-12_L8_OLITIRS_LC81800312020103LGN00_band_BQA.tif
2020-04-12_L8_OLITIRS_LC81800322020103LGN00_band_B4.tif
2020-04-12_L8_OLITIRS_LC81800322020103LGN00_band_BQA.tif

Everything works fine, but there exists two different Landsat 8 images from the exact same place taken the exact same day?

Looking at the metadata, I found that the date and row were different:

So the second image has been taken 23 seconds later, and is not referenced on the same row of Landsat's Worldwide Reference System.

Looking at the images themselves, they are not exactly the same. The differences are mainly on the land, not on the water. I'm showing below the two images and their difference.

Screenshot 2020-04-30 at 14 47 25

So I guess the image is the same but the post-processing is different, maybe the orthorectification? Which one should I use?

carlodef commented 4 years ago

Thanks you @chlsl for reporting this issue! It is fixed by commit 9c5c254.

The issue was caused by TSD using all existing Landsat-8 images that contain the requested AOI. As the Landsat-8 tiling grid has some overlap, if the AOI is contained in the overlap area of two different tiles (e.g. tiles 180/031 and 180/032 in your example), both tiles are used and this leads to two crops with the (almost) exact same content for every imaging date, as the content of the two tiles in the overlap area is generated from the same datatake (i.e. image acquisition).

The fix consists in keeping only one tile per datatake. The selection of the tile is arbitrarily set to keep the tile with the smallest row/path identifier.

chlsl commented 4 years ago

It works! Thank you @carlodef, and also for the very clear explanation.