aboutsummaryrefslogtreecommitdiff
path: root/icon_download.sh
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2023-08-13 21:02:42 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2023-08-13 21:02:42 +0200
commitae709fdf1eb0df384835509a6c9500b69301d14c (patch)
treebaa7eadaf40911298978c5fdbb3a73d3f7c59a47 /icon_download.sh
parent417df67b59017cd8272926be628898874348b8da (diff)
downloadmeteo_toolbox-ae709fdf1eb0df384835509a6c9500b69301d14c.tar.gz
asdf
Diffstat (limited to 'icon_download.sh')
-rwxr-xr-xicon_download.sh26
1 files changed, 20 insertions, 6 deletions
diff --git a/icon_download.sh b/icon_download.sh
index d461b48..cf00cca 100755
--- a/icon_download.sh
+++ b/icon_download.sh
@@ -9,27 +9,36 @@ MODEL=icon-d2
MODEL_LONG=icon-d2_germany
BASE="http://opendata.dwd.de/weather/nwp"
-RUN="00"
-PARAMETERS=( "t" )
+RUN="15"
+PARAMETERS=( "t" "relhum" "u" "v" "fi" )
+PARAMETERS_SINGLE_LEVEL=( "cape_ml" "cin_ml" "tot_prec" "w_ctmax" )
PRESSURE_LEVELS=( "1000" "975" "950" "850" "700" "600" "500" "400" "300" "250" "200" )
-OFFSETS=( "000" )
+OFFSETS=( "000" "003" "006" "009" "012" "015" "018" "024" )
DATE=$(date +%Y%m%d)
mkdir -p $OUTDIR
echo -n > "$OUTDIR/index.txt"
-for PARAMETER in ${PARAMETERS[@]}; do
- for OFFSET in ${OFFSETS[@]}; do
+for OFFSET in ${OFFSETS[@]}; do
+ for PARAMETER in ${PARAMETERS[@]}; do
for LEVEL in ${PRESSURE_LEVELS[@]}; do
URL="$BASE/$MODEL/grib/$RUN/$PARAMETER/${MODEL_LONG}_regular-lat-lon_pressure-level_${DATE}${RUN}_${OFFSET}_${LEVEL}_${PARAMETER}.grib2.bz2"
BNAME=$(basename "$URL")
echo Getting "$URL"
- echo "$BNAME" >> $OUTDIR/index.txt
+ echo "${BNAME%.bz2}" >> $OUTDIR/index.txt
wget -q --directory-prefix=$OUTDIR "$URL"
done
done
+
+ for PARAMETER in ${PARAMETERS_SINGLE_LEVEL[@]}; do
+ URL="$BASE/$MODEL/grib/$RUN/$PARAMETER/${MODEL_LONG}_regular-lat-lon_single-level_${DATE}${RUN}_${OFFSET}_2d_${PARAMETER}.grib2.bz2"
+ BNAME=$(basename "$URL")
+ echo Getting "$URL"
+ echo "${BNAME%.bz2}" >> $OUTDIR/index.txt
+ wget -q --directory-prefix=$OUTDIR "$URL"
+ done
done
echo Done downloading. Decompressing...
@@ -38,4 +47,9 @@ for F in $OUTDIR/*.grib2.bz2; do
bzip2 -df "$F"
done
+rm -f $OUTDIR/combined.grib2
+
+grib_copy $OUTDIR/*.grib2 $OUTDIR/combined.grib2 || exit 1
+rm -f $OUTDIR/icon*.grib2
+
echo Done.