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

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

Comments

Loading...