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

anim08.sh 2.8 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  1. #!/usr/bin/env bash
  2. #
  3. # Animation of all simplicity in the Pacific basin during 2018 that exceeded
  4. # a threshold of magnitude 5. We then plot the earthquakes as they occurred on
  5. # a map that moves in longitude from west to east, with a deliberate pause near
  6. # Longitude 200 so we can watch the near-daily magnitude 5.2 quakes that hit the
  7. # Big Island of Hawaii during the 3-month 2018 eruption. We scale magnitude to
  8. # symbol size (spherical circle diameter in km) and announce each quake by magnifying
  9. # size and whitening the color for a little bit. Later the symbols fade to darker
  10. # color and smaller sizes but remain for the duration of the movie.
  11. # DEM: @earth_relief_02m
  12. # Line: ridge.txt
  13. # The resulting movie was presented at the Fall 2019 AGU meeting in an eLighting talk:
  14. # P. Wessel, 2019, GMT science animations for the masses, Abstract IN21B-11.
  15. # The finished movie is available in our YouTube channel as well:
  16. # https://youtu.be/H0RyjHRhJ3g
  17. # The movie took ~1 hour to render on a 24-core MacPro 2013.
  18. # 1. Extract 2018 data >= Mag 5 from URL and prepare inputs and frame times
  19. cat << 'EOF' > pre.sh
  20. SITE="https://earthquake.usgs.gov/fdsnws/event/1/query.csv"
  21. TIME="starttime=2018-01-01%2000:00:00&endtime=2018-12-31%2000:00:00"
  22. MAG="minmagnitude=5"
  23. ORDER="orderby=time-asc"
  24. URL="${SITE}?${TIME}&${MAG}&${ORDER}"
  25. gmt begin
  26. # Get seismicity and scale magnitude by 50 to give symbol size in km
  27. gmt convert $URL -i2,1,3,4+s50,0 -hi1 > q.txt
  28. # Create standard seismicity cpt
  29. gmt makecpt -Cred,green,blue -T0,70,300,10000 -H > q.cpt
  30. # Make lons go from 160 to 240 with a pause at 200 mid movie
  31. cat <<- EOF | gmt sample1d -fT --TIME_UNIT=d -I1 -Fa > times.txt
  32. 2018-01-01T 160
  33. 2018-05-01T 200
  34. 2018-06-01T 200
  35. 2018-07-01T 200
  36. 2018-08-01T 200
  37. 2018-12-31T 240
  38. EOF
  39. # Get gradients of the relief from N45E
  40. gmt grdgradient @earth_relief_02m -Nt1.2 -A45 -Gintens.nc
  41. gmt makecpt -Cterra -T-10000/8000 -H > t.cpt
  42. gmt end
  43. EOF
  44. # 2. Set up main script
  45. cat << 'EOF' > main.sh
  46. gmt begin
  47. # Let HSV minimum value go to zero
  48. gmt set COLOR_HSV_MIN_V 0
  49. # Fake simulation of sun illumination from east combined with relief slopes
  50. gmt grdmath intens.nc X ${MOVIE_COL1} SUB DUP -180 LE 360 MUL ADD 90 DIV ERF ADD 0.5 SUB = s.nc
  51. # Overlay relief over land only using dem cpt
  52. gmt grdimage @earth_relief_02m -Is.nc -Ct.cpt -JG${MOVIE_COL1}/5/18c -X0 -Y0
  53. # Plot the mid-ocean ridge line
  54. gmt plot @ridge.txt -W0.5p,darkyellow
  55. # Plot seismicity at this time according to visibility and enhancement settings
  56. gmt events q.txt -SE- -Cq.cpt --TIME_UNIT=d -T${MOVIE_COL0} -Es+r2+d6 -Ms5+c0.5 -Mi1+c-0.6 -Mt+c0
  57. gmt end
  58. EOF
  59. # 3. Run the movie at 24 frames/sec at 60 dpc to give 1080x1080 size, each frame represent one day
  60. gmt movie main.sh -Sbpre.sh -C18cx18cx60 -Ttimes.txt -Nanim08 -H8 -Lc0 -M150,png -Fmp4 -G30 -V -W -Zs \
  61. --FONT_TAG=20p,Helvetica,white --FORMAT_CLOCK_MAP=-
Tip!

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

Comments

Loading...