Skip to content

Commit

Permalink
Merge pull request #22 from lopezvoliver/tests
Browse files Browse the repository at this point in the history
Fix bug zU/zT when read from img properties.
  • Loading branch information
lopezvoliver authored Mar 5, 2024
2 parents b0fd0af + d3a51b4 commit 8bb7881
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions geeet/tseb.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def tseb_series(img=None, # ee.Image with inputs as bands (takes precedence o
Vza = Number(img.get('viewing_zenith')) # Viewing Zenith angle (0 for Landsat)
zu = Number(img.get("zU")) # Optionally get from img properties
zU = zu if zu else zU # otherwise fallback to kwarg
zt = Number(img.get("zU")) # Optionally get from img properties
zt = Number(img.get("zT")) # Optionally get from img properties
zT = zt if zt else zT # otherwise fallback to kwarg
# Optional
#CH = img.select('canopy_height') # TODO: check if band exists
Expand Down Expand Up @@ -577,11 +577,7 @@ def tseb_series_iteration(img, list):
### Update M-O length (L) and friction velocity
L = MOL(ustar, Ta, rho, cp, Lambda, Hu, LEu)
ustaru = compute_ustar(U, zU, L, rough)

if hasattr(ustar, "where"):
ustar = ustar.where(~pixelsToUpdate, ustaru)
else:
ustar = np.where(pixelsToUpdate, ustaru, ustar)
ustar = update_var(ustar, pixelsToUpdate, ustaru)

### Update resistances
resistu = RN95(U, CH, rough, LAI, Leaf_width, zU, zT, Ustar=ustar, L=L)
Expand Down

0 comments on commit 8bb7881

Please sign in to comment.