diff --git a/dsget.sh b/dsget.sh new file mode 100755 index 0000000..572f034 --- /dev/null +++ b/dsget.sh @@ -0,0 +1,815 @@ +#!/bin/bash + +#-------------------------------------------------------------------------------------------# +# Demo script illustrating some examples using the OData interface # +# of the Data Hub Service (Ds) - previsouly Data Hub Service (DHuS) # +#-------------------------------------------------------------------------------------------# +# CHANGE LOG +# v0.3.1: +# - usage switch fixed +# - usage text updated to include the download of Sentinel 2 products +# - introduction of parallel download with check of the server error messages (option -n) +# - insertion of MD5 check +# +# Serco SpA 2015 +# CHANGE LOG +# v0.3.2: +# - fixed "-f" option +# - upgraded "-f" +# - added the following options: -s, -e, -S, -E, -F +# +# CHANGE LOG +# v0.3.3: +# - added the following options: -O, -L, -R, -r +# +# CHANGE LOG +# v0.3.4: +# - added the following options: -m, -i, -l, -P, -q, -C, -N, -D +# +# Serco SpA 2015 +# +#CHANGE LOG +#v0.3.5: +# -changed "==" with "=" in the MD5 check section +# +#CHANGE LOG +#v0.3.6 +# - added Sentinel-5 P references +# - changed "==" with "=" in the MD5 check section [line 818] +# - added CheckSum Echo +# +#CHANGE LOG +#v0.3.7 +# - fix download of ".NetCDF" file +# # +#CHANGE LOG +#v0.3.8 +# - added management of offline products download +# +#CHANGE LOG +#v0.3.9 +# - translated Copernicus scihub OData (Open Data Protocol) to +# Copernicus dataspace OData +# (see https://scihub.copernicus.eu/news/News01249) +# +#------------------------------------------------------------------------------------------- # +export VERSION=0.3.9 + +WD=dsget_tmp +PIDFILE=$WD/pid + +test -d $WD || mkdir -p $WD + +#- + +bold=$(tput bold) +normal=$(tput sgr0) +print_script=$(echo "$0" | rev | cut -d'/' -f1 | rev) + +function print_usage { + print_script=$(echo "$1" | rev | cut -d'/' -f1 | rev) + echo " " + echo "${bold}NAME${normal}" + echo " " + echo " Dsget $VERSION - The non interactive Sentinels product retriever from the Sentinels Data Hubs" + echo " " + echo "${bold}USAGE${normal}" + echo " " + echo " $print_script [LOGIN OPTIONS]... [SEARCH QUERY OPTIONS]... [SEARCH RESULT OPTIONS]... [DOWNLOAD OPTIONS]... " + echo " " + echo "${bold}DESCRIPTION${normal}" + echo " " + echo " This script allows to get products from Sentinels Data Hubs executing query with different filter. The products can be visualized on shell and saved in list file" + echo " or downloaded in a zip file." + echo " Recommendation: If this script is run as a cronjob, to avoid traffic load, please do not schedule it exactly at on-the-clock hours (e.g 6:00, 5:00)." + echo " " + echo "${bold}OPTIONS" + echo " " + echo " ${bold}LOGIN OPTIONS:${normal}" + echo " " + echo " -d : specify the URL of the Data Hub Service;" + echo " -u : data hub username;" + echo " -p : data hub password (note: if not provided by command line it is read by stdin);" + echo " " + echo " " + echo " ${bold}SEARCH QUERY OPTIONS:${normal}" + echo " " + echo " -m : Sentinel mission name. Possible options are: Sentinel-1, Sentinel-2, Sentinel-3, Sentinel-5 P);" + echo "" + echo " -i : instrument name. Possible options are: SAR, MSI, OLCI, SLSTR, SRAL, TROPOMI);" + echo "" + echo " -t