Freemallard's blog

small script to get sat images

1 minute read Published: 2026-05-05

This script uses eumetsat satellite imagery API to download satellite images and display it in a image viewer.

This is sort of a draft, but it fetches images of the last 10 hours of Dijon, France (ie: roughle POS=45.2,2.75,49.3,8.25). It also adds three subsequent layers: 1 layer for colours (rgb_geocolour), 1 layer for city labels (osmgray:dark_labels, so you know what you are looking at.), and one layer for rain precipitation (msg_fes:h60b).

Once the images are downloaded the image viewer opens and cycles them in a slideshows.

Dependencies

PS: I chose imv over feh for image viewing, as imv has slideshow supports (and also gif), which feh doesn't have.

Script

#!/usr/bin/env bash

WORKDIR="${HOME}/Images/EUMETSAT"
POS=45.2,2.75,49.3,8.25
FILES=()
cd "${WORKDIR}" || exit
notify-send "sat_image.sh" "Downloading satelite images for position: ${POS}"
for i in $(seq 10 -1 1) 
do
  DATE_PIC=$(date --date="${i} hours ago" -u +%Y-%m-%dT%H:%M:%SZ)
  FILE="dijon_${DATE_PIC}.png"
  if ! curl "https://view.eumetsat.int/geoserver/wms?service=WMS&request=GetMap&version=1.3.0&layers=rgb_geocolour,osmgray:dark_labels,msg_fes:h60b&styles=&format=image/png&crs=EPSG:4326&bbox=${POS}&width=1600&height=1600&time=${DATE_PIC}" --output "${FILE}"; then 
    notify-send "sat_image.sh" "Download failed"
    break;
  fi
  FILES+=("${FILE}")
done

notify-send "sat_image.sh" "Download finished"

DATE_PIC=$(date -u +%Y-%m-%dT%H:%M:%SZ)
 
# Could also make a gif with imagemagick
# magick "${FILES[@]}" "sat_${DATE_PIC}.gif"

imv ss "${FILES[@]}" -t 1
rm "${FILES[@]}"