Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade animation 1 #8459

Closed
Esteban82 opened this issue Apr 25, 2024 · 3 comments
Closed

Upgrade animation 1 #8459

Esteban82 opened this issue Apr 25, 2024 · 3 comments
Assignees
Labels
documentation Improve documentation feature request Request a new feature

Comments

@Esteban82
Copy link
Member

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

@Esteban82 Esteban82 added feature request Request a new feature documentation Improve documentation labels Apr 25, 2024
@Esteban82 Esteban82 self-assigned this Apr 25, 2024
@seisman
Copy link
Member

seisman commented Apr 25, 2024

Looks good.

@Esteban82
Copy link
Member Author

Any comments? @joa-quim?

@joa-quim
Copy link
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
Labels
documentation Improve documentation feature request Request a new feature
Projects
None yet
Development

No branches or pull requests

3 participants