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

NAME

6       grdrotater - Rotate a grid using a finite rotation
7

SYNOPSIS

9       grdrotate  ingrdfile -Goutgrdfile -Tplon/plat/omega [ -Fpolygonfile ] [
10       -H[i][nrec]   ]   [   -N   ]   [    -Q[b|c|l|n][[/]threshold]    ]    [
11       -Rwest/east/south/north[r]   ]   [   -S   ]  [  -V  ]  [  -:[i|o]  ]  [
12       -b[i|o][s|S|d|D[ncol]|c[var1/...]] ] [ -m[flag] ]
13

DESCRIPTION

15       grdrotater reads a geographical grid and reconstructs it given a  total
16       reconstruction  rotation.   Optionally,  the user may supply a clipping
17       polygon in multiple-segment format; then, only the  part  of  the  grid
18       inside  the  polygon  is used to determine the return grid region.  The
19       outline of the projected region is  returned  on  stdout  provided  the
20       rotated region is not the entire globe.
21            No  space  between  the  option flag and the associated arguments.
22       Use upper case for the option flags and lower case for modifiers.
23
24       ingrdfile
25              Name of a grid file in geographical (lon, lat) coordinates.
26
27       -G     Name of output grid.  This is the  grid  with  the  data  recon‐
28              structed according to the specified rotation.
29
30       -T     Finite  rotation.   Specify  the  longitude  and latitude of the
31              rotation pole and the opening angle, all in degrees.
32

OPTIONS

34       -F     Specify a multi-segment closed polygon file that  describes  the
35              inside  area  of  the  grid  that  should  be projected [Default
36              projects entire grid].
37
38       -H     Input file(s) has header record(s).  If used, the default number
39              of  header records is N_HEADER_RECS.  Use -Hi if only input data
40              should have  header  records  [Default  will  write  out  header
41              records  if  the  input  data  have them]. Blank lines and lines
42              starting with # are always skipped.
43
44       -N     Do Not output the rotated polygon outline [Default will write it
45              to stdout].
46
47       -Q     Quick  mode,  use  bilinear  rather  than  bicubic interpolation
48              [Default].  Alternatively,  select  the  interpolation  mode  by
49              adding  b for B-spline smoothing, c for bicubic interpolation, l
50              for bilinear interpolation  or  n  for  nearest-neighbor  value.
51              Optionally, append threshold in the range [0,1].  This parameter
52              controls how close to nodes with NaN  values  the  interpolation
53              will  go.   E.g., a threshold of 0.5 will interpolate about half
54              way from a non-NaN to a NaN node, whereas 0.1 will go about  90%
55              of  the  way,  etc. [Default is 1, which means none of the (4 or
56              16) nearby nodes may be NaN].  -Q0 will just return the value of
57              the  nearest node instead of interpolating.  This is the same as
58              using -Qn.
59
60       -R     west, east, south, and north specify the Region of interest, and
61              you    may    specify    them   in   decimal   degrees   or   in
62              [+-]dd:mm[:ss.xxx][W|E|S|N] format.  Append r if lower left  and
63              upper  right  map coordinates are given instead of w/e/s/n.  The
64              two shorthands -Rg and -Rd stand for global  domain  (0/360  and
65              -180/+180  in longitude respectively, with -90/+90 in latitude).
66              Alternatively, specify the name of an existing grid file and the
67              -R  settings  (and  grid spacing, if applicable) are copied from
68              the grid.
69
70       -S     Skip the rotation of the grid, just rotate the  polygon  outline
71              (requires -F).
72
73       -V     Selects verbose mode, which will send progress reports to stderr
74              [Default runs "silently"].
75
76       -:     Toggles between  (longitude,latitude)  and  (latitude,longitude)
77              input/output.  [Default is (longitude,latitude)].
78
79       -bi    Selects binary input.  Append s for single precision [Default is
80              d  (double)].   Uppercase  S  or  D  will  force  byte-swapping.
81              Optionally,  append  ncol,  the number of columns in your binary
82              input file if it exceeds the columns needed by the program.   Or
83              append  c  if  the  input  file  is  netCDF.  Optionally, append
84              var1/var2/... to specify the variables to be read.  [Default  is
85              2 input columns].
86
87       -bo    Selects  binary  output.  Append s for single precision [Default
88              is d (double)].  Uppercase S  or  D  will  force  byte-swapping.
89              Optionally,  append  ncol, the number of desired columns in your
90              binary output file.  [Default is same as input].
91
92       -m     Multiple segment file(s).  Segments are separated by  a  special
93              record.   For  ASCII  files  the  first  character  must be flag
94              [Default is '>'].  For binary files all fields must be  NaN  and
95              -b must set the number of output columns explicitly.  By default
96              the -m setting applies to both input and output.   Use  -mi  and
97              -mo to give separate settings to input and output.
98

EXAMPLES

100       To  rotate  the  data  defined by grid topo.grd and the polygon outline
101       clip_path.d, using a finite rotation with pole at (135.5, -33.0) and  a
102       rotation angle of 37.3 degrees and bicubic interpolation, try
103
104       grdrotater  topo.grd -T135.5/-33/37.3 -V -Fclip_path.d -Grot_topo.grd >
105       rot_clip_path.d
106
107       To rotate the entire grid faa.grd  using  a  finite  rotation  pole  at
108       (67:45W,  22:35S) and a rotation angle of 19.6 degrees using a bilinear
109       interpolation, try
110
111       grdrotater  faa.grd  -T67:45W/22:35S/19.6   -V   -Q   -Grot_faa.grd   >
112       rot_faa_path.d
113
114       To  just  see how the outline of the grid large.grd will plot after the
115       same rotation, try
116
117       grdrotater large.grd -T67:45W/22:35S/19.6 -V -S |  psxy  -Rg  -JH180/6i
118       -B30 -m -W0.5p | gv -
119
120       Let  say  you  have  rotated  gridA.grd and gridB.grd, restricting each
121       rotation to nodes inside polygons polyA.d  and  polyB.d,  respectively,
122       using rotation A = (123W,22S,16,4) and rotation B = (108W, 16S, -14.5),
123       yielding rotated grids rot_gridA.grd and rot_gridB.grd.   To  determine
124       the region of overlap between the rotated grids, we use grdmath:
125
126       grdmath  1  rot_gridA.grd  ISNAN  SUB  1 rot_gridB.grd ISNAN SUB 2 EQ =
127       overlap.grd
128
129       The grid overlap.grd now has 1s in the regions of overlap and  0  else‐
130       where.  You can use it as a mask or use grdcontour to extract a polygon
131       (contour).
132

COORDINATES

134       Data coordinates are assumed to be geodetic and will  automatically  be
135       converted  to  geocentric before spherical rotations are performed.  We
136       convert back to geodetic coordinates for output.  Note:  If  your  data
137       already  are geocentric, you can avoid the conversion by using --ELLIP‐
138       SOID=sphere.
139

SEE ALSO

141       backtracker(1),  grdspotter(1),  hotspotter(1),  originator(1)  rotcon‐
142       verter(1)
143
144
145
146GMT 4.5.6                         10 Mar 2011                    GRDROTATER(1)
Impressum