Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug zU/zT when read from img properties. #22

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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