Skip to content

Instantly share code, notes, and snippets.

@rinx
Last active August 29, 2015 14:07
Show Gist options
  • Save rinx/0c99bd375a4ec5e20f99 to your computer and use it in GitHub Desktop.
Save rinx/0c99bd375a4ec5e20f99 to your computer and use it in GitHub Desktop.
Download MTSAT data from tenki.jp
#!/bin/sh
# ------------------------------
# Download MTSAT data from tenki.jp
#
# # infrared
# http://az416740.vo.msecnd.net/static-images/satellite/2014/09/17/11/00/00/japan_near/large.jpg
# # visible
# http://az416740.vo.msecnd.net/static-images/satellite/2014/09/17/11/00/00/japan_near/large-visible.jpg
# # vapor
# http://az416740.vo.msecnd.net/static-images/satellite/2014/09/17/11/00/00/japan_near/large-vapor.jpg
#
# ------------------------------
CMDNAME=`basename $0`
year=$1
month=$2
day=$3
time=$4
if [ $# -ne 4 ]; then
cat << EOF 1>&2
Usage: $CMDNAME year month day time
Example: $CMDNAME 2014 08 04 11
--> To get 2014/08/04 11:00:00 images.
Download GMS-sat data from tenki.jp
Examples of download URI
# infrared
http://az416740.vo.msecnd.net/static-images/satellite/2014/09/17/11/00/00/japan_near/large.jpg
# visible
http://az416740.vo.msecnd.net/static-images/satellite/2014/09/17/11/00/00/japan_near/large-visible.jpg
# vapor
http://az416740.vo.msecnd.net/static-images/satellite/2014/09/17/11/00/00/japan_near/large-vapor.jpg
EOF
exit 1
fi
infra_uri="http://az416740.vo.msecnd.net/static-images/satellite/$year/$month/$day/$time/00/00/japan_near/large.jpg"
visib_uri="http://az416740.vo.msecnd.net/static-images/satellite/$year/$month/$day/$time/00/00/japan_near/large-visible.jpg"
vapor_uri="http://az416740.vo.msecnd.net/static-images/satellite/$year/$month/$day/$time/00/00/japan_near/large-vapor.jpg"
wget -N "$infra_uri" -O ${year}${month}${day}_${time}_infra.jpg > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e "\033[0;32m✔ \033[1;35m${year}${month}${day}_${time}_infra.jpg downloaded\033[00m" | sed "s/^-e //"
else
echo -e "\033[0;31m✗ \033[1;31m${year}${month}${day}_${time}_infra.jpg downloading failed\033[00m" | sed "s/^-e //"
fi
wget -N "$visib_uri" -O ${year}${month}${day}_${time}_visib.jpg > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e "\033[0;32m✔ \033[1;35m${year}${month}${day}_${time}_visib.jpg downloaded\033[00m" | sed "s/^-e //"
else
echo -e "\033[0;31m✗ \033[1;31m${year}${month}${day}_${time}_visib.jpg downloading failed\033[00m" | sed "s/^-e //"
fi
wget -N "$vapor_uri" -O ${year}${month}${day}_${time}_vapor.jpg > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e "\033[0;32m✔ \033[1;35m${year}${month}${day}_${time}_vapor.jpg downloaded\033[00m" | sed "s/^-e //"
else
echo -e "\033[0;31m✗ \033[1;31m${year}${month}${day}_${time}_vapor.jpg downloading failed\033[00m" | sed "s/^-e //"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment