Animations of Messi goals on the whole planet and on Europe done with GMT

Thanks @pwessel for the movie module!!

Full script for Europe animation:

#!/usr/bin/env bash

#	Resolucion de la imagen/grilla del mapa base
	RES=01m
	P=M
	
#	Titulo del mapa
	title=GolesMessi_Europe
	echo $title

#	Proyeccion del mapa y ancho del mapa
	W=23.92c		# Width Profile
	PROJ=${P}$W
	
#	Region geografica del mapa (W/E/S/N)
	REGION=-13/44/34/61
	REGION=-22/67/34/61
	
#	Offset en X/Y
	X=c
	Y=2.37c
	
	# Mapa background
	mapa=mapa_europa
	
#	Procesar Datos y dibujar mapa base
#	----------------------------------------------------------------------------------------------------------
#	Reordenar datos y agrandar
	gmt convert Datos/Datos_GolesMessi.txt -i1,2,3,3+s70,0 > temp_q.txt
#       -----------------------------------------------------------------------------------------------------------

gmt begin $mapa PNG
	gmt basemap -R$REGION -J$PROJ -B+n -Y$Y -X$X

#	Imagen satelital con sombreado (del DEM)
#	a. Crear grilla para sombreado a partir del DEM
	gmt grdgradient @earth_relief_$RES -Nt1.2 -A270 -G"temp_intens.nc"

#	b. Recortar imagen satelital
	gmt grdgdal @earth_day_$RES -G"temp_marble.tif" -Atranslate -M+r -F"-projwin -22 61 67 34"
#	c. Graficar imagen satelital 
	gmt grdimage "temp_marble.tif" -I"temp_intens.nc"

#	-------------------------------------------
# 	Limite paises
	gmt coast -Df -N1/thinnest

gmt end
cat << EOF > pre.sh
	
gmt begin
#	Crear lista de fechas para la animacion: Inicio/Fin/Intervalo. o: meses. y: años
#	gmt math -o0 -T2004-01-01T/2021-07-21T/3d T = times.txt
	
	gmt set MAP_FRAME_PEN 0.5
	gmt basemap -R$REGION -J$PROJ -B+n -Y$Y -X$X
	gmt image $mapa.png -Dx0/0+w$W 

# 	Logo con marca de agua
#	gmt image Datos/Pasamelfulbo_Logo.png -DjMB+w8c -t80 -Ggreen+t

#	Borde y escala
	gmt basemap -Bg0

	gmt makecpt -Chot -T1/7/1 -I -H > temp_q.cpt

# 	Crear y dibujar Leyenda
#	----------------------------------------------------------------------------------------------------------
	cat > temp_leyenda <<- END
	H 16p,Helvetica-Bold LIONEL MESSI'S GOALS ON EUROPE
	D 0 1p
	V 0 0.8p
	N 5
	V 0 1p
	A temp_q.cpt
	S 0.1c c 0.15c z=1    0.25p 0.6c 1 Goal
	S 0.1c c 0.20c z=2    0.25p 0.6c 2 Goals
	S 0.1c c 0.25c z=3    0.25p 0.6c 3 Goals
	S 0.1c c 0.30c z=4    0.25p 0.6c 4 Goals
	S 0.1c c 0.35c z=5    0.25p 0.6c 5 Goals
	D 0 1p
	V 0 0.8p
	T Created by Federico D. Esteban (@@mapasgeologicos) for @@pasameelfulbo with Generic Mapping Tools software. Made from data kindly provided by Messi Stats (messi.starplayerstats.com and @@_messistats).
	END

#	Dibujar leyenda
	gmt legend -DJBC+o0/0.07c+w16c/0c -F+p0.75+gwhite+s+r "temp_leyenda" --FONT_ANNOT_PRIMARY=8p

	gmt image "Datos/Pasameelfulbo_Logo.png"   -DjLB+o0/-2.35+w3.5c -Ggreen+t
	gmt image "Datos/Mapasgeologicos_Logo.png" -DjRB+o0/-2.35+w3.5c -Gwhite+t

gmt end
EOF

#	----------------------------------------------------------------------------------------------------------
# 	2. Set up main script
cat << EOF > main.sh
gmt begin
	gmt basemap -R$REGION -J$PROJ -B+n -Y$Y -X$X
	gmt events temp_q.txt -SE- -Ctemp_q.cpt --TIME_UNIT=d -T\${MOVIE_COL0} -Es+r6+d18 -Ms2.5+c0.5 -Mi5+c0 -Mt+c0 -Wfaint
gmt end
EOF

#	----------------------------------------------------------------------------------------------------------
# 	3. Run the movie
	gmt movie main.sh -Sbpre.sh -C24cx13.5cx80 -TDatos/Times_Goles.txt -N$title -H2 -D36 -Vi -W -G240/185/22 -Ml,png   \
	-Lc0+jTR+o0.3/0.3+gwhite+h+r --FONT_TAG=14p,Helvetica,black --FORMAT_CLOCK_MAP=- --FORMAT_DATE_MAP=dd-mm-yyyy       \
	-Lc1+jTL+o0.3/0.3+gwhite+h+r -Zs -Fmp4
5 Likes

:rofl:
This is probably the most relevant review concerning recent events on Earth

3 Likes

Brilliant movie, @Esteban82. We now need a movie showing the bitcoin/goal ratio going forward.

1 Like