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

anim03.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
  1. #!/usr/bin/env bash
  2. # GMT ANIMATION 03
  3. #
  4. # Purpose: Make simple animated MP4 of Iceland topo from different viewpoints
  5. # GMT modules: basemap, grdclip, grdcut, grdgradient, makecpt, math, grdview, movie
  6. # Unix progs: echo, cat
  7. # Note: Run with any argument to build movie; otherwise 27th frame is plotted only.
  8. #
  9. # The finished movie is available in our YouTube channel as well:
  10. # https://youtu.be/zCo0fuMkvMY
  11. # The movie took just 2 minutes to render on a 24-core MacPro 2013.
  12. if [ $# -eq 0 ]; then # Just make master PostScript frame 27 (az = 206)
  13. opt="-M27,ps"
  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 -T180/540/1 T 30 SUB = angles.txt
  21. gmt makecpt -Coleron -T-2000/2000/20 -H > iceland.cpt
  22. gmt grdcut @earth_relief_15s -R-26/-12/63/67 -Giceland.nc
  23. gmt grdclip iceland.nc -Gabove.nc -Sb0/NAN -Sr0/NAN
  24. gmt grdclip iceland.nc -Gbelow.nc -Sa0/NAN
  25. gmt end
  26. EOF
  27. # 2. Set up the main frame script
  28. cat << 'EOF' > main.sh
  29. gmt begin
  30. gmt grdgradient iceland.nc -Nt1 -Gintens.nc -A-${MOVIE_COL1}
  31. gmt grdview below.nc -Rbelow.nc -Ciceland.cpt -Qc${MOVIE_DPU} -Iintens.nc -JM19c -p-${MOVIE_COL0}/35+v4.5c/1.7c -X7.6c -Y5c
  32. gmt grdview above.nc -Rabove.nc -Ciceland.cpt -Qc${MOVIE_DPU} -Iintens.nc -JZ0.4c -p
  33. gmt basemap -Bf -Tdn0.06/0.8+w1.75c+f+l,,,N -p
  34. gmt end
  35. EOF
  36. # 3. Run the movie
  37. gmt movie main.sh -Chd -Nanim03 -Tangles.txt -Sbpre.sh -Vi -Pb -Zs $opt
Tip!

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

Comments

Loading...