From 1e13a3ee99e0a92e964b784acd4e5e266357b837 Mon Sep 17 00:00:00 2001 From: Charles Morton Date: Sat, 19 Nov 2022 15:57:29 -0800 Subject: [PATCH] Fixing the elevation/latitude asset IDs --- openet/refetgee/__init__.py | 2 +- openet/refetgee/daily.py | 18 +++++++-------- openet/refetgee/hourly.py | 46 ++++++++++++++++++------------------- 3 files changed, 32 insertions(+), 34 deletions(-) diff --git a/openet/refetgee/__init__.py b/openet/refetgee/__init__.py index 1b5f283..dbdfcb1 100644 --- a/openet/refetgee/__init__.py +++ b/openet/refetgee/__init__.py @@ -1,4 +1,4 @@ from .daily import Daily from .hourly import Hourly -__version__ = '0.6.0' +__version__ = '0.6.1' diff --git a/openet/refetgee/daily.py b/openet/refetgee/daily.py index ef076d5..1218861 100644 --- a/openet/refetgee/daily.py +++ b/openet/refetgee/daily.py @@ -534,11 +534,11 @@ def nldas(cls, input_coll, zw=None, elev=None, lat=None, method='asce', if zw is None: zw = ee.Number(10) if elev is None: - elev = ee.Image('projects/openet/assets/meteorology/nldas/elevation') + elev = ee.Image('projects/openet/assets/meteorology/nldas/ancillary/elevation') # elev = ee.Image('CGIAR/SRTM90_V4')\ # .reproject('EPSG:4326', [0.125, 0, -125, 0, -0.125, 53]) if lat is None: - lat = ee.Image('projects/openet/assets/meteorology/nldas/latitude') + lat = ee.Image('projects/openet/assets/meteorology/nldas/ancillary/latitude') # lat = ee.Image('projects/earthengine-legacy/assets/' # 'projects/eddi-noaa/nldas/elevation')\ # .multiply(0).add(ee.Image.pixelLonLat().select('latitude'))\ @@ -784,11 +784,11 @@ def era5_land(cls, input_coll, zw=None, elev=None, lat=None, Wind speed height [m] (the default is 10). elev : ee.Image or ee.Number, optional Elevation image [m]. The OpenET ERA5-Land elevation image - (projects/openet/assets/meteorology/era5land/elevation) + (projects/openet/assets/meteorology/era5land/ancillary/elevation) will be used if not set. lat : ee.Image or ee.Number Latitude image [degrees]. The OpenET ERA5-Land latitude image - (projects/openet/assets/meteorology/era5land/latitude) + (projects/openet/assets/meteorology/era5land/ancillary/latitude) will be used if not set. method : {'asce' (default), 'refet'}, optional Specifies which calculation method to use. @@ -803,7 +803,7 @@ def era5_land(cls, input_coll, zw=None, elev=None, lat=None, Notes ----- Temperatures are converted from K to C. - Solar radiation is converted from J m-2 to MJ m-2 day-1. + Solar radiation is summed and converted from J m-2 to MJ m-2 day-1. Actual vapor pressure is computed from dew point temperature. """ @@ -813,11 +813,10 @@ def era5_land(cls, input_coll, zw=None, elev=None, lat=None, if zw is None: zw = ee.Number(10) if elev is None: - elev = ee.Image('projects/openet/assets/meteorology/era5land/elevation')\ - .rename(['elevation']) + elev = ee.Image('projects/openet/assets/meteorology/era5land/ancillary/elevation') if lat is None: - lat = ee.Image('projects/openet/assets/meteorology/era5land/latitude')\ - # lat = ee.Image('projects/openet/assets/meteorology/era5land/elevation')\ + lat = ee.Image('projects/openet/assets/meteorology/era5land/ancillary/latitude')\ + # lat = ee.Image('projects/openet/assets/meteorology/era5land/ancillary/elevation')\ # .multiply(0).add(ee.Image.pixelLonLat().select('latitude'))\ # .rename(['latitude']) @@ -835,7 +834,6 @@ def wind_magnitude(input_img): ea=calcs._sat_vapor_pressure( input_coll.select(['dewpoint_temperature_2m']).mean().subtract(273.15) ), - # TODO: Check that solar does not need additional conversion rs=input_coll.select(['surface_solar_radiation_downwards_hourly']) .sum().divide(1000000), uz=wind_img, diff --git a/openet/refetgee/hourly.py b/openet/refetgee/hourly.py index cad42aa..745700d 100644 --- a/openet/refetgee/hourly.py +++ b/openet/refetgee/hourly.py @@ -245,14 +245,17 @@ def nldas(cls, input_img, zw=None, elev=None, lat=None, lon=None, zw : ee.Number, optional Wind speed height [m] (the default is 10). elev : ee.Image or ee.Number, optional - Elevation image [m]. A custom NLDAS elevation image - (projects/eddi-noaa/nldas/elevation) will be used if not set. + Elevation image [m]. A precomputed NLDAS elevation image + (projects/openet/assets/meteorology/nldas/ancillary/elevation) + will be used if not set. lat : ee.Image or ee.Number - Latitude image [degrees]. The latitude will be computed - dynamically using ee.Image.pixelLonLat() if not set. + Latitude image [degrees]. A precomputed NLDAS latitude image + (projects/openet/assets/meteorology/nldas/ancillary/latitude) + will be used if not set. lon : ee.Image or ee.Number - Longitude image [degrees]. The longitude will be computed - dynamically using ee.Image.pixelLonLat() if not set. + Longitude image [degrees]. A precomputed NLDAS longitude image + (projects/openet/assets/meteorology/nldas/ancillary/longitude) + will be used if not set. method : {'asce' (default), 'refet'}, optional Specifies which calculation method to use. * 'asce' -- Calculations will follow ASCE-EWRI 2005. @@ -270,13 +273,12 @@ def nldas(cls, input_img, zw=None, elev=None, lat=None, lon=None, if zw is None: zw = ee.Number(10) if elev is None: - elev = ee.Image('projects/openet/assets/meteorology/nldas/elevation') + elev = ee.Image('projects/openet/assets/meteorology/nldas/ancillary/elevation') # elev = ee.Image('CGIAR/SRTM90_V4')\ # .reproject('EPSG:4326', [0.125, 0, -125, 0, -0.125, 53]) if lat is None: - lat = ee.Image('projects/openet/assets/meteorology/nldas/latitude') - # lat = ee.Image('projects/earthengine-legacy/assets/' - # 'projects/eddi-noaa/nldas/elevation')\ + lat = ee.Image('projects/openet/assets/meteorology/nldas/ancillary/latitude') + # lat = ee.Image('projects/openet/assets/meteorology/nldas/ancillary/elevation')\ # .multiply(0).add(ee.Image.pixelLonLat().select('latitude'))\ # .rename(['latitude']) # lat = ee.Image.pixelLonLat().select('latitude')\ @@ -284,9 +286,8 @@ def nldas(cls, input_img, zw=None, elev=None, lat=None, lon=None, # lat = nldas_img.select([0]).multiply(0)\ # .add(ee.Image.pixelLonLat().select('latitude')) if lon is None: - lon = ee.Image('projects/openet/assets/meteorology/nldas/longitude') - # lon = ee.Image('projects/earthengine-legacy/assets/' - # 'projects/eddi-noaa/nldas/elevation')\ + lon = ee.Image('projects/openet/assets/meteorology/nldas/ancillary/longitude') + # lon = ee.Image('projects/openet/assets/meteorology/nldas/ancillary/elevation')\ # .multiply(0).add(ee.Image.pixelLonLat().select('longitude'))\ # .rename(['longitude']) # lon = ee.Image.pixelLonLat().select('longitude')\ @@ -414,15 +415,15 @@ def era5_land(cls, input_img, zw=None, elev=None, lat=None, lon=None, Wind speed height [m] (the default is 10). elev : ee.Image or ee.Number, optional Elevation image [m]. The OpenET ERA5-Land elevation image - (projects/openet/assets/meteorology/era5land/elevation) + (projects/openet/assets/meteorology/era5land/ancillary/elevation) will be used if not set. lat : ee.Image or ee.Number Latitude image [degrees]. The OpenET ERA5-Land latitude image - (projects/openet/assets/meteorology/era5land/latitude) + (projects/openet/assets/meteorology/era5land/ancillary/latitude) will be used if not set. lon : ee.Image or ee.Number Longitude image [degrees]. The OpenET ERA5-Land longitude image - (projects/openet/assets/meteorology/era5land/longitude) + (projects/openet/assets/meteorology/era5land/ancillary/longitude) will be used if not set. method : {'asce' (default), 'refet'}, optional Specifies which calculation method to use. @@ -432,7 +433,7 @@ def era5_land(cls, input_img, zw=None, elev=None, lat=None, lon=None, Notes ----- Temperatures are converted from K to C. - Solar radiation is converted from J m-2 to MJ m-2 day-1. + Solar radiation is summed and converted from J m-2 to MJ m-2 hr-1. Actual vapor pressure is computed from dew point temperature. """ @@ -441,16 +442,15 @@ def era5_land(cls, input_img, zw=None, elev=None, lat=None, lon=None, if zw is None: zw = ee.Number(10) if elev is None: - elev = ee.Image('projects/openet/assets/meteorology/era5land/elevation')\ - .rename(['elevation']) + elev = ee.Image('projects/openet/assets/meteorology/era5land/ancillary/elevation') if lat is None: - lat = ee.Image('projects/openet/assets/meteorology/era5land/latitude') - # lat = ee.Image('projects/openet/assets/meteorology/era5land/elevation')\ + lat = ee.Image('projects/openet/assets/meteorology/era5land/ancillary/latitude') + # lat = ee.Image('projects/openet/assets/meteorology/era5land/ancillary/elevation')\ # .multiply(0).add(ee.Image.pixelLonLat().select('latitude'))\ # .rename(['latitude']) if lon is None: - lon = ee.Image('projects/openet/assets/meteorology/era5land/longitude') - # lon = ee.Image('projects/openet/assets/meteorology/era5land/elevation')\ + lon = ee.Image('projects/openet/assets/meteorology/era5land/ancillary/longitude') + # lon = ee.Image('projects/openet/assets/meteorology/era5land/ancillary/elevation')\ # .multiply(0).add(ee.Image.pixelLonLat().select('longitude'))\ # .rename(['longitude'])