From 2be63dcb87d86beb3a79ec2d3872c031a27800e1 Mon Sep 17 00:00:00 2001 From: pixalytics-galaxy Date: Fri, 27 Sep 2024 07:15:47 +0100 Subject: [PATCH 1/7] Update for new CDS API --- tools/c3s/c3s.xml | 10 +++++----- tools/c3s/test-data/input.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/c3s/c3s.xml b/tools/c3s/c3s.xml index 1932df0..76c0e24 100644 --- a/tools/c3s/c3s.xml +++ b/tools/c3s/c3s.xml @@ -1,9 +1,9 @@ - + for retrieving climate data - python - cdsapi - cdo + python + cdsapi + cdo tar unzip @@ -61,7 +61,7 @@ $is_file.api_req_text - + diff --git a/tools/c3s/test-data/input.txt b/tools/c3s/test-data/input.txt index da1d34d..c6c9c6c 100644 --- a/tools/c3s/test-data/input.txt +++ b/tools/c3s/test-data/input.txt @@ -5,7 +5,7 @@ c = cdsapi.Client() c.retrieve( 'reanalysis-era5-single-levels-monthly-means', { - 'format': 'netcdf', + 'data_format': 'netcdf', 'product_type': 'monthly_averaged_reanalysis', 'variable': '2m_temperature', 'year': '2020', From fca4029d599af82f34ece8195bbd70adf2830952 Mon Sep 17 00:00:00 2001 From: sam-pixalytics Date: Fri, 27 Sep 2024 09:47:17 +0100 Subject: [PATCH 2/7] Update of description and configuration --- tools/c3s/c3s.xml | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/tools/c3s/c3s.xml b/tools/c3s/c3s.xml index 76c0e24..469cb0c 100644 --- a/tools/c3s/c3s.xml +++ b/tools/c3s/c3s.xml @@ -28,7 +28,7 @@ `_. +- Any user willing to use this tool needs to `create a new account `_. - Set your CDS API Key via: User -> Preferences -> Manage Information" -- Documentation on where to get the CDS API key can be found `here `_. -- Compose your request directly on C3S and copy/paste it in the input field "Request" or save it in a file. -- Be aware that for being able to download dataset from C3S, users also need to agree to their term of use (Licence to use Copernicus Products) on the C3S website. +- Documentation on where to get the CDS API key can be found `here `_. +- Compose your request directly on C3S and extract the relevant information, which should be put in the input field "Request" or saved in a file. The format should be, for example: + +import cdsapi + +c = cdsapi.Client() + +c.retrieve( + 'reanalysis-era5-single-levels-monthly-means', + { + 'data_format': 'netcdf', + 'product_type': 'monthly_averaged_reanalysis', + 'variable': '2m_temperature', + 'year': '2020', + 'month': '12', + 'time': '00:00', + 'area': [ + 60, 10, 59.5, + 10.5, + ], + }, + 'download.nc') + +- Be aware that for being able to download dataset from C3S, users also need to agree to licensing terms for each dataset of interest on the C3S website. License: ~~~~~~~~ @@ -100,7 +121,7 @@ Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains. ]]> - + Copernicus Climate Change Service (2024) topic_3855 From 6e697ab81067c386aa75231e47eee8d4615e985d Mon Sep 17 00:00:00 2001 From: sam-pixalytics Date: Fri, 27 Sep 2024 18:00:55 +0100 Subject: [PATCH 3/7] Added citation and help improved formatting --- tools/c3s/c3s.xml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/c3s/c3s.xml b/tools/c3s/c3s.xml index 469cb0c..0b49392 100644 --- a/tools/c3s/c3s.xml +++ b/tools/c3s/c3s.xml @@ -104,10 +104,7 @@ c.retrieve( 'year': '2020', 'month': '12', 'time': '00:00', - 'area': [ - 60, 10, 59.5, - 10.5, - ], + 'area': [60, 10, 59.5, 10.5 ], }, 'download.nc') @@ -120,9 +117,6 @@ Generated using Copernicus Climate Change Service information [2021] Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains. ]]> - - Copernicus Climate Change Service (2024) - topic_3855 topic_3318 @@ -132,4 +126,8 @@ that may be made of the Copernicus information or data it contains. operation_3357 operation_0335 + + + @misc{C3S2024,author={Copernicus Climate Change Service},year={2024}} + From 9adad0e5f0ac419e8e8b88a3460f2b41b79d3f76 Mon Sep 17 00:00:00 2001 From: Sam Lavender Date: Fri, 27 Sep 2024 18:22:33 +0100 Subject: [PATCH 4/7] Update c3s.xml --- tools/c3s/c3s.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/c3s/c3s.xml b/tools/c3s/c3s.xml index 0b49392..3078afd 100644 --- a/tools/c3s/c3s.xml +++ b/tools/c3s/c3s.xml @@ -104,7 +104,7 @@ c.retrieve( 'year': '2020', 'month': '12', 'time': '00:00', - 'area': [60, 10, 59.5, 10.5 ], + 'area': [60, 10, 59.5, 10.5], }, 'download.nc') @@ -113,7 +113,7 @@ c.retrieve( License: ~~~~~~~~ -Generated using Copernicus Climate Change Service information [2021] +Generated using Copernicus Climate Change Service information [2024] Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains. ]]> @@ -127,7 +127,7 @@ that may be made of the Copernicus information or data it contains. operation_0335 - + @misc{C3S2024,author={Copernicus Climate Change Service},year={2024}} From 0d0321d2de0ffefc61a32642ccf30ea3ab53a77d Mon Sep 17 00:00:00 2001 From: Sam Lavender Date: Fri, 27 Sep 2024 19:06:18 +0100 Subject: [PATCH 5/7] Update c3s.xml --- tools/c3s/c3s.xml | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/tools/c3s/c3s.xml b/tools/c3s/c3s.xml index 3078afd..feac29e 100644 --- a/tools/c3s/c3s.xml +++ b/tools/c3s/c3s.xml @@ -84,32 +84,26 @@ $is_file.api_req_text ======================================================================================================= This tool is a wrapper to retrieve data from the Copernicus Climate Data Store. - - It allows to retrieve data from the Copernicus climate Data Store. - Any user willing to use this tool needs to `create a new account `_. - Set your CDS API Key via: User -> Preferences -> Manage Information" - Documentation on where to get the CDS API key can be found `here `_. -- Compose your request directly on C3S and extract the relevant information, which should be put in the input field "Request" or saved in a file. The format should be, for example: - -import cdsapi - -c = cdsapi.Client() - -c.retrieve( - 'reanalysis-era5-single-levels-monthly-means', - { - 'data_format': 'netcdf', - 'product_type': 'monthly_averaged_reanalysis', - 'variable': '2m_temperature', - 'year': '2020', - 'month': '12', - 'time': '00:00', - 'area': [60, 10, 59.5, 10.5], - }, - 'download.nc') - +- Compose your request directly on C3S and extract the relevant information, which should be put in the input field "Request" or saved in a file. The format should be, for example:: + import cdsapi + c = cdsapi.Client() + c.retrieve( + 'reanalysis-era5-single-levels-monthly-means', + { + 'data_format': 'netcdf', + 'product_type': 'monthly_averaged_reanalysis', + 'variable': '2m_temperature', + 'year': '2020', + 'month': '12', + 'time': '00:00', + 'area': [60, 10, 59.5, 10.5], + }, + 'download.nc') - Be aware that for being able to download dataset from C3S, users also need to agree to licensing terms for each dataset of interest on the C3S website. - License: ~~~~~~~~ From fc4656b7b74cd494923d9af297b6db6bb00a5fd1 Mon Sep 17 00:00:00 2001 From: Sam Lavender Date: Fri, 27 Sep 2024 19:19:34 +0100 Subject: [PATCH 6/7] Update c3s.xml --- tools/c3s/c3s.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/c3s/c3s.xml b/tools/c3s/c3s.xml index feac29e..22a07f9 100644 --- a/tools/c3s/c3s.xml +++ b/tools/c3s/c3s.xml @@ -78,6 +78,15 @@ $is_file.api_req_text + + topic_3855 + topic_3318 + + + operation_2422 + operation_3357 + operation_0335 + - - topic_3855 - topic_3318 - - - operation_2422 - operation_3357 - operation_0335 - @misc{C3S2024,author={Copernicus Climate Change Service},year={2024}} From bb1986c6e3921a7dee7d9250787faded0e4b81de Mon Sep 17 00:00:00 2001 From: Bjoern Gruening Date: Fri, 27 Sep 2024 20:59:31 +0200 Subject: [PATCH 7/7] fix last linting issues --- tools/c3s/c3s.xml | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/tools/c3s/c3s.xml b/tools/c3s/c3s.xml index 22a07f9..6fb0dc2 100644 --- a/tools/c3s/c3s.xml +++ b/tools/c3s/c3s.xml @@ -1,5 +1,14 @@ - + for retrieving climate data + + topic_3855 + topic_3318 + + + operation_2422 + operation_3357 + operation_0335 + python cdsapi @@ -11,18 +20,18 @@ export HOME=`pwd` && #set $c3s_cds_apikey = $__user__.extra_preferences.get('c3s_account|c3s_cds_apikey', "") #if $c3s_cds_apikey == "" - echo "Error. Set your credentials via: User -> Preferences -> Manage Information" && + echo "Error. Set your credentials via: User -> Preferences -> Manage Information" && #else cp '$cds_key_file' .cdsapirc && #end if #if str($is_file.has_req).strip() == 'yes' python3 '$__tool_directory__/c3s_retrieve.py' - --request '$is_file.api_req_file' --output request.txt && + --request '$is_file.api_req_file' --output request.txt && #else python3 '$__tool_directory__/c3s_retrieve.py' - --request $req_from_paste --output request.txt && + --request $req_from_paste --output request.txt && #end if - bash $__tool_directory__/c3s.sh && + bash $__tool_directory__/c3s.sh && echo "C3S data retrieval is done" ]]> @@ -52,8 +61,8 @@ $is_file.api_req_text - - + + @@ -78,27 +87,22 @@ $is_file.api_req_text - - topic_3855 - topic_3318 - - - operation_2422 - operation_3357 - operation_0335 - `_. - Set your CDS API Key via: User -> Preferences -> Manage Information" - Documentation on where to get the CDS API key can be found `here `_. - Compose your request directly on C3S and extract the relevant information, which should be put in the input field "Request" or saved in a file. The format should be, for example:: + + import cdsapi + c = cdsapi.Client() c.retrieve( 'reanalysis-era5-single-levels-monthly-means', @@ -112,7 +116,10 @@ This tool is a wrapper to retrieve data from the Copernicus Climate Data Store. 'area': [60, 10, 59.5, 10.5], }, 'download.nc') + + - Be aware that for being able to download dataset from C3S, users also need to agree to licensing terms for each dataset of interest on the C3S website. + License: ~~~~~~~~