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

grdclip.rst 2.6 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
  1. .. index:: ! grdclip
  2. .. include:: module_core_purpose.rst_
  3. *******
  4. grdclip
  5. *******
  6. |grdclip_purpose|
  7. Synopsis
  8. --------
  9. .. include:: common_SYN_OPTs.rst_
  10. **gmt grdclip** *ingrid* |-G|\ *outgrid*
  11. [ |SYN_OPT-R| ]
  12. [ |-S|\ **a**\ *high/above* ]
  13. [ |-S|\ **b**\ *low/below* ] [ |-S|\ **i**\ *low/high/between* ] [ |-S|\ **r**\ *old/new* ]
  14. [ |SYN_OPT-V| ]
  15. [ |SYN_OPT--| ]
  16. |No-spaces|
  17. Description
  18. -----------
  19. **grdclip** will set values < *low* to *below* and/or values > *high* to
  20. *above*. You can also specify one or more intervals where all values should be
  21. set to *between*, or replace individual values. Such operations are useful
  22. when you want all of a continent or an ocean to fall
  23. into one color or gray shade in image processing, when clipping of the
  24. range of data values is required, or for reclassification of data values.
  25. *above*, *below*, *between*, *old* and *new* can be any number or even NaN
  26. (Not a Number). You must choose at least one of the **-S** options. Use
  27. **-R** to only extract a subset of the *ingrid* file.
  28. Required Arguments
  29. ------------------
  30. *ingrid*
  31. The input 2-D binary grid file.
  32. .. _-G:
  33. **-G**\ *outgrid*
  34. *outgrid* is the modified output grid file.
  35. Optional Arguments
  36. ------------------
  37. .. _-R:
  38. .. |Add_-R| replace:: Using the **-R** option
  39. will select a subsection of *ingrid* grid. If this subsection
  40. exceeds the boundaries of the grid, only the common region will be extracted.
  41. .. include:: explain_-R.rst_
  42. .. _-S:
  43. **-Sa**\ *high/above*
  44. Set all data[i] > *high* to *above*.
  45. **-Sb**\ *low/below*
  46. Set all data[i] < *low* to *below*.
  47. **-Si**\ *low/high/between*
  48. Set all data[i] >= *low* and <= *high* to *between*.
  49. Repeat the option for as many intervals as are needed.
  50. **-Sr**\ *old/new*
  51. Set all data[i] == *old* to *new*. This is mostly useful when
  52. your data are known to be integer values. Repeat the option
  53. for as many replacements as are needed.
  54. .. _-V:
  55. .. |Add_-V| unicode:: 0x20 .. just an invisible code
  56. .. include:: explain_-V.rst_
  57. .. include:: explain_help.rst_
  58. .. include:: explain_grd_inout_short.rst_
  59. Examples
  60. --------
  61. .. include:: explain_example.rst_
  62. To set all values > 0 to NaN and all values < 0 to 0 in the remote file AFR.nc:
  63. ::
  64. gmt grdclip @AFR.nc -Gnew_AFR.nc -Sa0/NaN -Sb0/0 -V
  65. To reclassify all values in the 25-30 range to 99, those in 35-39 to 55,
  66. exchange 17 for 11 and all values < 10 to 0 in file classes.nc, try
  67. ::
  68. gmt grdclip classes.nc -Gnew_classes.nc -Si25/30/99 -Si35/39/55 -Sr17/11 -Sb10/0 -V
  69. See Also
  70. --------
  71. :doc:`gmt`,
  72. :doc:`grdfill`,
  73. :doc:`grdlandmask`,
  74. :doc:`grdmask`, :doc:`grdmath`,
  75. :doc:`grd2xyz`, :doc:`xyz2grd`
Tip!

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

Comments

Loading...