File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ def func_gsi(image):
2525
2626 return collection
2727
28+ def add_external_mask (external_mask ):
29+ def wrap (image ):
30+ image_mask = image .mask ()
31+ combined_mask = image_mask .And (external_mask )
32+ return image .updateMask (combined_mask )
33+ return wrap
2834
2935def runTCTrend (config_trend ):
3036 # 1. load Landsat data and calculate indices
@@ -37,6 +43,12 @@ def runTCTrend(config_trend):
3743 .map (indices .ndwi57 ) \
3844 .map (indices .tc5 )
3945
46+ if 'mask' in config_trend .keys ():
47+ if isinstance (config_trend ['mask' ], ee .Image ):
48+ collection = collection .map (add_external_mask (config_trend ['mask' ]))
49+ else :
50+ print ('Mask Layer is not an ee.Image instance' )
51+
4052 # 2. Filter pixels off 3 std from mean
4153 std_diff = utils_LS .calculate_std_diff (collection , 3 )
4254 lower = std_diff [0 ]
You can’t perform that action at this time.
0 commit comments