GenericMappingTools / gmt-2024-animation

Illustration and movie scripts for 2024 publication on GMT animations
GNU General Public License v3.0
1 stars 0 forks source link

How to interpolate trajectories on Indiana Jones animation? #3

Closed Esteban82 closed 1 year ago

Esteban82 commented 1 year ago

In the script I have these two lines:

    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

I see now that I am NOT using the the second command. I've been reading the documentation (events -A) but I don't.

Should I use gmt events to interpolate the between cities? Or is it ok to use sample1d and mapproject for this animation?

PaulWessel commented 1 year ago

Yes. The events -Ar100c is to be used when you wish to animate the line with variable thickness or color: That means converting the line to a point cloud. Since your line remains constant thickness and color then plotting the line with events -Ar as you do is the way to do it. So you can remove that superfluous events call in pre.sh.

Looking at the psevents code, I am doing a linear interpolation to find the end of the line at the new current time. So that is why the resampling via sample1d is necessary to get the great circles. However, I realise we had a bug (or unimplemented feature!) in sample1d. Documentation correctly says that if you use modifier +a to -T then it will write out the geospatial distances as last column. But it did not. So, via https://github.com/GenericMappingTools/gmt/pull/7382 I have implemented that. Once it is merged you can remove the mapproject command entirely, so that makes it simpler.

Other things you still need to change in the script (I think):

Esteban82 commented 1 year ago

Thanks Paul. I approved those modifications and add a few more.