Dr Jones fligth to Venice in his Last Crusade

I try adding gmt events -Rd -JG${MOVIE_COL0}/${MOVIE_COL1}/15c "temp_timefile.txt" -Ar100c > temp_line_points.txt in main.sh but at the end of the movie, the start of the lines goes north (to the Bering Strait).

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 -Rd -JG${MOVIE_COL0}/${MOVIE_COL1}/15c "temp_timefile.txt" -Ar100c > temp_line_points.txt
    gmt events temp_line_points.txt -Ar -T${MOVIE_COL2} -Es -W2p,red
gmt end

I got your first movie (Venice) to work well without any problems (I think, you should check). Here are the important parts:

  1. The 10.66k is not good enough, but that is probably just a tiny minor part. The other part is that while the default is great circle distances, the default ellipsoid is WGS-84. So there is possibly some issues related to geocentric vs geodetic latitudes. In the end, I used gmt set PROJ_ELLIPSOID Sphere in both scripts and used -I10.645980883k.
  2. Probably much more important: I experimented with a much higher dpi in -Ar. I think twice the dpi is OK (2160) but I also ran with 4320. This yields a much finer sampling of the circles and since we are going from continuous lines to discrete circles the jittering is probably due to picking the next nearest circle. Please give this a try. If you agree this works well and removes the jittering then I think I will declare a but and add that factor or 2 (or 4) into events so that we can still do -Ar1080 but get the finer resampling.

Please try this and give feedback and if you agree it is working well then I will do a PR on events before we move on to other cases.

Ok. I will try it tomorrow. Thanks Paul.

1 Like

See these two for setting the best increment:

L=$(gmt mapproject -G+uk cities.txt  --PROJ_ELLIPSOID=Sphere | gmt convert -El -o2)
dx=$(gmt math -Q ${L} 30 24 MUL DIV =)

and see this PR for the solution to the jittery; no need to mess with -Ar.

1 Like

Thanks Paul. By “no need to mess with -Ar.” do you mean the line with -Ardpu, right? I remove and it works.

So, in this case there is no need to use -Ardpu because I am resampling the line trough sample1d?

Also, would be cool if you could explore -E, -M to get the leading point of the line to appear as a brighter, slightly larger circle.

Yes, I will do it. I am just starting to play with events.

No, you still need to run events -Ar1080 inside your main script. I meant we do not need to experiment with higher values in that call as the problem was in sample1d.

In my script I use events twice (see below). I removed the first one and it works.

In pre.sh:  gmt events -Rd "temp_timefile.txt" -Ar100c > temp_line_points.txt
In main.sh: gmt events temp_line_points.txt -Ar -T${MOVIE_COL2} -Es -W2p,red

Yes probably OK since your frames are all very similar in local map scale so running -Ardpi once may be OK. But in general the recommendation I will add to the events docs is to say that if your -R -J are changing with the frames then you may need to rerun that command.

Only now realizing you are using -Ar in the plotting call. The point of the -Ardpi is to convert the line to a dense set of points that you can plot as circles with -Sc and then control via -M -E. Plotting with -Ar cannot allow any change to the line tip.

1 Like

Just to be clear.
I made these two animations:
I create these two lines and in the left (right) video I plot the first (second) line. The movie looks fine when I plot the line created without events -Ar100c.

In pre.sh
gmt sample1d "cities.txt" -I${dx}k -fg -i1,0 | gmt mapproject -G+uk > "tmp_time.txt"
gmt events -Rd "tmp_time.txt" -Ar100c > tmp_points.txt


In main.sh
gmt events tmp_time.txt -Ar -T${MOVIE_COL2} -Es -W2p,red
gmt events tmp_points.txt -Ar -T${MOVIE_COL2} -Es -W2p,red

I need to work up some better documentation for dealing with lines in events and play a bit myself too. I think your case works because events will cut the line exactly at the timepoints, insert the intersection point as the last point, and plot the line. So it does not need -Ardpi at all then, of course.