Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 5764c67416561ab82b35afcf9c650e17 > files > 946

GMT-doc-4.5.2-1.fc13.noarch.rpm

<!-- Creator     : groff version 1.19.2 -->
<!-- CreationDate: Thu Jan 14 08:19:34 2010 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
       p     { margin-top: 0; margin-bottom: 0; }
       pre   { margin-top: 0; margin-bottom: 0; }
       table { margin-top: 0; margin-bottom: 0; }
</style>
<title>GRDMASK</title>

</head>
<body bgcolor="#ffffff">

<h1 align=center>GRDMASK</h1>

<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#OPTIONS">OPTIONS</a><br>
<a href="#GRID FILE FORMATS">GRID FILE FORMATS</a><br>
<a href="#GEOGRAPHICAL AND TIME COORDINATES">GEOGRAPHICAL AND TIME COORDINATES</a><br>
<a href="#EXAMPLES">EXAMPLES</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>

<hr>


<a name="NAME"></a>
<h2>NAME</h2>


<p style="margin-left:11%; margin-top: 1em">grdmask &minus;
Create mask grid files from xy paths.</p>

<a name="SYNOPSIS"></a>
<h2>SYNOPSIS</h2>


<p style="margin-left:11%; margin-top: 1em"><b>grdmask</b>
<i>pathfiles</i> <b>&minus;G</b><i>mask_grd_file</i>]
<b>&minus;I</b><i>xinc</i>[<i>unit</i>][<b>=</b>|<b>+</b>][/<i>yinc</i>[<i>unit</i>][<b>=</b>|<b>+</b>]]
<b>&minus;R</b><i>west</i>/<i>east</i>/<i>south</i>/<i>north</i>[<b>r</b>]
[ <b>&minus;A</b>[<b>m</b>|<b>p</b>] ] [ <b>&minus;F</b> ] [
<b>&minus;H</b>[<b>i</b>][<i>nrec</i>] ] [
<b>&minus;N</b><i>out/edge/in</i> ] [
<b>&minus;S</b><i>search_radius</i>[<b>m|c|k|K</b>] ] [
<b>&minus;V</b> ] [ <b>&minus;:</b>[<b>i</b>|<b>o</b>] ] [
<b>&minus;bi</b>[<b>s</b>|<b>S</b>|<b>d</b>|<b>D</b>[<i>ncol</i>]|<b>c</b>[<i>var1</i><b>/</b><i>...</i>]]
] [ <b>&minus;f</b><i>colinfo</i> ] [
<b>&minus;m</b>[<i>flag</i>] ]</p>

<a name="DESCRIPTION"></a>
<h2>DESCRIPTION</h2>


<p style="margin-left:11%; margin-top: 1em"><b>grdmask</b>
can operate in two different modes. 1. It reads one or more
xy-files that each define a closed polygon. The nodes
defined by the specified region and lattice spacing will be
set equal to one of three possible values depending on
whether the node is outside, on the polygon perimeter, or
inside the polygon. The resulting mask may be used in
subsequent operations involving <b><A HREF="grdmath.html">grdmath</A></b> to mask out
data from polygonal areas. 2. The xy-files simply represent
data point locations and the mask is set to the inside or
outside value depending on whether a node is within a
maximum distance from the nearest data point. If the
distance specified is zero then only the nodes nearest each
data point are considered &quot;inside&quot;. <i><br>
pathfiles</i></p>

<p style="margin-left:22%;">The name of 1 or more ASCII [or
binary, see <b>&minus;b</b>] files holding the polygon(s) or
data points.</p>

<table width="100%" border=0 rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">



<p style="margin-top: 1em" valign="top"><b>&minus;G</b></p> </td>
<td width="8%"></td>
<td width="78%">


<p style="margin-top: 1em" valign="top">Name of resulting
output mask grid file. (See GRID FILE FORMATS below).</p></td>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">



<p style="margin-top: 1em" valign="top"><b>&minus;I</b></p> </td>
<td width="8%"></td>
<td width="78%">


<p style="margin-top: 1em" valign="top"><i>x_inc</i> [and
optionally <i>y_inc</i>] is the grid spacing. Optionally,
append a suffix modifier. <b>Geographical (degrees)
coordinates</b>: Append <b>m</b> to indicate arc minutes or
<b>c</b> to indicate arc seconds. If one of the units
<b>e</b>, <b>k</b>, <b>i</b>, or <b>n</b> is appended
instead, the increment is assumed to be given in meter, km,
miles, or nautical miles, respectively, and will be
converted to the equivalent degrees longitude at the middle
latitude of the region (the conversion depends on
<b><A HREF="gmtdefaults.html#ELLIPSOID">ELLIPSOID</A></b>). If /<i>y_inc</i> is given but set to 0 it
will be reset equal to <i>x_inc</i>; otherwise it will be
converted to degrees latitude. <b>All coordinates</b>: If
<b>=</b> is appended then the corresponding max <i>x</i>
(<i>east</i>) or <i>y</i> (<i>north</i>) may be slightly
adjusted to fit exactly the given increment [by default the
increment may be adjusted slightly to fit the given domain].
Finally, instead of giving an increment you may specify the
<i>number of nodes</i> desired by appending <b>+</b> to the
supplied integer argument; the increment is then
recalculated from the number of nodes and the domain. The
resulting increment value depends on whether you have
selected a gridline-registered or pixel-registered grid; see
Appendix B for details. Note: if
<b>&minus;R</b><i>grdfile</i> is used then grid spacing has
already been initialized; use <b>&minus;I</b> to override
the values.</p></td>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">



<p style="margin-top: 1em" valign="top"><b>&minus;R</b></p> </td>
<td width="8%"></td>
<td width="78%">


<p style="margin-top: 1em" valign="top"><i>xmin</i>,
<i>xmax</i>, <i>ymin</i>, and <i>ymax</i> specify the Region
of interest. For geographic regions, these limits correspond
to <i>west, east, south,</i> and <i>north</i> and you may
specify them in decimal degrees or in
[+-]dd:mm[:ss.xxx][W|E|S|N] format. Append <b>r</b> if lower
left and upper right map coordinates are given instead of
w/e/s/n. The two shorthands <b>&minus;Rg</b> and
<b>&minus;Rd</b> stand for global domain (0/360 and
-180/+180 in longitude respectively, with -90/+90 in
latitude). Alternatively, specify the name of an existing
grid file and the <b>&minus;R</b> settings (and grid
spacing, if applicable) are copied from the grid. For
calendar time coordinates you may either give (a) relative
time (relative to the selected <b><A HREF="gmtdefaults.html#TIME_EPOCH">TIME_EPOCH</A></b> and in the
selected <b><A HREF="gmtdefaults.html#TIME_UNIT">TIME_UNIT</A></b>; append <b>t</b> to
<b>&minus;JX</b>|<b>x</b>), or (b) absolute time of the form
[<i>date</i>]<b>T</b>[<i>clock</i>] (append <b>T</b> to
<b>&minus;JX</b>|<b>x</b>). At least one of <i>date</i> and
<i>clock</i> must be present; the <b>T</b> is always
required. The <i>date</i> string must be of the form
[-]yyyy[-mm[-dd]] (Gregorian calendar) or yyyy[-Www[-d]]
(ISO week calendar), while the <i>clock</i> string must be
of the form hh:mm:ss[.xxx]. The use of delimiters and their
type and positions must be exactly as indicated (however,
input, output and plot formats are customizable; see
<b><A HREF="gmtdefaults.html">gmtdefaults</A></b>).</p> </td>
</table>

<a name="OPTIONS"></a>
<h2>OPTIONS</h2>


<table width="100%" border=0 rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">



<p style="margin-top: 1em" valign="top"><b>&minus;A</b></p> </td>
<td width="7%"></td>
<td width="78%">


<p style="margin-top: 1em" valign="top">If the input data
are geographic (as indicated by <b>&minus;fi</b>) then the
sides in the polygons will be approximated by great circle
arcs. When using the <b>&minus;A</b> sides will be regarded
as straight lines. Alternatively, append <b>m</b> to have
sides first follow meridians, then parallels. Or append <b>p
to first follow parallels, then meridians.</b></p></td>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">



<p style="margin-top: 1em" valign="top"><b>&minus;F</b></p> </td>
<td width="7%"></td>
<td width="78%">


<p style="margin-top: 1em" valign="top">Force pixel node
registration [Default is gridline registration]. (Node
registrations are defined in <b><A HREF="GMT.html">GMT</A></b> Cookbook Appendix B
on grid file formats.)</p></td>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">



<p style="margin-top: 1em" valign="top"><b>&minus;H</b></p> </td>
<td width="7%"></td>
<td width="78%">


<p style="margin-top: 1em" valign="top">Input file(s) has
header record(s). If used, the default number of header
records is <b><A HREF="gmtdefaults.html#N_HEADER_RECS">N_HEADER_RECS</A></b>. Use <b>&minus;Hi</b> if
only input data should have header records [Default will
write out header records if the input data have them]. Blank
lines and lines starting with # are always skipped.</p></td>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">



<p style="margin-top: 1em" valign="top"><b>&minus;N</b></p> </td>
<td width="7%"></td>
<td width="78%">


<p style="margin-top: 1em" valign="top">Sets the values
that will be assigned to nodes that are <i>out</i>side the
polygons, on the <i>edge</i>, or <i>in</i>side. Values can
be any number, including the textstring NaN [Default is
0/0/1].</p> </td>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">



<p style="margin-top: 1em" valign="top"><b>&minus;S</b></p> </td>
<td width="7%"></td>
<td width="78%">


<p style="margin-top: 1em" valign="top">Set nodes depending
on their distance from the nearest data point. Nodes within
<i>radius</i> [0] from a data point are considered inside.
Append <b>m</b> to indicate minutes or <b>c</b> to indicate
seconds. Append <b>k</b> to indicate km (implies
<b>&minus;R</b> and <b>&minus;I</b> are in degrees, and we
will use a fast flat Earth approximation to calculate
distance). For more accuracy, use uppercase <b>K</b> if
distances should be calculated along geodesics. However, if
the current <b><A HREF="gmtdefaults.html#ELLIPSOID">ELLIPSOID</A></b> is spherical then great circle
calculations are used.</p></td>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">



<p style="margin-top: 1em" valign="top"><b>&minus;V</b></p> </td>
<td width="7%"></td>
<td width="78%">


<p style="margin-top: 1em" valign="top">Selects verbose
mode, which will send progress reports to stderr [Default
runs &quot;silently&quot;].</p></td>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">



<p style="margin-top: 1em" valign="top"><b>&minus;bi</b></p> </td>
<td width="7%"></td>
<td width="78%">


<p style="margin-top: 1em" valign="top">Selects binary
input. Append <b>s</b> for single precision [Default is
<b>d</b> (double)]. Uppercase <b>S</b> or <b>D</b> will
force byte-swapping. Optionally, append <i>ncol</i>, the
number of columns in your binary input file if it exceeds
the columns needed by the program. Or append <b>c</b> if the
input file is netCDF. Optionally, append
<i>var1</i><b>/</b><i>var2</i><b>/</b><i>...</i> to specify
the variables to be read. [Default is 2 input columns].</p></td>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">



<p style="margin-top: 1em" valign="top"><b>&minus;f</b></p> </td>
<td width="7%"></td>
<td width="78%">


<p style="margin-top: 1em" valign="top">Special formatting
of input and/or output columns (time or geographical data).
Specify <b>i</b> or <b>o</b> to make this apply only to
input or output [Default applies to both]. Give one or more
columns (or column ranges) separated by commas. Append
<b>T</b> (absolute calendar time), <b>t</b> (relative time
in chosen <b><A HREF="gmtdefaults.html#TIME_UNIT">TIME_UNIT</A></b> since <b><A HREF="gmtdefaults.html#TIME_EPOCH">TIME_EPOCH</A></b>),
<b>x</b> (longitude), <b>y</b> (latitude), or <b>f</b>
(floating point) to each column or column range item.
Shorthand <b>&minus;f</b>[<b>i</b>|<b>o</b>]<b>g</b> means
<b>&minus;f</b>[<b>i</b>|<b>o</b>]0<b>x</b>,1<b>y</b>
(geographic coordinates).</p></td>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">



<p style="margin-top: 1em" valign="top"><b>&minus;m</b></p> </td>
<td width="7%"></td>
<td width="78%">


<p style="margin-top: 1em" valign="top">Multiple segment
file. Segments are separated by a record whose first
character is <i>flag</i>. [Default is
&rsquo;&gt;&rsquo;].</p> </td>
</table>

<a name="GRID FILE FORMATS"></a>
<h2>GRID FILE FORMATS</h2>


<p style="margin-left:11%; margin-top: 1em">By default
<b><A HREF="GMT.html">GMT</A></b> writes out grid as single precision floats in a
COARDS-complaint netCDF file format. However, <b><A HREF="GMT.html">GMT</A></b> is
able to produce grid files in many other commonly used grid
file formats and also facilitates so called
&quot;packing&quot; of grids, writing out floating point
data as 2- or 4-byte integers. To specify the precision,
scale and offset, the user should add the suffix
<b>=</b><i>id</i>[<b>/</b><i>scale</i><b>/</b><i>offset</i>[<b>/</b><i>nan</i>]],
where <i>id</i> is a two-letter identifier of the grid type
and precision, and <i>scale</i> and <i>offset</i> are
optional scale factor and offset to be applied to all grid
values, and <i>nan</i> is the value used to indicate missing
data. See <b><A HREF="grdreformat.html">grdreformat</A></b>(1) and Section 4.17 of the GMT
Technical Reference and Cookbook for more information.</p>

<p style="margin-left:11%; margin-top: 1em">When writing a
netCDF file, the grid is stored by default with the variable
name &quot;z&quot;. To specify another variable name
<i>varname</i>, append <b>?</b><i>varname</i> to the file
name. Note that you may need to escape the special meaning
of <b>?</b> in your shell program by putting a backslash in
front of it, or by placing the filename and suffix between
quotes or double quotes.</p>

<a name="GEOGRAPHICAL AND TIME COORDINATES"></a>
<h2>GEOGRAPHICAL AND TIME COORDINATES</h2>


<p style="margin-left:11%; margin-top: 1em">When the output
grid type is netCDF, the coordinates will be labeled
&quot;longitude&quot;, &quot;latitude&quot;, or
&quot;time&quot; based on the attributes of the input data
or grid (if any) or on the <b>&minus;f</b> or
<b>&minus;R</b> options. For example, both <b>&minus;f0x
&minus;f1t</b> and <b>&minus;R</b>90w/90e/0t/3t will result
in a longitude/time grid. When the x, y, or z coordinate is
time, it will be stored in the grid as relative time since
epoch as specified by <b><A HREF="gmtdefaults.html#TIME_UNIT">TIME_UNIT</A></b> and <b><A HREF="gmtdefaults.html#TIME_EPOCH">TIME_EPOCH</A></b>
in the .gmtdefaults file or on the command line. In
addition, the <b>unit</b> attribute of the time variable
will indicate both this unit and epoch.</p>

<a name="EXAMPLES"></a>
<h2>EXAMPLES</h2>


<p style="margin-left:11%; margin-top: 1em">To set all
nodes inside and on the polygons coastline_*.xy to 0, and
outside points to 1, do</p>

<p style="margin-left:11%; margin-top: 1em"><b>grdmask</b>
coastline_*.xy <b>&minus;R</b>-60/-40/-40/-30
<b>&minus;I</b>5<b>m &minus;N</b>1/0/0
<b>&minus;G</b>land_mask.grd <b>&minus;V</b></p>

<p style="margin-left:11%; margin-top: 1em">To set nodes
within 50 km of data points to 1 and other nodes to NaN,
do</p>

<p style="margin-left:11%; margin-top: 1em"><b>grdmask</b>
data.xyz <b>&minus;R</b>-60/-40/-40/-30 <b>&minus;I</b>5<b>m
&minus;N</b>NaN/1/1 <b>&minus;S</b>50<b>k
&minus;G</b>data_mask.grd <b>&minus;V</b></p>

<a name="SEE ALSO"></a>
<h2>SEE ALSO</h2>


<p style="margin-left:11%; margin-top: 1em"><i><A HREF="GMT.html">GMT</A></i>(1),
<i><A HREF="grdlandmask.html">grdlandmask</A></i>(1), <i><A HREF="grdmath.html">grdmath</A></i>(1), <i><A HREF="grdclip.html">grdclip</A></i>(1),
<i><A HREF="psmask.html">psmask</A></i>(1), <i><A HREF="psclip.html">psclip</A></i>(1)</p>
<hr>
</body>
</html>