From ad5fe5f8e9bffdece624856052cd18689b651d5a Mon Sep 17 00:00:00 2001 From: Jaap Langemeijer <33715902+Jaapel@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:03:32 +0200 Subject: [PATCH] update to collection2 (#24) --- eepackages/assets.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/eepackages/assets.py b/eepackages/assets.py index 5ae34e8..abf2549 100644 --- a/eepackages/assets.py +++ b/eepackages/assets.py @@ -155,10 +155,13 @@ def getImages(g, options): l9 = l9.select(bands["L9"]["from"], bands["L9"]["to"]) - l8 = ee.ImageCollection("LANDSAT/LC08/C01/T1_RT_TOA") + if options and "real_time" in options and options.get("real_time"): # default to RT + l8 = ee.ImageCollection("LANDSAT/LC08/C02/T1_RT_TOA") + else: + l8 = ee.ImageCollection("LANDSAT/LC08/C02/T1_TOA") if options and "includeTier2" in options: - l8 = l8.merge(ee.ImageCollection("LANDSAT/LC08/C01/T2_TOA")) + l8 = l8.merge(ee.ImageCollection("LANDSAT/LC08/C02/T2_TOA")) l8 = l8.filterBounds(g) @@ -172,10 +175,10 @@ def getImages(g, options): l8 = l8.select(bands["L8"]["from"], bands["L8"]["to"]) - l5 = ee.ImageCollection("LANDSAT/LT05/C01/T1_TOA") + l5 = ee.ImageCollection("LANDSAT/LT05/C02/T1_TOA") if options and "includeTier2" in options: - l5 = l5.merge(ee.ImageCollection("LANDSAT/LT05/C01/T2_TOA")) + l5 = l5.merge(ee.ImageCollection("LANDSAT/LT05/C02/T2_TOA")) l5 = l5.filterBounds(g) @@ -189,10 +192,10 @@ def getImages(g, options): l5 = l5.select(bands["L5"]["from"], bands["L5"]["to"]) - l4 = ee.ImageCollection("LANDSAT/LT04/C01/T1_TOA") + l4 = ee.ImageCollection("LANDSAT/LT04/C02/T1_TOA") if options and "includeTier2" in options: - l4 = l4.merge(ee.ImageCollection("LANDSAT/LT04/C01/T2_TOA")) + l4 = l4.merge(ee.ImageCollection("LANDSAT/LT04/C02/T2_TOA")) l4 = l4.filterBounds(g) @@ -206,10 +209,13 @@ def getImages(g, options): l4 = l4.select(bands["L4"]["from"], bands["L4"]["to"]) - l7 = ee.ImageCollection("LANDSAT/LE07/C01/T1_RT_TOA") + if options and "real_time" in options and options.get("real_time"): # default to RT + l7 = ee.ImageCollection("LANDSAT/LE07/C02/T1_RT_TOA") + else: + l7 = ee.ImageCollection("LANDSAT/LE07/C02/T1_TOA") if options and "includeTier2" in options: - l7 = l7.merge(ee.ImageCollection("LANDSAT/LE07/C01/T2_TOA")) + l7 = l7.merge(ee.ImageCollection("LANDSAT/LE07/C02/T2_TOA")) l7 = l7.filterBounds(g)