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

grdimage_common.rst_ 6.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
  1. |No-spaces|
  2. Description
  3. -----------
  4. **grdimage** reads one 2-D grid file and produces a gray-shaded (or
  5. colored) map by plotting rectangles centered on each grid node and
  6. assigning them a gray-shade (or color) based on the z-value.
  7. Alternatively, **grdimage** reads three 2-D grid files with the red,
  8. green, and blue components directly (all must be in the 0-255 range).
  9. Optionally, illumination may be added by providing a file with
  10. intensities in the (-1,+1) range or instructions to derive intensities
  11. from the input data grid. Values outside this range will be
  12. clipped. Such intensity files can be created from the grid using
  13. :doc:`grdgradient` and, optionally, modified by :doc:`grdmath` or
  14. :doc:`grdhisteq`. A third alternative is available when GMT is build
  15. with GDAL support. Pass *img* which can be an image file (geo-referenced or not).
  16. In this case the images can optionally be illuminated with the
  17. file provided via the **-I** option. Here, if image has no coordinates
  18. then those of the intensity file will be used.
  19. When using map projections, the grid is first resampled on a new
  20. rectangular grid with the same dimensions. Higher resolution images can
  21. be obtained by using the **-E** option. To obtain the resampled value
  22. (and hence shade or color) of each map pixel, its location is inversely
  23. projected back onto the input grid after which a value is interpolated
  24. between the surrounding input grid values. By default bi-cubic
  25. interpolation is used. Aliasing is avoided by also forward projecting
  26. the input grid nodes. If two or more nodes are projected onto the same
  27. pixel, their average will dominate in the calculation of the pixel
  28. value. Interpolation and aliasing is controlled with the **-n** option.
  29. The **-R** option can be used to select a map region larger or smaller
  30. than that implied by the extent of the grid.
  31. Required Arguments
  32. ------------------
  33. *grd_z* \| *img* \| *grd_r grd_g grd_b*
  34. 2-D gridded data set (or red, green, blue grids) or image to be imaged (See
  35. GRID FILE FORMATS below.)
  36. .. _-J:
  37. .. |Add_-J| unicode:: 0x20 .. just an invisible code
  38. .. include:: explain_-J.rst_
  39. Optional Arguments
  40. ------------------
  41. .. _-A:
  42. **-A**\ *out_img*\ [**=**\ *driver*]
  43. Save an image in a raster format instead of PostScript. Use extension .ppm for a Portable
  44. Pixel Map format which is the only raster format GMT can natively write. For GMT installations
  45. configured with GDAL support there are more choices: Append *out_img* to select
  46. the image file name and extension. If the extension is one of .bmp, .gif, .jpg, .png, or .tif
  47. then no driver information is required. For other output formats you must append the required
  48. GDAL driver. The *driver* is the driver code name used by GDAL; see your GDAL installation's
  49. documentation for available drivers. Append a **+c**\ *options* string where *options* is a list of
  50. one or more concatenated number of GDAL **-co** options. For example, to write a GeoPDF with the
  51. TerraGo format use *=PDF+cGEO_ENCODING=OGC_BP*. Notes: (1) If a tiff file (.tif) is selected
  52. then we will write a GeoTiff image if the GMT projection syntax translates into a PROJ syntax,
  53. otherwise a plain tiff file is produced. (2) Any vector elements will be lost.
  54. .. include:: explain_-B.rst_
  55. .. _-C:
  56. .. include:: use_cpt_grd.rst_
  57. .. _-D:
  58. **-D**\ [**r**]
  59. GMT will automatically detect standard image files (Geotiff, TIFF,
  60. JPG, PNG, GIF, etc.) and will read those via GDAL. For very
  61. obscure image formats you may need to explicitly set **-D**, which
  62. specifies that the grid is in fact an image file to be read via
  63. GDAL. Append **r** to assign the region specified by **-R** to the image.
  64. For example, if you have used **-Rd** then the image will be
  65. assigned a global domain. This mode allows you to project a raw image
  66. (an image without referencing coordinates).
  67. .. _-E:
  68. **-E**\ [**i**\|\ *dpi*]
  69. Sets the resolution of the projected grid that will be created if a
  70. map projection other than Linear or Mercator was selected [100]. By
  71. default, the projected grid will be of the same size (rows and
  72. columns) as the input file. Specify **i** to use the PostScript
  73. image operator to interpolate the image at the device resolution.
  74. .. _-G:
  75. **-G**\ *color*\ [**+b**\|\ **f**]
  76. This option only applies when a resulting 1-bit image otherwise would
  77. consist of only two colors: black (0) and white (255). If so, this
  78. option will instead use the image as a transparent mask and paint
  79. the mask with the given *color*. Append **+b** to paint the background
  80. pixels (1) or **+f** for the foreground pixels [Default].
  81. .. _-I:
  82. **-I**\ [*intensfile*\|\ *intensity*\|\ *modifiers*]
  83. Gives the name of a grid file with intensities in the (-1,+1) range,
  84. or a constant intensity to apply everywhere (affects the ambient light).
  85. Alternatively, derive an intensity grid from the input data grid *grd_z*
  86. via a call to :doc:`grdgradient`; append **+a**\ *azimuth*, **+n**\ *args*,
  87. and **+m**\ *ambient* to specify azimuth, intensity, and ambient arguments
  88. for that module, or just give **+d** to select the
  89. default arguments (**+a**\ -45\ **+nt**\ 1\ **+m**\ 0). If you want a more
  90. specific intensity scenario then run :doc:`grdgradient` separately first.
  91. If we should derive intensities from another file than *grd_z*, specify the file
  92. [Default is no illumination].
  93. .. _-M:
  94. **-M**
  95. Force conversion to monochrome image using the (television) YIQ
  96. transformation. Cannot be used with **-Q**.
  97. .. _-N:
  98. **-N**
  99. Do not clip the image at the map boundary (only relevant for
  100. non-rectangular maps).
  101. .. _-Q:
  102. **-Q**
  103. Make grid nodes with z = NaN transparent, using the color-masking
  104. feature in PostScript Level 3 (the PS device must support PS Level 3).
  105. .. _-R:
  106. .. |Add_-R| unicode:: 0x20 .. just an invisible code
  107. .. include:: explain_-R.rst_
  108. .. |Add_-Rz| replace:: You may ask for a larger
  109. *w/e/s/n* region to have more room between the image and the axes. A
  110. smaller region than specified in the grid file will result in a
  111. subset of the grid [Default is the region given by the grid file].
  112. .. include:: explain_-Rz.rst_
  113. .. _-U:
  114. .. include:: explain_-U.rst_
  115. .. _-V:
  116. .. |Add_-V| unicode:: 0x20 .. just an invisible code
  117. .. include:: explain_-V.rst_
  118. .. _-X:
  119. .. include:: explain_-XY.rst_
  120. .. |Add_-f| unicode:: 0x20 .. just an invisible code
  121. .. include:: explain_-f.rst_
  122. .. include:: explain_-n.rst_
  123. .. |Add_perspective| unicode:: 0x20 .. just an invisible code
  124. .. include:: explain_perspective.rst_
  125. .. include:: explain_-t.rst_
  126. .. include:: explain_core.rst_
  127. .. include:: explain_help.rst_
  128. .. include:: explain_grd_inout_short.rst_
  129. .. include:: earth_relief.rst_
Tip!

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

Comments

Loading...