I have a shiptrack (in NMEA) which I have formatted like this:
$ head long-lat-time.gmt
010:56.48643 78:06.99576 2009-05-09T204347.13
010:56.47279 78:06.99634 2009-05-09T204348.13
010:56.45915 78:06.99693 2009-05-09T204349.13
010:56.44551 78:06.99752 2009-05-09T204350.13
010:56.43190 78:06.99816 2009-05-09T204351.13
010:56.41830 78:06.99890 2009-05-09T204352.13
010:56.40475 78:06.99976 2009-05-09T204353.13
010:56.39106 78:07.00070 2009-05-09T204354.13
010:56.37716 78:07.00161 2009-05-09T204355.13
010:56.36329 78:07.00245 2009-05-09T204356.13
I would like to do an animation showing the ships progress/position through time.
The clock format as seen above is --FORMAT_CLOCK_IN=hhmmss.xx
; I do however see that there does not seem to be a template for decimal seconds in FORMAT_CLOCK_IN (but there is one for FORMAT_CLOCK_OUT
).
The following script produces an animation, but the movement through time (by events
) is having problems understanding the time (I think) (animation,bad):
start=2009-05-09T20:43:47
stop=2009-05-09T21:56:22
gmt math -o0 -T${start}/${stop}/1m T = times.txt
cat<<eof > main.sh
gmt begin
gmt coast -Ggray -JM15c -R5/15/77.5/79
gmt plot -Wthick long-lat-time.gmt
gmt events -Sc0.02c -Gred --MAP_ANNOT_OBLIQUE=30 -B0 long-lat-time.gmt -T\${MOVIE_COL0} --FORMAT_CLOCK_IN=hhmmss.xx
gmt end
eof
time gmt movie main.sh -Ncruise -C19cx16cx100 -Fmp4 -Ttimes.txt -V -Z -Pf+jTC+ac0 -Lc0+jBL -D12 --FORMAT_CLOCK_MAP=hhmmss.xx
rm times.txt main.sh
If I reformat the clock-string in the shiptrack file, it works fine (animation, good):
$ head long-lat-time.gmt
010:56.48643 78:06.99576 2009-05-09T20:43:47
010:56.47279 78:06.99634 2009-05-09T20:43:48
010:56.45915 78:06.99693 2009-05-09T20:43:49
010:56.44551 78:06.99752 2009-05-09T20:43:50
010:56.43190 78:06.99816 2009-05-09T20:43:51
010:56.41830 78:06.99890 2009-05-09T20:43:52
010:56.40475 78:06.99976 2009-05-09T20:43:53
010:56.39106 78:07.00070 2009-05-09T20:43:54
010:56.37716 78:07.00161 2009-05-09T20:43:55
010:56.36329 78:07.00245 2009-05-09T20:43:56
I’m attaching the long-lat-time file used below.
long-lat-time.gmt.zip (46.6 KB)
To change long-lat-time.gmt (insert :
and remove decimal second) in order to make a good animation, use:
$ sed -i -e "s/.\{38\}/&:/" -e "s/.\{41\}/&:/" -e 's/.\{3\}$//' long-lat-time.gmt
And remove –FORMAT_CLOCK_IN=hhmmss.xx.
Am I using the wrong gmt.conf parameter? Or doesn’t gmt understand decimal seconds?