Simple animation script using NMEA (from GPS/GNSS) to plot ship track.
Q: I would like to have better annotation along the progress bar; annotated ticks for May {09-13} and small ticks every e.g. 6h with an annotated tick every 12th hour. Tips are welcome!
#!/usr/bin/env bash
# start preprocessing
# format nmea data to: lon lat yyyy-mm-ddTThhmmss.xx,
# e.g. 010:23.36686 78:39.62868 2009-05-10T030308.60
grep -e GPZDA cruisetrack.TXT | awk -F, '{print $5"-"$4"-"$3"T"$2}' > dato-tid # get date and time
grep -e GPGLL cruisetrack.TXT | awk -F, '{print $4,$2}' | sed -e "s/.\{3\}/&:/" | sed -e "s/.\{15\}/&:/" > lon-lat.txt # get lon and lat
# merge the two files
paste -d' ' lon-lat.txt dato-tid > lon-lat-time
# clean up
rm dato-tid lon-lat.txt
# end preprocessing
# this gives 4981 frames, 83 frames/sec. ~-> 60 sec. animation
start=2009-05-09T204347.13
stop=2009-05-13T073209.16
gmt math --FORMAT_CLOCK_IN=hhmmss.xx -o0 -T${start}/${stop}/1m T = times.txt
cat<<eof > main.sh
gmt begin
gmt set GMT_THEME minimal
gmt coast -Ggray -JS10/90/12c -R8/77.75/18/80r
gmt plot lon-lat-time
gmt events -Sc0.01c -Gred lon-lat-time -T\${MOVIE_COL0} --FORMAT_CLOCK_IN=hhmmss.xx -Bxaf -Byaf
gmt end
eof
gmt movie main.sh -Nanimasjon-shiptrack-av-svalbardtokt -C17cx19cx100 -Fmp4 -Ttimes.txt -V -Z -Pf+jTC+ac0 -Lc0+jBL -D83 --FORMAT_CLOCK_MAP=hh:mm
rm times.txt main.sh lon-lat-time