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

fake_geot_cube.sh 1.1 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
  1. #!/usr/bin/env bash
  2. # Create 8 layers of geographic data with abs time z, faking it
  3. # The original PS was made with the commented out lines so that we
  4. # can be sure the stacking into a cube and pulling out layers work
  5. gmt begin fake_geot_cube ps
  6. gmt set MAP_FRAME_TYPE plain PROJ_ELLIPSOID sphere TIME_UNIT d FORMAT_CLOCK_MAP=- FONT_TAG=12p
  7. gmt math -T2020-01-01T/2020-01-08T/1 -o0 --FORMAT_CLOCK_OUT=hh T = t.txt
  8. while read t; do
  9. z=$(gmt math -Q -fi0T -fo0t $t 2020-01-01T SUB 1 ADD =)
  10. gmt grdmath -R-10/10/-10/10 -I1d 0 0 SDIST KM2DEG $z 0.25 MUL HYPOT $z DIV 4 POW -0.5 MUL EXP 5 MUL 8 $z SUB ADD = tmp_$z.grd
  11. done < t.txt
  12. gmt grdinterpolate -Zt.txt tmp_?.grd -Gfake_geot_cube.nc
  13. gmt makecpt -T0/12
  14. gmt subplot begin 4x2 -Fs5c -Scb -Srl -Blrbt -A1+gwhite -X5c -Y4c -M1c/0.25c -R-10/10/-10/10 -JM5c
  15. while read t; do
  16. z=$(gmt math -Q -fi0T -fo0t $t =)
  17. n=$(gmt math -Q -fi0T -fo0t $t 2020-01-01T SUB 1 ADD =)
  18. gmt subplot set -A$t
  19. #gmt grdimage "tmp_${n}.grd"
  20. gmt grdimage "fake_geot_cube.nc?(${z})"
  21. done < t.txt
  22. gmt subplot end
  23. gmt colorbar -DJBC -B
  24. gmt end show
  25. #rm -f tmp_?.grd
Tip!

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

Comments

Loading...