Animation. How to make a flight westwards?

I want to make an animation of a flight westwards. I use project to create a path from San Francisco to Hawaii (and then gmt events -Ar50c). When the flight is eastwards, the animation is ok. The line growths (first animation). However, when the flight is westwards (second animation) the line reduces (I want it to growth). How can I do it?

	gmt project -C122.416389/37.7775 -E157.9225/21.318611 -Q -G200 > "line.txt"    # Eastwards
    gmt project -C-122.416389/37.7775 -E-157.9225/21.318611 -Q -G200 > "line.txt" # Westwards

Flight_E
Flight_W

Full script:

#!/usr/bin/env bash

cat << 'EOF' > pre.sh
gmt begin
	#gmt project -C122.416389/37.7775 -E157.9225/21.318611 -Q -G200 > "line.txt"    # Eastwards
    gmt project -C-122.416389/37.7775 -E-157.9225/21.318611 -Q -G200 > "line.txt" # Westwards
    gmt coast -Rd -JW-180/15.9c -Da -G200 -Sdodgerblue2 -N1/0.2,- -Yc -Xc 
    gmt events line.txt -Rd -Ar50c -i0,1,0 > line_points.txt
gmt end
EOF

cat << 'EOF' > main.sh
gmt begin
    gmt basemap -Rd -JW-180/15.9c -Y0 -Xc -B+n
    gmt events line_points.txt -Ar -T${MOVIE_COL0} -Es -W2p,red
gmt end
EOF

gmt movie "main.sh" -S"bpre.sh" -T"line.txt" -N"Flight_W" -Zs \
-C16cx8.1cx50c -Vi -Ml,png -Fgif+l

Dont you need a monotonically increasing column (like time or distance) in your line_points.txt so -T${MOVIE_COL0} will do the right thing? in the westward case your chosen time column goes backwards.

1 Like

Thanks Paul. It was a bit hard to understand how events works with lines.

I use these commands and it worked:

gmt events line.txt -Rd -Ar50c > line_points.txt
gmt events line_points.txt -Ar -T${MOVIE_COL2} -Es -W2p,red