1GRDCUT(1)                    Generic Mapping Tools                   GRDCUT(1)
2
3
4

NAME

6       grdcut - Extract a subregion out of a grid file
7

SYNOPSIS

9       grdcut input_file.grd -Goutput_file.grd -Rwest/east/south/north[r] [ -V
10       ] [ -f[i|o]colinfo ]
11

DESCRIPTION

13       grdcut will produce a new output_file.grd file which is a subregion  of
14       input_file.grd.   The  subregion  is specified with -R as in other pro‐
15       grams; the specified range must not exceed the range of input_file.grd.
16       If in doubt, run grdinfo to check range.  Complementary to grdcut there
17       is grdpaste, which will join together two grid  files  along  a  common
18       edge.
19
20       input_file.grd
21              this is the input .grd format file.
22
23       -Goutput_file.grd
24              this is the output .grd format file.
25
26       -R     xmin,  xmax, ymin, and ymax specify the Region of interest.  For
27              geographic regions,  these  limits  correspond  to  west,  east,
28              south,  and north and you may specify them in decimal degrees or
29              in [+-]dd:mm[:ss.xxx][W|E|S|N] format.  Append r if  lower  left
30              and  upper  right  map coordinates are given instead of w/e/s/n.
31              The two shorthands -Rg and -Rd stand for  global  domain  (0/360
32              and  -180/+180  in longitude respectively, with -90/+90 in lati‐
33              tude).  For calendar time coordinates you may  either  give  (a)
34              relative  time  (relative  to the selected TIME_EPOCH and in the
35              selected TIME_UNIT; append t to -JX|x), or (b) absolute time  of
36              the  form  [date]T[clock]  (append T to -JX|x).  At least one of
37              date and clock must be present; the T is always  required.   The
38              date  string  must  be  of the form [-]yyyy[-mm[-dd]] (Gregorian
39              calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock
40              string  must  be  of the form hh:mm:ss[.xxx].  The use of delim‐
41              iters and their type and positions must be exactly as  indicated
42              (however,  input,  output and plot formats are customizable; see
43              gmtdefaults).  This defines the subregion to be cut out.
44

OPTIONS

46       -V     Selects verbose mode, which will send progress reports to stderr
47              [Default runs "silently"].
48
49       -f     Special  formatting of input and/or output columns (time or geo‐
50              graphical data).  Specify i or o to  make  this  apply  only  to
51              input  or  output  [Default  applies to both].  Give one or more
52              columns (or column ranges) separated by commas.  Append T (abso‐
53              lute  calendar time), t (relative time in chosen TIME_UNIT since
54              TIME_EPOCH), x (longitude), y (latitude), or f (floating  point)
55              to  each  column or column range item.  Shorthand -f[i|o]g means
56              -f[i|o]0x,1y (geographic coordinates).
57

GRID FILE FORMATS

59       By default GMT writes out grid as single precision floats in a  COARDS-
60       complaint  netCDF  file  format.   However, GMT is able to produce grid
61       files in many other commonly used grid file formats  and  also  facili‐
62       tates  so called "packing" of grids, writing out floating point data as
63       2- or 4-byte integers. To specify the precision, scale and offset,  the
64       user should add the suffix =id[/scale/offset[/nan]], where id is a two-
65       letter identifier of the grid type and precision, and scale and  offset
66       are  optional scale factor and offset to be applied to all grid values,
67       and nan is the value used  to  indicate  missing  data.   When  reading
68       grids,  the  format  is generally automatically recognized. If not, the
69       same suffix can be added to input grid file names.  See  grdreformat(1)
70       and  Section  4.17 of the GMT Technical Reference and Cookbook for more
71       information.
72
73       When reading a netCDF file that contains multiple grids, GMT will read,
74       by default, the first 2-dimensional grid that can find in that file. To
75       coax GMT into reading another multi-dimensional variable  in  the  grid
76       file,  append  ?varname  to the file name, where varname is the name of
77       the variable. Note that you may need to escape the special meaning of ?
78       in  your  shell  program  by  putting a backslash in front of it, or by
79       placing the filename and suffix between quotes or double  quotes.   The
80       ?varname suffix can also be used for output grids to specify a variable
81       name different from the default: "z".  See grdreformat(1)  and  Section
82       4.18  of the GMT Technical Reference and Cookbook for more information,
83       particularly on how to read splices of 3-, 4-, or 5-dimensional grids.
84

GEOGRAPHICAL AND TIME COORDINATES

86       When the output grid type is netCDF, the coordinates  will  be  labeled
87       "longitude", "latitude", or "time" based on the attributes of the input
88       data or grid (if any) or on the -f or -R  options.  For  example,  both
89       -f0x  -f1t  and  -R90w/90e/0t/3t  will result in a longitude/time grid.
90       When the x, y, or z coordinate is time, it will be stored in  the  grid
91       as  relative  time since epoch as specified by TIME_UNIT and TIME_EPOCH
92       in the .gmtdefaults file or on the command line.  In addition, the unit
93       attribute of the time variable will indicate both this unit and epoch.
94

EXAMPLES

96       Suppose  you  have  used  surface  to  grid  ship gravity in the region
97       between 148E - 162E and 8N - 32N, and you do  not  trust  the  gridding
98       near  the  edges, so you want to keep only the area between 150E - 160E
99       and 10N - 30N, then:
100
101       grdcut grav_148_162_8_32.grd  -Ggrav_150_160_10_30.grd  -R150/160/10/30
102       -V
103

SEE ALSO

105       grdpaste(1), grdinfo(1), GMT(1)
106
107
108
109GMT 4.3.1                         15 May 2008                        GRDCUT(1)
Impressum