File: grdedit.1

package info (click to toggle)
gmt 4.5.12-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 71,528 kB
  • ctags: 12,619
  • sloc: ansic: 138,042; sh: 4,992; csh: 1,085; makefile: 1,034; asm: 38
file content (150 lines) | stat: -rw-r--r-- 9,109 bytes parent folder | download
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
.TH GRDEDIT 1 "Feb 27 2014" "GMT 4.5.13 (SVN)" "Generic Mapping Tools"
.SH NAME
grdedit \- Modifying the header or content of a 2-D grid file
.SH SYNOPSIS
\fBgrdedit\fP \fIgrdfile\fP [ \fB\-A\fP ] [ \fB\-D\fP\fIxname\fP/\fIyname\fP/\fIzname\fP/\fIscale\fP/\fIoffset\fP/\fItitle\fP/\fIremark\fP ] [ \fB\-E\fP ] 
[ \fB\-N\fP\fIxyzfile\fP ] [ \fB\-R\fP\fIwest\fP/\fIeast\fP/\fIsouth\fP/\fInorth\fP[\fBr\fP] ] [ \fB\-S\fP ] [ \fB\-T\fP ] [ \fB\-V\fP ] 
[ \fB\-:\fP[\fBi\fP|\fBo\fP] ] [ \fB\-bi\fP[\fBs\fP|\fBS\fP|\fBd\fP|\fBD\fP[\fIncol\fP]|\fBc\fP[\fIvar1\fP\fB/\fP\fI...\fP]] ] [ \fB\-f\fP[\fBi\fP|\fBo\fP]\fIcolinfo\fP ]
.SH DESCRIPTION
\fBgrdedit\fP reads the header information in a binary 2-D grid file and replaces
the information with values provided on the command line [if any].  As an option,
global, geographical grids (with 360 degrees longitude range) can be rotated in
the east-west direction, and individual nodal values can be replaced from a
table of \fIx, y, z\fP values.  \fBgrdedit\fP only operates on files containing a grdheader.
.TP
\fIgrdfile\fP
Name of the 2-D grid file to modify.
(See GRID FILE FORMATS below).
.SH OPTIONS
No space between the option flag and the associated arguments.
.TP
\fB\-A\fP
If necessary, adjust the file's \fIx_inc, y_inc\fP to be compatible with\"'
its domain (or a new domain set with \fB\-R\fP).  Older grid files (i.e., created
prior to \fBGMT\fP 3.1) often had excessive slop in
\fIx_inc, y_inc\fP and an adjustment is necessary.  Newer files are created correctly.
.TP
\fB\-D\fP
Give new values for \fIxname, yname, zname, scale, offset, title,\fP and \fIremark\fP.
To leave some of the values untouched, specify = as the new value.
Alternatively, to allow "/" to be part of one of the values, use any non-alphanumeric
character (and not the equal sign) as separator by both starting and ending with it. For example:
\fB\-D\fP:\fIxname\fP:\fIyname\fP:\fIzname\fP:\fIscale\fP:\fIoffset\fP:\fItitle\fP:\fIremark\fP:
.TP
\fB\-E\fP
Transpose the grid and exchange the \fIx\fP and \fIy\fP information.  Incompatible with the other options.
.TP
\fB\-H\fP
Input file(s) has header record(s).  If used, the default number of header records is \fBN_HEADER_RECS\fP.
Use \fB\-Hi\fP if only input data should have header records [Default will write out header records if the
input data have them]. Blank lines and lines starting with # are always skipped.
.TP
\fB\-N\fP
Read the ASCII (or binary; see \fB\-bi\fP) file \fIxyzfile\fP and replace the corresponding
nodal values in the grid with these \fIz\fP values.
.TP
\fB\-R\fP
\fIxmin\fP, \fIxmax\fP, \fIymin\fP, and \fIymax\fP specify the Region of interest.  For geographic
regions, these limits correspond to \fIwest, east, south,\fP and \fInorth\fP and you may specify them
in decimal degrees or in [+-]dd:mm[:ss.xxx][W|E|S|N] format.  Append \fBr\fP if lower left and upper right
map coordinates are given instead of w/e/s/n.  The two shorthands \fB\-Rg\fP and \fB\-Rd\fP stand for global domain
(0/360 and -180/+180 in longitude respectively, with -90/+90 in latitude).  Alternatively, specify the name
of an existing grid file and the \fB\-R\fP settings (and grid spacing, if applicable) are copied from the grid.
For calendar time coordinates you may either give (a) relative
time (relative to the selected \fBTIME_EPOCH\fP and in the selected \fBTIME_UNIT\fP; append \fBt\fP to
\fB\-JX\fP|\fBx\fP), or (b) absolute time of the form [\fIdate\fP]\fBT\fP[\fIclock\fP]
(append \fBT\fP to \fB\-JX\fP|\fBx\fP).  At least one of \fIdate\fP and \fIclock\fP
must be present; the \fBT\fP is always required.  The \fIdate\fP string must be of the form [-]yyyy[-mm[-dd]]
(Gregorian calendar) or yyyy[-Www[-d]] (ISO week calendar), while the \fIclock\fP string must be of
the form hh:mm:ss[.xxx].  The use of delimiters and their type and positions must be exactly as indicated
(however, input, output and plot formats are customizable; see \fBgmtdefaults\fP). 
The new w/e/s/n values will replace those in the grid, and the \fIx_inc, y_inc\fP
values are adjusted, if necessary.
.TP
\fB\-S\fP
For global, geographical grids only.  Grid values will be shifted longitudinally according to
the new borders given in \fB\-R\fP.
.TP
\fB\-T\fP
Make necessary changes in the header to convert a gridline-registered grid to a pixel-registered
grid, or vice-versa.  Basically, gridline-registered grids will have their domain extended by
half the x- and y-increments whereas pixel-registered grids will have their domain shrunk by
the same amount.
.TP
\fB\-V\fP
Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
.TP
\fB\-bi\fP
Selects binary input.
Append \fBs\fP for single precision [Default is \fBd\fP (double)].
Uppercase \fBS\fP or \fBD\fP will force byte-swapping.
Optionally, append \fIncol\fP, the number of columns in your binary input file
if it exceeds the columns needed by the program.
Or append \fBc\fP if the input file is netCDF. Optionally, append \fIvar1\fP\fB/\fP\fIvar2\fP\fB/\fP\fI...\fP to
specify the variables to be read.
[Default is 3 input columns].
.TP
\fB\-f\fP
Special formatting of input and/or output columns (time or geographical data).
Specify \fBi\fP or \fBo\fP to make this apply only to input or output [Default applies to both].
Give one or more columns (or column ranges) separated by commas.
Append \fBT\fP (absolute calendar time), \fBt\fP (relative time in chosen \fBTIME_UNIT\fP since \fBTIME_EPOCH\fP),
\fBx\fP (longitude), \fBy\fP (latitude), or \fBf\fP (floating point) to each column
or column range item.  Shorthand \fB\-f\fP[\fBi\fP|\fBo\fP]\fBg\fP means \fB\-f\fP[\fBi\fP|\fBo\fP]0\fBx\fP,1\fBy\fP
(geographic coordinates).
.SH GRID FILE FORMATS
By default \fBGMT\fP writes out grid as single precision floats in a COARDS-complaint netCDF file format.
However, \fBGMT\fP is able to produce grid files in many other commonly used grid file formats and also facilitates so called "packing" of grids,
writing out floating point data as 2- or 4-byte integers. To specify the precision, scale and offset, the user should add the suffix
\fB=\fP\fIid\fP[\fB/\fP\fIscale\fP\fB/\fP\fIoffset\fP[\fB/\fP\fInan\fP]], where \fIid\fP is a two-letter identifier of the grid type and precision, and \fIscale\fP and \fIoffset\fP are optional scale factor
and offset to be applied to all grid values, and \fInan\fP is the value used to indicate missing data.
When reading grids, the format is generally automatically recognized. If not, the same suffix can be added to input grid file names.
See \fBgrdreformat\fP(1) and Section 4.17 of the GMT Technical Reference and Cookbook for more information.
.P
When reading a netCDF file that contains multiple grids, \fBGMT\fP will read, by default, the first 2-dimensional grid that can find in that
file. To coax \fBGMT\fP into reading another multi-dimensional variable in the grid file, append \fB?\fP\fIvarname\fP to the file name, where
\fIvarname\fP is the name of the variable. Note that you may need to escape the special meaning of \fB?\fP in your shell program
by putting a backslash in front of it, or by placing the filename and suffix between quotes or double quotes.
The \fB?\fP\fIvarname\fP suffix can also be used for output grids to specify a variable name different from the default: "z".
See \fBgrdreformat\fP(1) and Section 4.18 of the GMT Technical Reference and Cookbook for more information,
particularly on how to read splices of 3-, 4-, or 5-dimensional grids.
.SH GEOGRAPHICAL AND TIME COORDINATES
When the output grid type is netCDF, the coordinates will be labeled "longitude", "latitude", or "time" based on the
attributes of the input data or grid (if any) or on the
\fB\-f\fP or \fB\-R\fP options. For example, both \fB\-f0x\fP \fB\-f1t\fP and \fB\-R\fP 90w/90e/0t/3t will result in a longitude/time
grid. When the x, y, or z coordinate is time, it will be stored in the grid as relative time since epoch as 
specified by \fBTIME_UNIT\fP and \fBTIME_EPOCH\fP in the \.gmtdefaults file or on the command line.
In addition, the \fBunit\fP attribute of the time variable will indicate both this unit and epoch.
.SH EXAMPLES
Let us assume the file data.grd covers the area 300/310/10/30.  We want
to change the boundaries from geodetic longitudes to geographic and put a new title in
the header.  We accomplish this by
.br
.sp
\fBgrdedit\fP data.grd \fB\-R\fP-60/-50/10/30 \fB\-D\fP=/=/=/=/=/"Gravity Anomalies"/=
.br
.sp
The grid world.grd has the limits 0/360/-72/72.  To shift the
data so that the limits would be -180/180/-72/72, use
.br
.sp
\fBgrdedit\fP world.grd \fB\-R\fP-180/180/-72/72 \fB\-S\fP
.br
.sp
The file junk.grd was created prior to \fBGMT\fP 3.1 with incompatible
\fB\-R\fP and \fB\-I\fP arguments.  To reset the x- and y-increments
we run
.br
.sp
\fBgrdedit\fP junk.grd \fB\-A\fP
.br
.sp
The file junk.grd was created prior to \fBGMT\fP 4.1.3 and does not contain the required
information to indicate that the grid is geographic.  To add this information, run
.br
.sp
\fBgrdedit\fP junk.grd \fB\-fg\fP
.SH "SEE ALSO"
.IR GMT (1),
.IR grd2xyz (1),
.IR xyz2grd (1)