Repository 'cds_essential_variability'
hg clone https://toolshed.g2.bx.psu.edu/repos/climate/cds_essential_variability

Changeset 2:b9d9fe0c2ce7 (2019-06-23)
Previous changeset 1:8b30be2cef81 (2019-05-07) Next changeset 3:b261160f10ee (2019-07-07)
Commit message:
planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/essential_climate_variables commit 6045302c39c9c11fb6a73966a364cc395f2f9b28
modified:
README.md
ecv_retrieve.py
essential_climate_variables.xml
test-data/prep_seaice.nc
test-data/soil_moisture.nc
b
diff -r 8b30be2cef81 -r b9d9fe0c2ce7 README.md
--- a/README.md Tue May 07 03:26:08 2019 -0400
+++ b/README.md Sun Jun 23 11:16:11 2019 -0400
b
@@ -9,9 +9,23 @@
 
 The CDS API Key needs to be:
   - located in a file called `.cdsapirc`in the HOME area 
-    (as defined the `HOME` environment variable).
-  - or passed in an enviroment variable called `GALAXY_COPERNICUS_CDSAPIRC`. 
-    When passed in `GALAXY_COPERNICUS_CDSAPIRC`, make sure the key does not contain
-    the string `key: ` but the key itself only (starting with a number). The file
-    `.cdsapirc` will then be created and placed in the HOME area (using HOME
-    environment variable).
+    (as defined the `HOME` environment variable). 
+    The file `.cdsapirc` should look like that:
+
+```
+url: https://cds.climate.copernicus.eu/api/v2
+key: 111:8789787-qwerz4e47-888-not-real
+verify: 0
+```
+  - or passed in an enviroment variable called `GALAXY_COPERNICUS_CDSAPIRC_KEY`.
+    This environment variable should contain a string that looks like that:
+```
+111:8789787-qwerz4e47-888-not-real
+```
+    When passed in `GALAXY_COPERNICUS_CDSAPIRC_KEY`, make sure the key does not
+    contain the string `key: ` but the key itself only (starting with a number).
+    The file `.cdsapirc` will then be created and placed in the HOME area (using
+    HOME environment variable).
+  - or use `GALAXY_COPERNICUS_CDSAPIRC_KEY_FILE` to specify where your key file 
+    is stored on your system.
+
b
diff -r 8b30be2cef81 -r b9d9fe0c2ce7 ecv_retrieve.py
--- a/ecv_retrieve.py Tue May 07 03:26:08 2019 -0400
+++ b/ecv_retrieve.py Sun Jun 23 11:16:11 2019 -0400
b
@@ -34,7 +34,11 @@
             self.time_aggregation = '1_month'
         else:
             self.time_aggregation = time_aggregation
-        self.area = area
+        if area == '':
+            self.area = 'global'
+        else:
+            self.area = area
+
         if format == '':
             self.format = 'tgz'
         else:
@@ -57,6 +61,7 @@
                 'variable': self.variable,
                 'year': self.year,
                 'month': self.month,
+                'origin': 'era5',
                 'area': self.area,
                 'format': self.format,
                 'product_type': self.product_type,
b
diff -r 8b30be2cef81 -r b9d9fe0c2ce7 essential_climate_variables.xml
--- a/essential_climate_variables.xml Tue May 07 03:26:08 2019 -0400
+++ b/essential_climate_variables.xml Sun Jun 23 11:16:11 2019 -0400
[
b'@@ -7,21 +7,27 @@\n     </requirements>\n     <command detect_errors="exit_code"><![CDATA[\n        HOME=`pwd`  &&\n+       source \\$COPERNICUS_CDSAPIRC_KEY_FILE 2> /dev/null | true &&\n        python3 \'$__tool_directory__/ecv_retrieve.py\'\n             \'ecv-for-climate-change\' \'$variable\'\n-            --year \'$year\'\n-        #if str($time_aggregation.selector) == \'1_month\'\n-            --month \'$time_aggregation.month\'\n+            --month \'$month\'\n+        #if str($product_type.product) == \'monthly_mean\'\n+            --year \'$product_type.year\'\n+            --time_aggregation \'1_month\'\n+        #else if str($product_type.product) == \'anomaly\'\n+            --time_aggregation \'$product_type.selector\'\n+            --year \'$product_type.year\'\n         #else\n-            --month \'01\'\n+            --year \'2018\'\n+           --time_aggregation \'1_month\'\n         #end if\n-           --time_aggregation \'$time_aggregation.selector\'\n-           --product_type \'$product_type\'\n+           --product_type \'$product_type.product\'\n            --format \'tgz\' --output \'tmp.tgz\'\n            --verbose                                       &&\n            tar zxvf tmp.tgz                                &&\n-           cat *.grib > tmp.grib                           &&\n-           cdo -f nc -t ecmwf copy tmp.grib tmp.nc\n+           cat *.grib > tmpg.grib                          &&\n+           cdo remapcon,$adv.resol -setgridtype,regular tmpg.grib tmp.grib &&\n+           cdo -f nc -t ecmwf copy tmp.grib tmp.nc       \n     ]]></command>\n     <inputs>\n         <param name="variable" type="select" multiple="true" label="Variable(s)">\n@@ -29,78 +35,129 @@\n             <option value="surface_air_relative_humidity" selected="true">Surface air relative humidity</option>\n             <option value="0_7cm_volumetric_soil_moisture" selected="true">0-7cm volumetric soil moisture</option>\n             <option value="precipitation" selected="true">Precipitation</option>\n-            <option value="sea_ice" selected="true">Sea-ice</option>\n+            <option value="sea_ice_cover" selected="true">Sea-ice cover</option>\n         </param>\n-        <param name="product_type" type="select" label="Select type of data">\n-            <option value="climatology" selected="true">Climatology</option>\n-            <option value="anomaly">Anomaly</option>\n-        </param>\n-        <conditional name="time_aggregation">\n-            <param name="selector" type="select" label="Time aggregation">\n-                <option value="12_month" selected="true">yearly</option>\n-                <option value="1_month">monthly</option>\n+        <conditional name="product_type">\n+            <param name="product" type="select" label="Select type of data">\n+                <option value="monthly_mean" selected="true">Monthly mean</option>\n+                <option value="climatology">Climatology</option>\n+                <option value="anomaly">Anomaly</option>\n             </param>\n-            <when value="1_month">\n-                <param name="month" type="select" multiple="true" label="Select month(s)">\n-                    <option value="01" selected="true">January</option>\n-                    <option value="02" selected="true">February</option>\n-                    <option value="03" selected="true">March</option>\n-                    <option value="04" selected="true">April</option>\n-                    <option value="05" selected="true">May</option>\n-                    <option value="06" selected="true">June</option>\n-                    <option value="07" selected="true">July</option>\n-                    <option value="08" selected="true">August</option>\n-                    <option value="09" selected="true">September</option>\n-                    <option value="10" selected="true">October</option>\n-                    <option value="11" selected="true">November</option>\n-                    <option value="12" selected="true">December</option>\n+            <when value="monthly_mean'..b'   <param name="year" type="select" multiple="true"  label="Select year(s)">\n-            <option value="1979">1979</option>\n-            <option value="1980">1980</option>\n-            <option value="1981">1981</option>\n-            <option value="1982">1982</option>\n-            <option value="1983">1983</option>\n-            <option value="1984">1984</option>\n-            <option value="1985">1985</option>\n-            <option value="1986">1986</option>\n-            <option value="1987">1987</option>\n-            <option value="1988">1988</option>\n-            <option value="1989">1989</option>\n-            <option value="1990">1990</option>\n-            <option value="1991">1991</option>\n-            <option value="1992">1992</option>\n-            <option value="1993">1993</option>\n-            <option value="1994">1994</option>\n-            <option value="1995">1995</option>\n-            <option value="1996">1996</option>\n-            <option value="1997">1997</option>\n-            <option value="1998">1998</option>\n-            <option value="1999">1999</option>\n-            <option value="2000">2000</option>\n-            <option value="2001">2001</option>\n-            <option value="2002">2002</option>\n-            <option value="2003">2003</option>\n-            <option value="2004">2004</option>\n-            <option value="2005">2005</option>\n-            <option value="2006">2006</option>\n-            <option value="2007">2007</option>\n-            <option value="2008">2008</option>\n-            <option value="2009">2009</option>\n-            <option value="2010">2010</option>\n-            <option value="2011">2011</option>\n-            <option value="2012">2012</option>\n-            <option value="2013">2013</option>\n-            <option value="2014">2014</option>\n-            <option value="2015">2015</option>\n-            <option value="2016">2016</option>\n-            <option value="2017">2017</option>\n-            <option value="2018">2018</option>\n-            <option value="2019" selected="true">2019</option>\n-        </param>\n+        <section name="adv" title="Advanced Options" expanded="false">\n+            <param name="resol" type="select" label="Resolution">\n+                <option value="r1440x720" selected="true">high</option>\n+                <option value="r144x72">low</option>\n+            </param>\n+        </section>\n     </inputs>\n     <outputs>\n         <data name="ofilename" format="netcdf" from_work_dir="tmp.nc"/>\n@@ -108,17 +165,23 @@\n     <tests>\n         <test>\n             <param name="variable" value="0_7cm_volumetric_soil_moisture"/>\n-            <param name="product_type" value="climatology"/>\n-            <param name="time_aggregation" value="1_month"/>\n+            <conditional name="product_type">\n+                <param name="product" value="monthly_mean"/>\n+                <param name="year" value="2018"/>\n+            </conditional>\n             <param name="month" value="12"/>\n-            <param name="year" value="2018"/>\n+            <param name="resol" value="r144x72"/>\n             <output name="ofilename" ftype="netcdf" file="soil_moisture.nc" compare="sim_size" delta="100"/>\n         </test>\n         <test>\n-            <param name="variable" value="precipitation,sea_ice"/>\n-            <param name="product_type" value="anomaly"/>\n-            <param name="time_aggregation" value="12_month"/>\n-            <param name="year" value="2017"/>\n+            <param name="variable" value="precipitation"/>\n+            <conditional name="product_type">\n+                <param name="product" value="anomaly"/>\n+                <param name="year" value="2017"/>\n+                <param name="time_aggregation" value="12_month"/>\n+            </conditional>\n+            <param name="month" value="12"/>\n+            <param name="resol" value="r144x72"/>\n             <output name="ofilename" ftype="netcdf" file="prep_seaice.nc" compare="sim_size" delta="100"/>\n         </test>\n     </tests>\n'
b
diff -r 8b30be2cef81 -r b9d9fe0c2ce7 test-data/prep_seaice.nc
b
Binary file test-data/prep_seaice.nc has changed
b
diff -r 8b30be2cef81 -r b9d9fe0c2ce7 test-data/soil_moisture.nc
b
Binary file test-data/soil_moisture.nc has changed