Skip to content

Commit

Permalink
Fixing the elevation/latitude asset IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgmorton committed Nov 19, 2022
1 parent 9f0509d commit 1e13a3e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 34 deletions.
2 changes: 1 addition & 1 deletion openet/refetgee/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .daily import Daily
from .hourly import Hourly

__version__ = '0.6.0'
__version__ = '0.6.1'
18 changes: 8 additions & 10 deletions openet/refetgee/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))\
Expand Down Expand Up @@ -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.
Expand All @@ -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.
"""
Expand All @@ -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'])

Expand All @@ -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,
Expand Down
46 changes: 23 additions & 23 deletions openet/refetgee/hourly.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -270,23 +273,21 @@ 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')\
# .reproject('EPSG:4326', [0.125, 0, -125, 0, -0.125, 53])
# 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')\
Expand Down Expand Up @@ -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.
Expand All @@ -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.
"""
Expand All @@ -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'])

Expand Down

0 comments on commit 1e13a3e

Please sign in to comment.