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

NAME

6       img2grd - Extract region of img in Mercator or geographic form
7

SYNOPSIS

9       img2grd  imgfile  -Ggrdfile -Rwest/east/south/north[r] -Ttype  [ -C ] [
10       -Dminlat/maxlat ] [ -E ] [ -L ] [ -M ] [ -Nnavg ] [ -Sscale ] [ -V ]  [
11       -Wmaxlon ] [ -mminutes ]
12

DESCRIPTION

14       img2grd  is  a  front-end to img2mercgrd which reads an img format file
15       and creates a grid file.  The -M option dictates  whether  or  not  the
16       Spherical Mercator projection of the img file is preserved.
17
18       imgfile
19              An img format file such as the marine gravity or seafloor topog‐
20              raphy fields estimated from satellite altimeter data by Sandwell
21              and  Smith.   If  the  user  has  set  an  environment  variable
22              $GMT_IMGDIR, then  img2mercgrd  will  try  to  find  imgfile  in
23              $GMT_IMGDIR; else it will try to open imgfile directly.
24
25       -G     grdfile is the name of the output grid file.
26
27       -R     west, east, south, and north specify the Region of interest, and
28              you   may   specify   them   in   decimal    degrees    or    in
29              [+-]dd:mm[:ss.xxx][W|E|S|N]  format.  Append r if lower left and
30              upper right map coordinates are given instead of  w/e/s/n.   The
31              two  shorthands  -Rg  and -Rd stand for global domain (0/360 and
32              -180/+180 in longitude respectively, with -90/+90 in latitude).
33
34       -T     type handles the encoding of constraint information.  type  =  0
35              indicates  that  no  such information is encoded in the img file
36              (used for pre-1995 versions of the gravity data)  and  gets  all
37              data.  type > 0 indicates that constraint information is encoded
38              (1995 and later (current) versions of the img files) so that one
39              may  produce a grid file as follows: -T1 gets data values at all
40              points, -T2 gets data values at constrained points  and  NaN  at
41              interpolated  points;  -T3 gets 1 at constrained points and 0 at
42              interpolated points.
43

OPTIONS

45       -C     Set the x and y Mercator coordinates relative to projection cen‐
46              ter  [Default  is  relative  to  lower  left  corner  of  grid].
47              Requires -M.
48
49       -D     Use the extended latitude range -80.738/+80.738.  Alternatively,
50              append  minlat/maxlat  as  the  latitude extent of the input img
51              file.  [Default is -72.006/72.006].  -E Can be used when  -M  is
52              not set to force the final grid to have the exact same region as
53              requested with -R.  By default, the final  region  is  a  direct
54              projection  of  the  original Mercator region and will typically
55              extend slightly beyond the requested latitude range, and futher‐
56              more the grid increment in latitude does not match the longitude
57              increment.   However,  the  extra  resampling  introduces  small
58              interpolation  errors and should only be used if the output grid
59              must match the requested region and have x_inc = y_inc.  In this
60              case  the  region  set  by  -R must be given in multiples of the
61              increment (.e.g, -R0/45/45/72).
62
63       -L     With no other arguments, list  all  *.img  files  found  in  the
64              directory pointed to by $GMT_IMGDIR, or the current directory if
65              not defined.  Ignored if other options are present on  the  com‐
66              mand line.
67
68       -M     Output  a  Spherical  Mercator  grid  [Default  is  a geographic
69              lon/lat grid].
70
71       -N     Average the values in the input img pixels  into  navg  by  navg
72              squares,  and  create one output pixel for each such square.  If
73              used with -T3 it will report an average constraint between 0 and
74              1.   If  used  with -T2 the output will be average data value or
75              NaN according to whether average constraint is > 0.5.  navg must
76              evenly  divide  into  the  dimensions  of the imgfile in pixels.
77              [Default 1 does no averaging].
78
79       -S     Multiply the img file values by scale  before  storing  in  grid
80              file.   [Default  is  1.0].  (img topo files are stored in (cor‐
81              rected) meters; gravity files in  mGal*10;  vertical  deflection
82              files  in  microradians*10,  vertical  gravity gradient files in
83              Eotvos*10.)
84
85       -V     Selects verbose mode, which will send progress reports to stderr
86              [Default runs "silently"].  Particularly recommended here, as it
87              is helpful to see how the coordinates are adjusted.
88
89       -m     Indicate minutes as the width of an input img pixel  in  minutes
90              of longitude.  [Default is 2.0].
91
92       -W     Indicate maxlon as the maximum longitude extent of the input img
93              file.  Versions since 1995 have had maxlon = 360.0,  while  some
94              earlier files had maxlon = 390.0.  [Default is 360.0].
95

EXAMPLES

97       To  extract data in the region -R-40/40/-70/-30 from world_grav.img.7.2
98       and preserve the Mercator gridding:
99
100       img2grd world_grav.img.7.2 -Gmerc_grav.grd -R-40/40/-70/-30 -M -T1 -V
101
102       Without the -M option the same command will yield a geographic grid.
103

SEE ALSO

105       GMT(1), img2mercgrd(1)
106
107
108
109GMT 4.3.1                         15 May 2008                       IMG2GRD(1)
Impressum