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_geoz_cube.sh 879 B

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
  1. #!/usr/bin/env bash
  2. # Create 8 layers of geographic data with Cartesian 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_geoz_cube ps
  6. gmt set MAP_FRAME_TYPE plain PROJ_ELLIPSOID sphere
  7. gmt math -T1/8/1 -o0 --FORMAT_FLOAT_OUT=%01.0f T = z.txt
  8. while read z; do
  9. 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
  10. done < z.txt
  11. gmt grdinterpolate -Zz.txt tmp_?.grd -Gfake_geoz_cube.nc
  12. gmt makecpt -T0/12
  13. gmt subplot begin 4x2 -Fs5c -Scb -Srl -Blrbt -A1+gwhite -X5c -Y4c -M1c/0.25c -R-10/10/-10/10 -JM5c
  14. for z in $(seq 1 8); do
  15. #gmt grdimage "tmp_${z}.grd" -c
  16. gmt grdimage "fake_geoz_cube.nc?(${z})" -c
  17. done
  18. gmt subplot end
  19. gmt colorbar -DJBC -B
  20. gmt end show
  21. #rm -f tmp_?.grd
Tip!

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

Comments

Loading...