1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
  
     | 
    
      <HTML>
<HEAD>
<TITLE>nearneighbor</TITLE>
</HEAD>
<BODY>
<H1>nearneighbor</H1>
<HR>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->
       nearneighbor - A "Nearest neighbor" gridding algorithm
</PRE>
<H2>SYNOPSIS</H2><PRE>
       <B>nearneighbor</B>      [     <I>xyzfile(s)</I>     ]     <B>-G</B><I>out</I><B>_</B><I>grdfile</I>
       <B>-I</B><I>x</I><B>_</B><I>inc</I>[<B>m|c</B>][/<I>y</I><B>_</B><I>inc</I>[<B>m|c</B>]]                        <B>-N</B><I>sectors</I>
       <B>-R</B><I>west/east/south/north</I>[<B>r</B>]    <B>-S</B><I>search</I><B>_</B><I>radius</I>[<B>m|c|k|K</B>]   [
       <B>-E</B><I>empty</I> ] [ <B>-F</B> ] [ <B>-H</B>[<I>nrec</I>] ] [ <B>-L</B>[<I>flag</I>] ] [ <B>-V</B> ] [ <B>-W</B> ] [
       <B>-:</B> ] [ <B>-bi</B>[<B>s</B>][<I>n</I>] ]
</PRE>
<H2>DESCRIPTION</H2><PRE>
       <B>nearneighbor</B> reads arbitrarily located (x,y,z[,w]) triples
       [quadruplets] from standard input [or <I>xyzfile(s)</I>] and uses
       a nearest neighbor algorithm to assign an average value to
       each node that have one or more  points  within  a  radius
       centered  on the node.  The average value is computed as a
       weighted mean of the nearest point from each sector inside
       the  search  radius. The weighting function used is w(r) =
       1.0 / (1 + d ^ 2), where d = 3 * r / search_radius  and  r
       is distance from the node. This weight is modulated by the
       observation points' weights [if supplied].'
       <I>xyzfile(s)</I>
              3 [or 4, see <B>-W</B>] column ASCII file(s)  [or  binary,
              see <B>-b</B>] holding (x,y,z[,w]) data values. If no file
              is specified, <B>nearneighbor</B> will read from  standard
              input.
       <B>-G</B>     Give the name of the output grdfile.
       <B>-I</B>     <I>x</I><B>_</B><I>inc</I>  [and  optionally <I>y</I><B>_</B><I>inc</I>] is the grid spacing.
              Append <B>m</B> to indicate minutes or <B>c</B> to indicate  sec
              onds.
       <B>-N</B>     The  circular area centered on each node is divided
              into several sectors. Average values will  only  be
              computed if there is at least one value inside each
              of the sectors for a given node.  Nodes  that  fail
              this  test are assigned the value NaN (but see <B>-E</B>).
              [Default is quadrant search, i.e.,  <I>sectors</I>  =  4].
              Note  that only the nearest value per sector enters
              into the averaging, not all values inside the  cir
              cle.
       <B>-R</B>     <I>west,</I>  <I>east,</I> <I>south,</I> and <I>north</I> specify the Region of
              interest. To specify boundaries in degrees and min
              utes  [and  seconds],  use  the  dd:mm[:ss] format.
              Append <B>r</B> if lower left and upper right map  coordi
              nates are given instead of wesn.
       <B>-S</B>     Sets  the  <I>search</I><B>_</B><I>radius</I>  in same units as the grid
              spacing; append <B>m</B> to indicate minutes or <B>c</B> to indi
              cate  seconds. Append <B>k</B> to indicated km (implies <B>-R</B>
              flat Earth].
</PRE>
<H2>OPTIONS</H2><PRE>
       <B>-E</B>     Set the value assigned to empty nodes [NaN].
       <B>-F</B>     Force pixel registration. [Default is  grid  regis
              tration].
       <B>-H</B>     Input  file(s)  has  Header  record(s).  Number  of
              header records can be changed by editing your .gmt
              defaults  file.  If  used,  <B><A HREF="GMT.html">GMT</A></B> default is 1 header
              record.  Not used with binary data.
       <B>-L</B>     Boundary condition <I>flag</I> may be <I>x</I> or <I>y</I> or  <I>xy</I>  indi
              cating  data is periodic in range of x or y or both
              set by <B>-R</B>, or <I>flag</I> may be <I>g</I> indicating geographical
              conditions  (x  and y are lon and lat). [Default is
              no boundary conditions].  If no flag is  given,  it
              is  assumed  that the x column contains longitudes,
              which may differ from the region in <B>-R</B>  by  [multi
              ples  of] 360 degrees [Default assumes no periodic
              ity].
       <B>-V</B>     Selects verbose  mode,  which  will  send  progress
              reports to stderr [Default runs "silently"].
       <B>-:</B>     Toggles  between  (longitude,latitude)  and  (lati
              tude,longitude) input/output. [Default  is  (longi
              tude,latitude)].  Applies to geographic coordinates
              only.
       <B>-W</B>     Input data have a 4th column containing observation
              point  weights.  These are multiplied with the geo
              metrical weight  factor  to  determine  the  actual
              weights used in the calculations.
       <B>-bi</B>    Selects binary input. Append <B>s</B> for single precision
              [Default is double].  Append <I>n</I> for  the  number  of
              columns in the binary file(s).  [Default is 3 (or 4
              if <B>-W</B> is set) columns].
</PRE>
<H2>EXAMPLES</H2><PRE>
       To  create  a  gridded  data  set  from  the   file   sea
       MARCII_bathy.lon_lat_z using a 0.5 min grid, a 5 km search
       radius, using an octant search, and  set  empty  nodes  to
       -9999, try
       nearneighbor  seaMARCII_bathy.lon_lat_z  <B>-R</B>242/244/-22/-20
       <B>-I</B>.5<B>m</B> <B>-E</B>-9999 <B>-G</B>bathymetry.grd <B>-S</B>5k <B>-N</B>8
       To make a global gridded file from the data  in  geoid.xyz
       using  a  1 degree grid, a 200 km search radius, spherical
       nearneighbor  geoid.xyz <B>-R</B>0/360/-90/90 <B>-I</B>1 <B>-L</B>g <B>-G</B>geoid.grd
       <B>-S</B>20K <B>-N</B>4
</PRE>
<H2>SEE ALSO</H2><PRE>
       <I><A HREF="blockmean.html">blockmean</A></I>(l), <I><A HREF="blockmedian.html">blockmedian</A></I>(l), <I><A HREF="blockmode.html">blockmode</A></I>(l),  <I>gmt</I>(l),  <I>sur</I>
       <I>face</I>(l), <I><A HREF="triangulate.html">triangulate</A></I>(l)
</PRE>
<HR>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>
<body bgcolor="#ffffff">
 
     |