1GRDCUT(1)                             GMT                            GRDCUT(1)
2
3
4

NAME

6       grdcut - Extract subregion from a grid
7

SYNOPSIS

9       grdcut ingrid  -Goutgrid
10        -Rregion [  -N[nodata] ] [  -S[n]lon/lat/radius[unit] ] [  -V[level] ]
11       [  -Z[n|r]min/max ] [ -fflags ]
12
13       Note: No space is allowed between the option flag  and  the  associated
14       arguments.
15

DESCRIPTION

17       grdcut  will produce a new outgrid file which is a subregion of ingrid.
18       The subregion is specified with -R as in other programs; the  specified
19       range  must  not exceed the range of ingrid (but see -N).  If in doubt,
20       run grdinfo to check range. Alternatively, define the  subregion  indi‐
21       rectly  via  a  range  check on the node values or via distances from a
22       given point. Complementary to grdcut there is grdpaste, which will join
23       together two grid files along a common edge.
24

REQUIRED ARGUMENTS

26       ingrid This is the input grid file.
27
28       -Goutgrid
29              This is the output grid file.
30

OPTIONAL ARGUMENTS

32       -N[nodata]
33              Allow grid to be extended if new -R exceeds existing boundaries.
34              Append nodata value to initialize nodes outside  current  region
35              [Default is NaN].
36
37       -Rxmin/xmax/ymin/ymax[+r][+uunit] (more ...)
38              Specify the region of interest. This defines the subregion to be
39              cut out.
40
41       -S[n]lon/lat/radius[unit]
42              Specify an origin and radius; append a distance unit (see UNITS)
43              and  we  determine  the corresponding rectangular region so that
44              all grid nodes on or inside the circle are contained in the sub‐
45              set. If -Sn is used we set all nodes outside the circle to NaN.
46
47       -V[level] (more ...)
48              Select verbosity level [c].
49
50       -Z[n|r]min/max
51              Determine  the  new rectangular region so that all nodes outside
52              this region are also outside the given z-range  [-inf/+inf].  To
53              indicate no limit on min or max, specify a hyphen (-). Normally,
54              any NaNs encountered are simply skipped and  not  considered  in
55              the  decision.   Use  -Zn  to  consider  a NaN to be outside the
56              z-range. This means the new subset will  be  NaN-free.  Alterna‐
57              tively, use -Zr to consider NaNs to be within the data range. In
58              this case we stop shrinking the boundaries once a NaN  is  found
59              [Default simply skips NaNs when making the range decision].
60
61       -f[i|o]colinfo (more ...)
62              Specify data types of input and/or output columns.
63
64       -^ or just -
65              Print  a  short  message  about  the syntax of the command, then
66              exits (NOTE: on Windows just use -).
67
68       -+ or just +
69              Print an extensive usage (help) message, including the  explana‐
70              tion  of  any  module-specific  option  (but  not the GMT common
71              options), then exits.
72
73       -? or no arguments
74              Print a complete usage (help) message, including the explanation
75              of all options, then exits.
76

UNITS

78       For  map distance unit, append unit d for arc degree, m for arc minute,
79       and s for arc second, or e for meter [Default], f for foot, k for km, M
80       for  statute  mile,  n  for nautical mile, and u for US survey foot. By
81       default we compute such distances using a spherical approximation  with
82       great  circles.  Prepend - to a distance (or the unit is no distance is
83       given) to perform "Flat Earth" calculations (quicker but less accurate)
84       or  prepend  +  to perform exact geodesic calculations (slower but more
85       accurate).
86

GRID FILE FORMATS

88       By default GMT  writes  out  grid  as  single  precision  floats  in  a
89       COARDS-complaint  netCDF  file  format. However, GMT is able to produce
90       grid files in many other commonly  used  grid  file  formats  and  also
91       facilitates  so  called  "packing" of grids, writing out floating point
92       data as 1- or 2-byte integers. (more ...)
93

GEOGRAPHICAL AND TIME COORDINATES

95       When the output grid type is netCDF, the coordinates  will  be  labeled
96       "longitude", "latitude", or "time" based on the attributes of the input
97       data or grid (if any) or on the -f or -R  options.  For  example,  both
98       -f0x  -f1t  and  -R90w/90e/0t/3t  will result in a longitude/time grid.
99       When the x, y, or z coordinate is time, it will be stored in  the  grid
100       as  relative  time since epoch as specified by TIME_UNIT and TIME_EPOCH
101       in the gmt.conf file or on the command  line.  In  addition,  the  unit
102       attribute of the time variable will indicate both this unit and epoch.
103

EXAMPLES

105       Suppose  you  have  used  surface  to  grid  ship gravity in the region
106       between 148E - 162E and 8N - 32N, and you do  not  trust  the  gridding
107       near  the  edges, so you want to keep only the area between 150E - 160E
108       and 10N - 30N, then:
109
110              gmt grdcut grav_148_162_8_32.nc -Ggrav_150_160_10_30.nc -R150/160/10/30 -V
111
112       To return the subregion of a grid such that any boundary  strips  where
113       all values are entirely above 0 are excluded, try
114
115              gmt grdcut bathy.nc -Gtrimmed_bathy.nc -Z-/0 -V
116
117       To return the subregion of a grid that contains all nodes within a dis‐
118       tance of 500 km from the point 45,30 try
119
120              gmt grdcut bathy.nc -Gsubset_bathy.nc -S45/30/500k -V
121

SEE ALSO

123       gmt, grdclip, grdinfo, grdpaste, surface
124
126       2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
127
128
129
130
1315.4.5                            Feb 24, 2019                        GRDCUT(1)
Impressum