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

anim11.sh 2.0 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
  1. #!/usr/bin/env bash
  2. #
  3. # Blending the NASA day and night views from the Blue and Black Marble mosaic
  4. # images using a day-night mask set for the summer solstice midnight in Hawaii
  5. # on June 20, 2020. In addition, we adjust the colors using the intensities derived
  6. # from the slopes of the earth relief grid. We spin around at 24 frames per second
  7. # where each frame advances the viewpoint 0.25 degrees of longitude.
  8. #
  9. # DEM: @earth_relief_02m
  10. # Images: @earth_day_02m @earth_night_02m from the GMT data server
  11. #
  12. # The finished movie is available in our YouTube channel as well:
  13. # https://youtu.be/nmxy9yb2cR8
  14. # The movie took ~2.75 hour to render on a 24-core MacPro 2013.
  15. # 1. Create background plot and data files needed in the loop
  16. cat << 'EOF' > pre.sh
  17. gmt begin
  18. # Set view longitudes 0-360 with steps of 0.25 degree
  19. gmt math -T-180/180/0.25 -o0 T = view.txt
  20. # Make global grid with a smooth 2-degree day/night transition for the 2020 solstice.
  21. gmt grdmath -Rd -I2m -rp $(gmt solar -C -o0:1 -I+d2020-06-20+z-10) 2 DAYNIGHT = daynight.grd
  22. # We will create an intensity grid based on a DEM so that we can see structures in the oceans
  23. gmt grdgradient @earth_relief_02m -Nt0.75 -A45 -Gintens.grd
  24. # Make sure our remote files have been downloaded
  25. gmt which -Ga @earth_day_02m @earth_night_02m
  26. gmt end
  27. EOF
  28. # 2. Set up main script
  29. cat << 'EOF' > main.sh
  30. gmt begin
  31. # Let HSV minimum value go to zero and faint map border
  32. gmt set COLOR_HSV_MIN_V 0 MAP_FRAME_PEN=faint
  33. # Blend the day and night Earth images using the weights, so that when w is 1
  34. # we get the daytime view, and then adjust colors based on the intensity.
  35. gmt grdmix @earth_day_02m @earth_night_02m -Wdaynight.grd -Iintens.grd -Gview.tif
  36. # Plot this image on an Earth with view from current longitude
  37. gmt grdimage view.tif -JG${MOVIE_COL0}/30N/21.6c -Bafg -X0 -Y0
  38. gmt end
  39. EOF
  40. # 3. Run the movie, requesting a fade in/out via white
  41. gmt movie main.sh -Sbpre.sh -C21.6cx21.6cx50 -Tview.txt -Nanim11 -Lf -Ls"Midnight in Hawaii"+jBR -H8 -Pb+w1c -Fmp4 -V -W -Zs
Tip!

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

Comments

Loading...