Hi guys,
I tried to download CGLS LAI from openEO. I managed to do it few years ago using following codes:
session = openeo.connect("https://openeo-dev.vito.be").authenticate_oidc("egi")
# using eci sso !!!
#session.describe_collection("CGLS_LAI300_V1_GLOBAL")
#LAI300 = session.load_collection("CGLS_LAI300_V1_GLOBAL")
LAIV2 = session.load_collection("CGLS_LAI_V2_GLOBAL")
# CGLS_LAI_V2_GLOBAL
year = [i+2006 for i in range(14)]
month = [i+1 for i in range(12)]
ts = pd.date_range("2006-01-01", "2019-12-31")
for iyear in year:
for imonth in month:
ts_tmp = ts[(ts.year == iyear) & (ts.month == imonth)]
# LAIV2.filter_temporal(ts_tmp.strftime("%Y-%m-%d")[0],
# ts_tmp.strftime("%Y-%m-%d")[-1]).filter_bbox([-4.875,41.125,10.125,52.125]).download("/Users/xushan/research/TUD/test_jackknife/LAI/LAI_1km_V2/LAI_"+ts_tmp.strftime("%Y-%m-%d")[0]+"_"+ts_tmp.strftime("%Y-%m-%d")[-1]+".nc",format="NetCDF")
LAIV2.filter_temporal(ts_tmp.strftime("%Y-%m-%d")[0],
ts_tmp.strftime("%Y-%m-%d")[-1]).filter_bbox([-11.75,36,29.5,58]).download("/Users/xushan/research/TUD/test_jackknife/LAI/westEurope_LAI_1km_V2/LAI_"+ts_tmp.strftime("%Y-%m-%d")[0]+"_"+ts_tmp.strftime("%Y-%m-%d")[-1]+".nc",format="NetCDF")
# LAIV2.filter_temporal(ts_tmp.strftime("%Y-%m-%d")[0],
# ts_tmp.strftime("%Y-%m-%d")[-1]).filter_bbox([-4.875,41.125,10.125,52.125]).download("/Users/xushan/research/TUD/test_jackknife/LAI/LAI_1km_V2/FAPAR_"+ts_tmp.strftime("%Y-%m-%d")[0]+"_"+ts_tmp.strftime("%Y-%m-%d")[-1]+".nc",format="NetCDF")
print(ts_tmp.strftime("%Y-%m-%d")[0]+' to '+ts_tmp.strftime("%Y-%m-%d")[-1] + " done!")
However, now I found this script does not work anymoreā¦and right now I am using a new laptop, so I do understand I need to authentic myself again. However, I found it is hard to find a way to do it.
I checked from the openEOhub that two backends have CGLS LAI: openEO and Vito. So I tried to use the URL link from https://hub.openeo.org: https://openeocloud.vito.be/openeo/1.0.0
and https://openeo.vito.be/openeo/1.2
. However, I found both URL cannot authentic. For example, if I run
session = openeo.connect("https://openeocloud.vito.be/openeo/1.0.0").authenticate_oidc()
there is no output under this commandā¦but just waiting for its returned valuesā¦
if I tried to use other URL like āā
it returns:
session = openeo.connect("https://earthengine.openeo.org").authenticate_oidc()
Traceback (most recent call last):
Cell In[23], line 1
session = openeo.connect("https://earthengine.openeo.org").authenticate_oidc()
File ~/miniforge3/envs/py310/lib/python3.10/site-packages/openeo/rest/connection.py:564 in authenticate_oidc
provider_id, client_info = self._get_oidc_provider_and_client_info(
File ~/miniforge3/envs/py310/lib/python3.10/site-packages/openeo/rest/connection.py:310 in _get_oidc_provider_and_client_info
raise OpenEoClientException("No client_id found.")
OpenEoClientException: No client_id found.
So how can I do it? Thanks!