Skip to content

Upgrade animation 1 #8459

Closed
Closed

Description

@Esteban82

I think we should upgrade animation 1.

First of all, it has piping between gmt modules. This it is not advise and should be remove. Also, there is no need to use the commnad with gmt math and gmt convert.

It is possible to use gmt events instead of plot and movie -L instead of printf ... within the main script. I think we should change this.

Another change is to increase the number of frames created (and frame rate).

Here is an animation that I made:

New_anim01.mp4

Here is the script

# 1. Create files needed in the loop
cat << 'EOF' > pre.sh
gmt math -T0/360/10 T SIND = sin_point.txt
gmt math -T0/360/1 T SIND = sin_curve.txt
gmt begin
	gmt basemap -R0/360/-1.2/1.6 -JX22c/11.5c -X1c -Y1c \
	-BWSne+glightskyblue -Bxa90g90f30+u@. -Bya0.5f0.1g1 --FONT_ANNOT_PRIMARY=9p
gmt end
EOF
# 2. Set up the main frame script
cat << 'EOF' > main.sh
gmt begin
	gmt basemap -R0/360/-1.2/1.6 -JX22c/11.5c -X1c -Y1c -B+n

#	Plot smooth blue curve and dark red dots at all angle steps so far
	gmt events sin_curve.txt -i0,1,0 -T${MOVIE_FRAME} -Ar -Es -W1p,blue 
	gmt events sin_point.txt -i0,1,0 -T${MOVIE_FRAME} -Sc0.25c -Gdarkred
	
#	Plot bright red dot at current angle and annotate
	gmt events sin_curve.txt -T${MOVIE_FRAME} -Sc0.1i -Gred -i0,1,0 -L0

gmt end
EOF
# 3. Run the movie
gmt movie main.sh -Sbpre.sh -Chd -Tsin_curve.txt -Vi -D50 -NNew_anim01 \
	-Lf+t"a = %3.3d"+f14p,Helvetica-Bold+jTL+o1.25/1.15 -M35,png -Fmp4 -Zs

Activity

  1. added
    feature request
    documentation
    on Apr 25, 2024
  2. self-assigned this
    on Apr 25, 2024
  3. seisman commented on Apr 25, 2024

    @seisman
    Member

    Looks good.

  4. Esteban82 commented on Apr 25, 2024

    @Esteban82
    MemberAuthor

    Any comments? @joa-quim?

  5. joa-quim commented on Apr 25, 2024

    @joa-quim
    Member

    Looks good to me to. Go ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationfeature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions