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

Updated notebooks #27

Merged
merged 8 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
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
Binary file modified examples/data/landsat_era5_sample.tif
Binary file not shown.
141 changes: 74 additions & 67 deletions examples/notebooks/01_geeet.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/notebooks/02_demo_using_GEE_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
" DT = img.select('dewpoint_temperature') # in Kelvin\n",
" P = img.select('surface_pressure') # in Pascals\n",
" from geeet.meteo import relative_humidity # eq 7.91 in ECMWF (2016)\n",
" RH = relative_humidity(T, DT, P) \n",
" RH = relative_humidity(T, DT) \n",
" img = img.addBands(Rn).addBands(RH)\n",
" return(img)\n",
"\n",
Expand Down Expand Up @@ -321,7 +321,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down
12 changes: 6 additions & 6 deletions examples/notebooks/03_eepredefined_landsat_era5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"\n",
"---\n",
"\n",
"The `geeet.eepredefined` library contains a collection of modules used to make it easy to ingest GEE data into the geeet models. \n",
"The `geeet.eepredefined` library contains a collection of modules that make it easy to ingest GEE data into the geeet models. \n",
"\n",
"This notebook demonstrates how to:\n",
"\n",
Expand Down Expand Up @@ -226,7 +226,7 @@
"\n",
"Let's generate a small visualization by clipping one of the images to a small region. \n",
"\n",
"> You will need [geemap](geemap.org) for this visualization. Alternatively, open [this script in the code editor](https://code.earthengine.google.com/628832ffbd371d828a048e9de2f0903d). "
"> You will need [geemap](geemap.org) for this visualization. Alternatively, open [this script in the code editor](https://code.earthengine.google.com/f71913e4516d36de0da2c0bce4f03d39). "
]
},
{
Expand Down Expand Up @@ -262,7 +262,7 @@
"Map.addLayer(image.select('NDVI'), {'min':0, 'max':1, 'palette':ndvi_pal, 'opacity': 0.8}, 'NDVI')\n",
"Map.addLayer(image.select('radiometric_temperature'), {'min':20+273, 'max':50+273, 'palette':red_pal}, 'Landsat radiometric temperature (K)')\n",
"Map.addLayer(image.select('Rn'), {'min':0, 'max':500, 'palette':red_pal}, 'Net radiation (W/m²)', False)\n",
"Map.addLayer(image.select('LEc'), {'min':0, 'max':500, 'palette':blue_pal}, 'Latent heat flux (W/m²) from the canopy source', True)\n",
"Map.addLayer(image.select('LEc'), {'min':0, 'max':300, 'palette':blue_pal}, 'Latent heat flux (W/m²) from the canopy source', True)\n",
"\n",
"Map"
]
Expand All @@ -273,7 +273,7 @@
"source": [
"Here's a preview of how the map should look like:\n",
"\n",
"![image](https://github.com/kaust-halo/geeet/assets/14804652/30aad357-5ced-4420-b264-7b935c9fd171)"
"![image](https://github.com/kaust-halo/geeet/assets/14804652/8379c468-1264-47ff-bdfb-89a7f9d8f61b)"
]
},
{
Expand Down Expand Up @@ -308,7 +308,7 @@
" crs=\"EPSG:32637\",\n",
" crsTransform=[30,0,296685,0,-30,3470115],\n",
" )\n",
"task.start() # Uncomment to submit the task."
"#task.start() # Uncomment to submit the task."
]
}
],
Expand All @@ -333,7 +333,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.2"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
" 'cloud_cover',\n",
" 'surface_pressure',\n",
" 'air_temperature',\n",
" 'dewpoint_temperature',\n",
" 'u_component_of_wind_10m',\n",
" 'v_component_of_wind_10m',\n",
" 'surface_solar_radiation_downwards_hourly',\n",
Expand Down Expand Up @@ -160,7 +161,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions examples/notebooks/05_xarray_landsat_era5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"metadata": {},
"outputs": [],
"source": [
"inputs = data[[\"NDVI\", \"albedo\", \"radiometric_temperature\", \n",
"\"surface_pressure\", \"air_temperature\", \"wind_speed\", \"solar_radiation\", \"thermal_radiation\"]]\n",
"inputs = data[[\"NDVI\", \"albedo\", \"radiometric_temperature\", \n",
"\"surface_pressure\", \"air_temperature\", \"dewpoint_temperature\", \"wind_speed\", \"solar_radiation\", \"thermal_radiation\"]]\n",
"inputs"
]
},
Expand Down Expand Up @@ -178,8 +178,8 @@
"inputsb = (datab[[\n",
" \"longitude\", \"latitude\",\n",
" \"NDVI\", \"albedo\", \"radiometric_temperature\", \n",
" \"surface_pressure\", \"air_temperature\", \"wind_speed\", \n",
" \"solar_radiation\", \"thermal_radiation\"]]\n",
" \"surface_pressure\", \"air_temperature\", \"dewpoint_temperature\",\n",
" \"wind_speed\", \"solar_radiation\", \"thermal_radiation\"]]\n",
")\n",
"\n",
"xetb = geeet.tseb.tseb_series(inputsb, **dict(\n",
Expand Down Expand Up @@ -219,7 +219,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down
3 changes: 2 additions & 1 deletion geeet/ptjpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def ptjpl_arid(img=None, # ee.Image with inputs as bands (takes precedence over
band_names = img.bandNames()
NDVI = img.select('NDVI')
Ta = img.select('air_temperature')
Td = img.select('dewpoint_temperature')
P = img.select('surface_pressure')
F_aparmax = img.select('fapar_max')
time = img.get('time')
Expand Down Expand Up @@ -154,7 +155,7 @@ def ptjpl_arid(img=None, # ee.Image with inputs as bands (takes precedence over
ft = compute_ft_arid(Ta)
f_apar = compute_fapar(NDVI)
fm = compute_fm(f_apar, F_aparmax)
met_params = compute_met_params(Ta, P)
met_params = compute_met_params(Ta, Td, P)
fsm = compute_fsm(RH, Ta, Beta)

if is_img(img):
Expand Down
3 changes: 1 addition & 2 deletions geeet/resistances.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
def RN95(U, CH, rough_params, LAI, leaf_width, zU, zT, L=None, Ustar = None, rough_bands = ['ZM','ZH','D0'] , band_names = ['Ra', 'Rs', 'Rx']):
"""
Calculate the original TSEB resistances from Norman et al., 1995 (N95)
#//description
Inputs:
- U: wind speed in m/s, numpy array or an ee.Image
- CH: canopy height in m, numpy array or ee.Image
Expand Down Expand Up @@ -98,7 +98,6 @@ def RN95(U, CH, rough_params, LAI, leaf_width, zU, zT, L=None, Ustar = None, rou
where C1 ~ 90 s-1/2 m-1
s is the average leaf width
Udzm is given by equation A.9 and is obtained after computing Uc (Equations B2-B4)
#//enddescription
"""
from geeet.MOST import PsiM as compute_psim
from geeet.MOST import PsiH as compute_psih
Expand Down