annotate cads.sh @ 0:028c17cfb549 draft default tip

"planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
author climate
date Sat, 19 Jun 2021 18:35:18 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
1 #!/usr/bin/env bash
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
2
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
3 if [ -f download.tar.gz ]; then
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
4 tar zxvf download.tar.gz
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
5 cat *.grib > tmp.grib
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
6 cdo setgridtype,regular tmp.grib tmpg.grib
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
7 cdo -f nc -t ecmwf copy tmpg.grib tmp.nc
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
8 elif [ -f download.zip ]; then
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
9 unzip download.zip
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
10 cat *.grib > tmp.grib
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
11 cdo setgridtype,regular tmp.grib tmpg.grib
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
12 cdo -f nc -t ecmwf copy tmpg.grib tmp.nc
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
13 elif [ -f download.grib ]; then
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
14 cdo -f nc -t ecmwf copy download.grib tmp.nc
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
15 elif [ -f download.nc ]; then
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
16 mv download.nc tmp.nc
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
17 else
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
18 echo "No data found! Check your request and/or credentials."
028c17cfb549 "planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/cads commit 778688ee8d14e22b00b648858ad9bd1c2f46b1e0"
climate
parents:
diff changeset
19 fi