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

GMT_chunking.sh 855 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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  1. #!/usr/bin/env bash
  2. #
  3. # Make an illustration of grid chunking
  4. #
  5. gmt begin GMT_chunking
  6. gmt set MAP_FRAME_PEN thick FONT_ANNOT_PRIMARY 9p
  7. n=1 # current cell number
  8. for ((x=0;x<12;++x)); do
  9. # x: number of chunk
  10. for ((j=2;j>=0;--j)); do
  11. # j: y-coordinate in each chunk
  12. for ((i=0;i<3;++i)); do
  13. # i: x-coordinate in each chunk
  14. echo "$i $j $((n++))"
  15. done
  16. done > chunk.tmp
  17. # plot chunks
  18. if [ $x -eq 0 ]; then
  19. # first chunk
  20. gmt text chunk.tmp -R-0.5/2.5/-0.5/2.5 -Bg1+0.5 -JX2c/0 -Y10c
  21. elif [ $x -eq 4 -o $x -eq 8 ]; then
  22. # new chunk row
  23. gmt text chunk.tmp -B+glightblue -Bg1+0.5 -X-6.3c -Y-2.1c
  24. elif [ $x -eq 5 -o $x -eq 9 -o $x -eq 10 ]; then
  25. # colored chunks
  26. gmt text chunk.tmp -B+glightblue -Bg1+0.5 -X2.1c
  27. else
  28. gmt text chunk.tmp -Bg1+0.5 -X2.1c
  29. fi
  30. done
  31. rm -f chunk.tmp
  32. gmt end show
Tip!

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

Comments

Loading...