From d7f1d26f1b3ba73144ff8a4996377f09e8d950d8 Mon Sep 17 00:00:00 2001 From: weiqi-tori Date: Mon, 11 Nov 2024 14:31:29 +0800 Subject: [PATCH] fix albedo --- city_metrix/layers/albedo.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/city_metrix/layers/albedo.py b/city_metrix/layers/albedo.py index 38983397..f50dd30f 100644 --- a/city_metrix/layers/albedo.py +++ b/city_metrix/layers/albedo.py @@ -13,9 +13,6 @@ class Albedo(Layer): spatial_resolution: raster resolution in meters (see https://github.com/stac-extensions/raster) threshold: threshold value for filtering the retrieval """ - S2 = ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED") - S2C = ee.ImageCollection("COPERNICUS/S2_CLOUD_PROBABILITY") - MAX_CLOUD_PROB = 30 S2_ALBEDO_EQN = '((B*Bw)+(G*Gw)+(R*Rw)+(NIR*NIRw)+(SWIR1*SWIR1w)+(SWIR2*SWIR2w))' @@ -37,8 +34,8 @@ def get_masked_s2_collection(self, roi, start, end): ee.Filter.bounds(roi) )) # .select('B2','B3','B4','B8','B11','B12') - s2 = self.S2.filter(criteria) - s2c = self.S2C.filter(criteria) + s2 = ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED").filter(criteria) + s2c = ee.ImageCollection("COPERNICUS/S2_CLOUD_PROBABILITY").filter(criteria) s2_with_clouds = (ee.Join.saveFirst('cloud_mask').apply(**{ 'primary': ee.ImageCollection(s2), 'secondary': ee.ImageCollection(s2c),