Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

anim02.sh 1.4 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  1. #!/usr/bin/env bash
  2. # GMT ANIMATION 02
  3. #
  4. # Purpose: Make simple MP4 of an illuminated DEM grid of the US Rockies
  5. # GMT modules math, makecpt, grdcut, grdimage, inset, plot, text, movie
  6. # Unix progs: cat
  7. # Note: Run with any argument to build movie; otherwise 1st frame is plotted only.
  8. #
  9. # The finished movie is available in our YouTube channel as well:
  10. # https://youtu.be/WQ6JrtEu_Fk
  11. # The movie took 1 minute 45 seconds to render on a 24-core MacPro 2013.
  12. if [ $# -eq 0 ]; then # Just make master PostScript frame 0
  13. opt="-Mps"
  14. else # Make MP4
  15. opt="-Fmp4"
  16. fi
  17. # 1. Create files needed in the loop
  18. cat << 'EOF' > pre.sh
  19. gmt begin
  20. gmt math -T0/360/1 T -o0 = angles.txt
  21. gmt makecpt -Coleron -T500/4500 -H > main.cpt
  22. gmt grdcut @earth_relief_15s -R-114/-103/35/40 -Gtopo.nc
  23. gmt end
  24. EOF
  25. # 2. Set up the main frame script
  26. cat << 'EOF' > main.sh
  27. gmt begin
  28. width=$(gmt math -Q ${MOVIE_WIDTH} 1.5c SUB =)
  29. gmt grdimage topo.nc -I+a${MOVIE_COL0}+nt2 -JM${width} -Cmain.cpt \
  30. -BWSne -B1 -X1c -Y0.53c --FONT_ANNOT_PRIMARY=9p
  31. gmt inset begin -DjBR+w2.1c/2.4c+o0.2c -F+gwhite+s+p
  32. echo 0.5 0.5 | gmt plot -R0/1/0/1 -JX? -Sc2c -Gwhite -Wthinner -Y-0.15
  33. echo 0.5 0.5 ${MOVIE_COL0} | gmt plot -Sk@azimuth/1.0c -W1.75p -Gred
  34. echo Light Source | gmt text -F+cTC+f9 -Y0.1
  35. gmt end
  36. EOF
  37. # 3. Run the movie
  38. gmt movie main.sh -Chd -Nanim02 -Tangles.txt -Vi -Sbpre.sh -Zs $opt
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...