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_xyz_cube.sh 776 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
  1. #!/usr/bin/env bash
  2. # Create 8 layers of Cartesian data, 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_xyz_cube ps
  6. gmt math -T1/8/1 -o0 --FORMAT_FLOAT_OUT=%01.0f T = z.txt
  7. while read z; do
  8. gmt grdmath -R-10/10/-10/10 -I1 0 0 CDIST $z 0.25 MUL HYPOT $z DIV 4 POW -0.5 MUL EXP 5 MUL 8 $z SUB ADD = tmp_$z.grd
  9. done < z.txt
  10. gmt grdinterpolate -Zz.txt tmp_?.grd -Gfake_xyz_cube.nc
  11. gmt makecpt -T0/12
  12. gmt subplot begin 4x2 -Fs5c -Scb -Srl -Blrbt -A1+gwhite -X5c -Y4c -M1c/0.25c
  13. for z in $(seq 1 8); do
  14. #gmt grdimage "tmp_${z}.grd" -c
  15. gmt grdimage "fake_xyz_cube.nc?(${z})" -c
  16. done
  17. gmt subplot end
  18. gmt colorbar -DJBC -B
  19. gmt end show
  20. #rm -f tmp_?.grd
Tip!

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

Comments

Loading...