Skip to content

Commit 3f164ee

Browse files
Additional smoothing in FANO calculation to address blockiness in output ETf images (#83)
* Downscale to 90m and smooth with focal mean of radius 5 for smooth_Tc_layered in image.py... This is supposed to take care of lack of smoothness from coarse Tcorr. Credit to Leo Laipelt! * Update test_c_image.py Updating test values to account for new FANO smoothing * Downscale to 90m and smooth with focal mean of radius 5 for smooth_Tc_layered in image.py... This is supposed to take care of lack of smoothness from coarse Tcorr. Credit to Leo Laipelt! --------- Co-authored-by: gparrish <[email protected]>
1 parent e31d9b2 commit 3f164ee

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

openet/ssebop/image.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -884,8 +884,10 @@ def tcold_FANO(self):
884884
ee.Image of Tcold values
885885
886886
"""
887+
gridsize_smooth = 90
887888
gridsize_fine = 240
888889
gridsize_coarse = 4800
890+
smooth_transform = [gridsize_smooth, 0, 15, 0, -gridsize_smooth, 15]
889891
fine_transform = [gridsize_fine, 0, 15, 0, -gridsize_fine, 15]
890892
self.coarse_transform = [gridsize_coarse, 0, 15, 0, -gridsize_coarse, 15]
891893
dt_coeff = 0.125
@@ -1003,15 +1005,15 @@ def tcold_FANO(self):
10031005
self.hot_dry_tcorr = Tc_fine
10041006

10051007
## ---------- Smoothing the FANO for Ag together starting with mixed landscape -------
1006-
1007-
# 1 pixel of smoothing to the main Tc where we make use of landcovers
1008+
# downscaling to 90 and smoothing with a 5x5 Tc where we make use of landcovers
10081009
self.smooth_Tc_Layered = (
10091010
self.tc_layered
1010-
.focalMean(1, 'square', 'pixels')
1011-
.reproject(self.crs, fine_transform)
1011+
.reproject(self.crs, smooth_transform)
1012+
.focalMean(5, 'square', 'pixels')
10121013
.rename('lst')
10131014
)
10141015

1016+
10151017
# Tcold with edge-cases handled.
10161018
return (
10171019
lst

openet/ssebop/tests/test_c_image.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,11 @@ def test_Image_from_method_kwargs():
566566
@pytest.mark.parametrize(
567567
'tcold_src, image_id, xy, expected',
568568
[
569-
# Old FANO Tcorr: 0.9785567103858176
570-
['FANO', 'LANDSAT/LC08/C02/T1_L2/LC08_042035_20150713', SCENE_POINT, 303.4515201604769],
571-
['FANO', 'LANDSAT/LC08/C02/T1_L2/LC08_042035_20150713', SCENE_POINT, 303.4515201604769],
569+
['FANO', 'LANDSAT/LC08/C02/T1_L2/LC08_042035_20150713', SCENE_POINT, 302.9531086729748],
570+
['FANO', 'LANDSAT/LC08/C02/T1_L2/LC08_042035_20150713', SCENE_POINT, 302.9531086729748],
571+
# Old approach without smoothing
572+
# ['FANO', 'LANDSAT/LC08/C02/T1_L2/LC08_042035_20150713', SCENE_POINT, 303.4515201604769],
573+
# ['FANO', 'LANDSAT/LC08/C02/T1_L2/LC08_042035_20150713', SCENE_POINT, 303.4515201604769],
572574
]
573575
)
574576
def test_Image_tcold_fano_source(tcold_src, image_id, xy, expected, tol=0.000001):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "openet-ssebop"
3-
version = "0.7.0"
3+
version = "0.7.1"
44
authors = [
55
{ name = "Gabe Parrish", email = "[email protected]" },
66
{ name = "Mac Friedrichs", email = "[email protected]" },

0 commit comments

Comments
 (0)