Dr Jones fligth to Venice in his Last Crusade

I made an animation of a flight from New York to Venice.

I also have a question. How can I remove the effect (jittery?) of the front of the line? I try with -H2,4,8 and changing the resolution (DPU) without luck. Any idea/suggestion?

Full script (I am amazed on how few lines are needed).

#!/usr/bin/env bash
DPU=1080p

title=Anim_Jones_$DPU

cat << 'EOF' > pre.sh
gmt begin

# Escalas del viaje
cat << 'FILE' > cities.txt
40.711913, -74.007135, New York
47.561598, -52.712229, St Johns (Terranova)
37.741556, -25.696368, Sao Miguel (Azores)
38.775808, -9.135406, Lisboa (Portugal)
45.502971, 12.342151, Venecia (Italia)
FILE
    gmt sample1d "cities.txt" -I10.66k -fg -i1,0 | gmt mapproject -G+uk > "temp_timefile.txt"

#	Convertir linea para graficar
    gmt events -Rd "temp_timefile.txt" -Ar${MOVIE_DPU} > temp_line_points.txt
gmt end
EOF

cat << 'EOF' > main.sh
gmt begin
    gmt coast -R-800/800/-450/450+uk -JG${MOVIE_COL0}/${MOVIE_COL1}/24c -Bg0 -Yc -Xc -Df -G200 -Sdodgerblue2 -N1/0.2,-
    gmt events temp_line_points.txt -Ar -T${MOVIE_COL2} -Es -W2p,red
gmt end
EOF

#	Movie: Crear figuras y animacion. Opciones C: Canvas Size. G: Color fondo.
gmt movie "main.sh" -Sb"pre.sh" -N$title -T"temp_timefile.txt" -C$DPU -Vi -Ml,png -Fmp4
2 Likes

This is wonderful, @Esteban82 ! Just so I understand, by jittery here you mean the red line growing in short spurts and not smoothly and continuously as the rest? My guess (without trying anything) is that the line is not sampled finely enough?

Ok. Yes, exactly that. I will play with the sample.

Do you mean the line created with sample1d or the one with events?

By the way, I also try a flight from San Francisco to Nepal and something weird happened to the line.

Don’t know, I would try to change one at the time to see if it makes any difference. How did you pick 10.66k?

The Nepal one I suspect has a date line issue. Does it look like that if you just make a static plot of all of the temp_timefile.txt or temp_line_points.txt?

I pick 10.66k to get a 30 seconds animation (so I could add the a cut of the movie soundtrack).

I’m afraid I don’t quite understand the question.

Sorry, it was a bit rambling. What I mean was this.

Make a global map of each of those two files with gmt plot. Do any of them look similarly bad? Plot them as points I guess.

So I tested the output from sample1d and mapproject and they both are fine. Then I did events and it worked fine to make the final file. So I think the input files are OK. So things go wrong inside the movie loop over frames. Since you posted everything I will take this a bit further and fine a master frame that breaks down. BTW, I thought having the DPU being 1080p and not 1080 was the problem but it did not care there, but not sure if movie parses it the same way. So try removing the ‘p’ and see if there is any change.

1 Like

Sorry, 1080p is fine in both cases. I need coffee…

I ran your first Venice movie and while there might be a tiny bit of jittery in my local result it is not anything like the jittery in the youtube posting. Does it run jittery if you play it locally on your computer?

Can you post the cities coordinates file you used for the Nepal trek?

#!/usr/bin/env bash
title=Anim_Jones_Hemisferico

cat << 'EOF' > pre.sh
gmt begin

# Escalas del viaje
cat << 'FILE' > cities.txt
-122.416389	37.7775		San Francisco
-157.9225	21.318611	Honolulu
121.019722	14.508333	Manila
85.358889	27.696389	Katmandu
FILE
    gmt sample1d "cities.txt" -I22.7k -fg | gmt mapproject -G+uk > "temp_timefile.txt"

#	Convertir linea para graficar
    gmt events -Rd "temp_timefile.txt" -Ar100c > temp_line_points.txt
gmt end
EOF

cat << 'EOF' > main.sh
gmt begin
    gmt coast -Rd -JG${MOVIE_COL0}/${MOVIE_COL1}/15c -Bg0 -Yc -Xc -Da -G200 -Sdodgerblue2 -N1/0.2,-
    gmt events temp_line_points.txt -Ar -T${MOVIE_COL2} -Es -W2p,red
gmt end
EOF

#	Movie: Crear figuras y animacion. Opciones C: Canvas Size. G: Color fondo.
	gmt movie "main.sh" -Sb"pre.sh" -N$title -T"temp_timefile.txt" -C15cx15cx100 -Vi -M100,png -Gblack -Zs -Fmp4

It would be possible that there is problem in the segment between Honolulu and Manila? Here I plot a line between them without interpolation.

Gmt should select the shortest path. This is the long path, no?

Yes, it is.

I found an issue. The following script gives this. The red line created by `gmt events -Ar100c -JW0/15c’ follows the long path.

#!/usr/bin/env bash
title=BUG_Events

cat << 'EOF' > pre.sh
gmt begin
# Escalas del viaje
cat << 'FILE' > cities.txt
185	    0 1
175 	0 2
FILE
    gmt events -Rd "cities.txt" -Ar100c > temp_line_points.txt  -JW0/15c
    gmt events -Rd "cities.txt" -Ar100c > temp_line_points2.txt -JW180/15c
gmt end
EOF
cat << 'EOF' > main.sh
gmt begin
    gmt coast -Rd -JW180/15c -Bg0 -Yc -Xc -Dc -G200 -Sdodgerblue2 -N1/0.2,-
    gmt plot temp_line_points.txt   -W2p,red
    gmt plot temp_line_points2.txt  -W2p,black
gmt end
EOF
#	Movie: Crear figuras y animacion. Opciones C: Canvas Size. G: Color fondo.
	gmt movie "main.sh" -Sb"pre.sh" -N$title -T2 -C15cx15cx100 -Vi -Ml,png -Gblack

Now it works. I use the following command (I add -JG-185/0/15c). I wonder what would happens is the lines goes on the west up to San Francisco. The same issue would appear again?

gmt events -Rd "temp_timefile.txt" -JG-185/0/15c -Ar100c > temp_line_points.txt

I think that if the -J changes in the movie you need to rerun events -Ardpi. Since yours do, you should put that command into the main.sh script.

Ok. I will try it.