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

NAME

6       psmask - To clip or mask areas of no data on a map
7

SYNOPSIS

9       psmask   [xyzfile]   -Ixinc[unit][=|+][/yinc[unit][=|+]]   -Jparameters
10       -Rwest/east/south/north[r] [  -B[p|s]parameters  ]  [  -Ddumpfile  ]  [
11       -Eazim/elev[+wlon/lat[/z]][+vx0/y0] ] [ -F ] [ -Gfill ] [ -H[i][nrec] ]
12       [ -K ] [ -N ] [ -O ] [ -P ] [  -Ssearch_radius[m|c|k|K]  ]  [  -T  ]  [
13       -U[just/dx/dy/][c|label]   ]   [  -V  ]  [  -X[a|c|r][x-shift[u]]  ]  [
14       -Y[a|c|r][y-shift[u]]   ]   [   -ccopies   ]     [    -:[i|o]    ]    [
15       -bi[s|S|d|D[ncol]|c[var1/...]] ] [ -m[flag] ]
16
17       psmask -C [ -K ] [ -O ]
18

DESCRIPTION

20       psmask  reads a (x,y,z) file [or standard input] and uses this informa‐
21       tion to find out which grid cells are reliable.  Only  gridcells  which
22       have  one  or  more data points are considered reliable.  As an option,
23       you may specify a radius of influence. Then,  all  gridcells  that  are
24       within radius of a data point are considered reliable.  Furthermore, an
25       option is provided to reverse the sense of the test.  Having found  the
26       reliable/not  reliable  points,  psmask will either paint tiles to mask
27       these nodes (with the -T switch), or use contouring to create  polygons
28       that will clip out regions of no interest.  When clipping is initiated,
29       it will stay in effect until turned off by  a  second  call  to  psmask
30       using the -C option.
31
32       xyzfile
33              File  with  (x,y,z) values (e.g., that was used to run surface).
34              If no file is given, standard input is read.  For binary  files,
35              see -b.
36
37       -I     x_inc  [and  optionally  y_inc] is the grid spacing. Optionally,
38              append a suffix modifier.  Geographical  (degrees)  coordinates:
39              Append  m  to indicate arc minutes or c to indicate arc seconds.
40              If one of the units e, k, i,  or  n  is  appended  instead,  the
41              increment  is assumed to be given in meter, km, miles, or nauti‐
42              cal miles, respectively, and will be converted to the equivalent
43              degrees longitude at the middle latitude of the region (the con‐
44              version depends on ELLIPSOID).  If /y_inc is given but set to  0
45              it  will be reset equal to x_inc; otherwise it will be converted
46              to degrees latitude.  All coordinates: If = is appended then the
47              corresponding max x (east) or y (north) may be slightly adjusted
48              to fit exactly the given increment [by default the increment may
49              be adjusted slightly to fit the given domain].  Finally, instead
50              of giving an increment you  may  specify  the  number  of  nodes
51              desired  by  appending  +  to the supplied integer argument; the
52              increment is then recalculated from the number of nodes and  the
53              domain.   The  resulting  increment value depends on whether you
54              have selected a gridline-registered  or  pixel-registered  grid;
55              see  Appendix  B  for  details.  Note: if -Rgrdfile is used then
56              grid spacing has already been initialized; use  -I  to  override
57              the values.
58
59       -J     Selects  the  map  projection. Scale is UNIT/degree, 1:xxxxx, or
60              width in UNIT (upper case modifier).  UNIT is cm,  inch,  or  m,
61              depending on the MEASURE_UNIT setting in .gmtdefaults4, but this
62              can be overridden on the command line by appending c, i, or m to
63              the  scale/width  value.   When  central  meridian  is optional,
64              default is center of longitude  range  on  -R  option.   Default
65              standard  parallel  is  the equator.  For map height, max dimen‐
66              sion, or min dimension, append h, +, or - to the width,  respec‐
67              tively.
68              More details can be found in the psbasemap man pages.
69
70              CYLINDRICAL PROJECTIONS:
71
72              -Jclon0/lat0/scale (Cassini)
73              -Jcyl_stere/[lon0/[lat0/]]scale (Cylindrical Stereographic)
74              -Jj[lon0/]scale (Miller)
75              -Jm[lon0/[lat0/]]scale (Mercator)
76              -Jmlon0/lat0/scale (Mercator - Give meridian and standard paral‐
77              lel)
78              -Jo[a]lon0/lat0/azimuth/scale  (Oblique  Mercator  -  point  and
79              azimuth)
80              -Jo[b]lon0/lat0/lon1/lat1/scale (Oblique Mercator - two points)
81              -Joclon0/lat0/lonp/latp/scale  (Oblique  Mercator  -  point  and
82              pole)
83              -Jq[lon0/[lat0/]]scale (Cylindrical Equidistant)
84              -Jtlon0/[lat0/]scale (TM - Transverse Mercator)
85              -Juzone/scale (UTM - Universal Transverse Mercator)
86              -Jy[lon0/[lat0/]]scale (Cylindrical Equal-Area)
87
88              CONIC PROJECTIONS:
89
90              -Jblon0/lat0/lat1/lat2/scale (Albers)
91              -Jdlon0/lat0/lat1/lat2/scale (Conic Equidistant)
92              -Jllon0/lat0/lat1/lat2/scale (Lambert Conic Conformal)
93              -Jpoly/[lon0/[lat0/]]scale ((American) Polyconic)
94
95              AZIMUTHAL PROJECTIONS:
96
97              -Jalon0/lat0[/horizon]/scale (Lambert Azimuthal Equal-Area)
98              -Jelon0/lat0[/horizon]/scale (Azimuthal Equidistant)
99              -Jflon0/lat0[/horizon]/scale (Gnomonic)
100              -Jglon0/lat0[/horizon]/scale (Orthographic)
101              -Jglon0/lat0/altitude/azimuth/tilt/twist/Width/Height/scale
102              (General Perspective).
103              -Jslon0/lat0[/horizon]/scale (General Stereographic)
104
105              MISCELLANEOUS PROJECTIONS:
106
107              -Jh[lon0/]scale (Hammer)
108              -Ji[lon0/]scale (Sinusoidal)
109              -Jkf[lon0/]scale (Eckert IV)
110              -Jk[s][lon0/]scale (Eckert VI)
111              -Jn[lon0/]scale (Robinson)
112              -Jr[lon0/]scale (Winkel Tripel)
113              -Jv[lon0/]scale (Van der Grinten)
114              -Jw[lon0/]scale (Mollweide)
115
116              NON-GEOGRAPHICAL PROJECTIONS:
117
118              -Jp[a]scale[/origin][r|z] (Polar coordinates (theta,r))
119              -Jxx-scale[d|l|ppow|t|T][/y-scale[d|l|ppow|t|T]]  (Linear,  log,
120              and power scaling)
121
122       -R     xmin, xmax, ymin, and ymax specify the Region of interest.   For
123              geographic  regions,  these  limits  correspond  to  west, east,
124              south, and north and you may specify them in decimal degrees  or
125              in  [+-]dd:mm[:ss.xxx][W|E|S|N]  format.  Append r if lower left
126              and upper right map coordinates are given  instead  of  w/e/s/n.
127              The  two  shorthands  -Rg and -Rd stand for global domain (0/360
128              and -180/+180 in longitude respectively, with -90/+90  in  lati‐
129              tude).  Alternatively, specify the name of an existing grid file
130              and the -R settings (and grid spacing, if applicable) are copied
131              from  the  grid.   For  calendar time coordinates you may either
132              give (a) relative time (relative to the selected TIME_EPOCH  and
133              in  the  selected TIME_UNIT; append t to -JX|x), or (b) absolute
134              time of the form [date]T[clock] (append T to -JX|x).   At  least
135              one of date and clock must be present; the T is always required.
136              The date string must be of the form [-]yyyy[-mm[-dd]] (Gregorian
137              calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock
138              string must be of the form hh:mm:ss[.xxx].  The  use  of  delim‐
139              iters  and their type and positions must be exactly as indicated
140              (however, input, output and plot formats are  customizable;  see
141              gmtdefaults).
142

OPTIONS

144       No space between the option flag and the associated arguments.
145
146       -B     Sets  map  boundary  annotation  and tickmark intervals; see the
147              psbasemap man page for all the details.
148
149       -C     Mark end of existing  clip  path.   No  input  file  is  needed.
150              Implicitly  sets  -O.  However, you must supply -Xa and -Ya set‐
151              tings if you are using absolute positioning.
152
153       -D     Dumps out the resulting clipping polygons to disk.   Ignored  if
154              -T is set.  If no dumpprefix is given we use mask (Files will be
155              called mask_*.d).  Append  +n<n_pts>  to  limit  the  number  of
156              points  in  files  to a minimum of n_pts.  That is, do not write
157              individual polygon files if they do not have at least n_pts ver‐
158              tices.   Often,  when one uses the -D option it is not wished to
159              output any ps code to stdout.  In such cases redirect the output
160              to > /dev/null on *nix systems or to > nul on Windows.
161
162       -E     Sets  the  viewpoint's  azimuth  and  elevation (for perspective
163              view) [180/90].  For frames used for animation, you may want  to
164              append  +  to  fix  the center of your data domain (or specify a
165              particular world coordinate  point  with  +wlon0/lat[/z])  which
166              will  project  to  the  center of your page size (or specify the
167              coordinates of the projected veiw point with +vx0/y0).
168
169       -F     Force pixel node registration  [Default  is  gridline  registra‐
170              tion].  (Node registrations are defined in GMT Cookbook Appendix
171              B on grid file formats.)
172
173       -G     Paint the clip polygons (or tiles) with a selected fill [Default
174              is no fill].  (See SPECIFYING FILL below).
175
176       -H     Input file(s) has header record(s).  If used, the default number
177              of header records is N_HEADER_RECS.  Use -Hi if only input  data
178              should  have  header  records  [Default  will  write  out header
179              records if the input data have  them].  Blank  lines  and  lines
180              starting with # are always skipped.  Not used with binary data.
181
182       -K     More  PostScript code will be appended later [Default terminates
183              the plot system].
184
185       -N     Invert the sense of the test, i.e. clip regions where  there  is
186              data coverage.
187
188       -O     Selects  Overlay  plot mode [Default initializes a new plot sys‐
189              tem].
190
191       -P     Selects Portrait plotting mode [Default is Landscape, see gmtde‐
192              faults to change this].
193
194       -S     Sets  radius  of  influence.  Grid nodes within radius of a data
195              point are considered reliable. [Default is 0, which  means  that
196              only  grid  cells  with data in them are reliable].  Append m to
197              indicate minutes or c to indicate seconds.  Append k to indicate
198              km  (implies  -R  and  -I are in degrees, and we will use a fast
199              flat Earth approximation to calculate distance).  For more accu‐
200              racy,  use  uppercase  K if distances should be calculated along
201              geodesics.  However, if the current ELLIPSOID is spherical  then
202              great circle calculations are used.
203
204       -T     Plot  tiles  instead of clip polygons.  Use -G to set tile color
205              or pattern.
206
207       -U     Draw Unix System time stamp on plot.  By adding just/dx/dy/, the
208              user  may  specify  the justification of the stamp and where the
209              stamp should fall on the page relative to lower left  corner  of
210              the  plot.  For example, BL/0/0 will align the lower left corner
211              of the time stamp with  the  lower  left  corner  of  the  plot.
212              Optionally,  append  a  label, or c (which will plot the command
213              string.).  The  GMT  parameters  UNIX_TIME,  UNIX_TIME_POS,  and
214              UNIX_TIME_FORMAT  can affect the appearance; see the gmtdefaults
215              man page for details.  The time string will be in the locale set
216              by the environment variable TZ (generally local time).
217
218       -V     Selects verbose mode, which will send progress reports to stderr
219              [Default runs "silently"].
220
221       -X -Y  Shift plot origin relative to the current origin by  (x-shift,y-
222              shift)  and optionally append the length unit (c, i, m, p).  You
223              can prepend a to shift the origin back to the original  position
224              after  plotting,  or  prepend   r [Default] to reset the current
225              origin to the new location.  If -O is used then the default  (x-
226              shift,y-shift)  is  (0,0), otherwise it is (r1i, r1i) or (r2.5c,
227              r2.5c).  Alternatively, give c to align the center coordinate (x
228              or  y)  of the plot with the center of the page based on current
229              page size.
230
231       -:     Toggles between  (longitude,latitude)  and  (latitude,longitude)
232              input and/or output.  [Default is (longitude,latitude)].  Append
233              i to select input only or o to  select  output  only.   [Default
234              affects both].
235
236       -bi    Selects binary input.  Append s for single precision [Default is
237              d  (double)].   Uppercase  S  or  D  will  force  byte-swapping.
238              Optionally,  append  ncol,  the number of columns in your binary
239              input file if it exceeds the columns needed by the program.   Or
240              append  c  if  the  input  file  is  netCDF.  Optionally, append
241              var1/var2/... to specify the variables to be read.  [Default  is
242              2 input columns].
243
244       -c     Specifies the number of plot copies. [Default is 1].
245
246       -m     Multiple  segment  file(s).  Segments are separated by a special
247              record.  For ASCII  files  the  first  character  must  be  flag
248              [Default  is  '>'].  For binary files all fields must be NaN and
249              -b must set the number of output columns explicitly.  By default
250              the  -m  setting  applies to both input and output.  Use -mi and
251              -mo to give separate settings to input and output.
252
253   SPECIFYING FILL
254       fill   The attribute fill specifies the solid shade or solid color (see
255              SPECIFYING  COLOR  below)  or the pattern used for filling poly‐
256              gons.  Patterns are specified  as  pdpi/pattern,  where  pattern
257              gives the number of the built-in pattern (1-90) or the name of a
258              Sun 1-, 8-, or 24-bit raster file. The dpi sets  the  resolution
259              of  the  image.  For 1-bit rasters: use Pdpi/pattern for inverse
260              video, or append :Fcolor[B[color]] to specify  fore-  and  back‐
261              ground  colors  (use color = - for transparency).  See GMT Cook‐
262              book & Technical Reference Appendix E for information  on  indi‐
263              vidual patterns.
264
265   SPECIFYING COLOR
266       color  The  color  of  lines,  areas and patterns can be specified by a
267              valid color name; by a gray shade (in the  range  0-255);  by  a
268              decimal  color  code  (r/g/b, each in range 0-255; h-s-v, ranges
269              0-360, 0-1, 0-1; or c/m/y/k, each in range 0-1); or by  a  hexa‐
270              decimal  color code (#rrggbb, as used in HTML).  See the gmtcol‐
271              ors manpage for more information and a full list of color names.
272

EXAMPLES

274       To make an overlay PostScript file that will mask out the regions of  a
275       contour map where there is no control data using clip polygons, use:
276
277       psmask africa_grav.xyg -R20/40/20/40 -I5m -JM10i -O -K > mask.ps
278
279       The same example but this time we use white tiling:
280
281       psmask  africa_grav.xyg  -R20/40/20/40  -I5m  -JM10i -T -O -K -Gwhite >
282       mask.ps
283

SEE ALSO

285       GMT(1), gmtcolors(5), grdmask(1), surface(1), psbasemap(1), psclip(1)
286
287
288
289GMT 4.5.6                         10 Mar 2011                        PSMASK(1)
Impressum