Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-release > by-pkgid > b59462524770eba87e49a9d6e0278eb3 > files > 1407

gmt-data-5.4.4-2.mga7.noarch.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>trend2d &#8212; GMT 5.4.4 documentation</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>


    <link rel="stylesheet" href="_static/rtd.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/searchtools.js"></script>
    <script type="text/javascript" src="_static/rtd-sidebar.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="triangulate" href="triangulate.html" />
    <link rel="prev" title="trend1d" href="trend1d.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="triangulate.html" title="triangulate"
             accesskey="N">next</a> </li>
        <li class="right" >
          <a href="trend1d.html" title="trend1d"
             accesskey="P">previous</a> </li>
  <li><a href="/projects/gmt/wiki/Documentation">Project Home</a>  &#187;</li>
  
        <li class="nav-item nav-item-0"><a href="index.html">GMT 5.4.4 documentation</a> &#187;</li>

          <li class="nav-item nav-item-1"><a href="man_pages.html" accesskey="U">Man Pages</a> &#187;</li>
<li class="right">
<form class="search" accept-charset="UTF-8" action="search.html" method="get">
  <div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"></div>
  <label for="q">
    <a class="search" href="search.html" accesskey="s" original-title="">Search:</a>
  </label>
  <input accesskey="f" class="small" id="q" name="q" size="20" type="text">
  <input type="hidden" name="check_keywords" value="yes">
  <input type="hidden" name="area" value="default">
</form></li>
   

      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="trend2d">
<span id="index-0"></span><h1>trend2d<a class="headerlink" href="#trend2d" title="Permalink to this headline">¶</a></h1>
<p>trend2d - Fit a [weighted] [robust] polynomial model for z = f(x,y) to xyz[w] data</p>
<div class="section" id="synopsis">
<h2>Synopsis<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
<p><strong>trend2d</strong> [ <em>table</em> ] <a class="reference internal" href="#f"><span> <strong>-F</strong></span></a></strong><strong>xyzmrw</strong> <a class="reference internal" href="#n"><span> <strong>-N</strong></span></a></strong><em>n_model</em>[<strong>+r</strong>]
[ <em>xyz[w]file</em> ]
[ <a class="reference internal" href="#c"><span> <strong>-C</strong></span></a></strong><em>condition_number</em> ]
[ <a class="reference internal" href="#i"><span> <strong>-I</strong></span></a></strong>[<em>confidence_level</em>] ]
[ <a class="reference internal" href="#v"><span> <strong>-V</strong></span></a></strong>[<em>level</em>] ]
[ <a class="reference internal" href="#w"><span> <strong>-W</strong></span></a></strong> ] [
[ <strong>-b</strong><a class="reference internal" href="gmt.html#bi-full"><span class="std std-ref">binary</span></a> ]
[ <strong>-d</strong><a class="reference internal" href="gmt.html#d-full"><span class="std std-ref">nodata</span></a> ]
[ <strong>-e</strong><a class="reference internal" href="gmt.html#e-full"><span class="std std-ref">regexp</span></a> ]
[ <strong>-f</strong><a class="reference internal" href="gmt.html#f-full"><span class="std std-ref">flags</span></a> ]
[ <strong>-h</strong><a class="reference internal" href="gmt.html#h-full"><span class="std std-ref">headers</span></a> ]
[ <strong>-i</strong><a class="reference internal" href="gmt.html#icols-full"><span class="std std-ref">flags</span></a> ]
[ <strong>-:</strong>[<strong>i</strong>|<strong>o</strong>] ]</p>
<p><strong>Note:</strong> No space is allowed between the option flag and the associated arguments.</p>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p><strong>trend2d</strong> reads x,y,z [and w] values from the first three [four]
columns on standard input [or <em>xyz[w]file</em>] and fits a regression model
z = f(x,y) + e by [weighted] least squares. The fit may be made robust
by iterative reweighting of the data. The user may also search for the
number of terms in f(x,y) which significantly reduce the variance in z.
n_model may be in [1,10] to fit a model of the following form (similar
to grdtrend):</p>
<blockquote>
<div>m1 + m2*x + m3*y + m4*x*y + m5*x*x + m6*y*y + m7*x*x*x +
m8*x*x*y + m9*x*y*y + m10*y*y*y.</div></blockquote>
<p>The user must specify <strong>-N</strong><em>n_model</em>, the number of model parameters
to use; thus, <strong>-N</strong><em>4</em> fits a bilinear trend, <strong>-N</strong><em>6</em> a quadratic
surface, and so on. Optionally, append <strong>+r</strong> to perform a robust fit. In
this case, the program will iteratively reweight the data based on a
robust scale estimate, in order to converge to a solution insensitive to
outliers. This may be handy when separating a &quot;regional&quot; field from a
&quot;residual&quot; which should have non-zero mean, such as a local mountain on
a regional surface.</p>
</div>
<div class="section" id="required-arguments">
<h2>Required Arguments<a class="headerlink" href="#required-arguments" title="Permalink to this headline">¶</a></h2>
<dl class="docutils" id="f">
<dt><strong>-F</strong><strong>xyzmrw</strong></dt>
<dd>Specify up to six letters from the set {<strong>x y z m r w</strong>} in any
order to create columns of ASCII [or binary] output. <strong>x</strong> = x,
<strong>y</strong> = y, <strong>z</strong> = z, <strong>m</strong> = model f(x,y), <strong>r</strong> = residual z -
<strong>m</strong>, <strong>w</strong> = weight used in fitting.</dd>
</dl>
<dl class="docutils" id="n">
<dt><strong>-N</strong><em>n_model</em>[<strong>+r</strong>]</dt>
<dd>Specify the number of terms in the model, <em>n_model</em>, and append
<strong>+r</strong> to do a robust fit. E.g., a robust bilinear model is
<strong>-N</strong><em>4</em><strong>+r</strong>.</dd>
</dl>
</div>
<div class="section" id="optional-arguments">
<h2>Optional Arguments<a class="headerlink" href="#optional-arguments" title="Permalink to this headline">¶</a></h2>
<dl class="docutils">
<dt><em>table</em></dt>
<dd>One or more ASCII [or binary, see <strong>-bi</strong>]
files containing x,y,z [w] values in the first 3 [4] columns. If no
files are specified, <strong>trend2d</strong> will read from standard input.</dd>
</dl>
<dl class="docutils" id="c">
<dt><strong>-C</strong><em>condition_number</em></dt>
<dd>Set the maximum allowed condition number for the matrix solution.
<strong>trend2d</strong> fits a damped least squares model, retaining only that
part of the eigenvalue spectrum such that the ratio of the largest
eigenvalue to the smallest eigenvalue is <em>condition_#</em>. [Default:
<em>condition_#</em> = 1.0e06. ].</dd>
</dl>
<dl class="docutils" id="i">
<dt><strong>-I</strong>[<em>confidence_level</em>]</dt>
<dd>Iteratively increase the number of model parameters, starting at
one, until <em>n_model</em> is reached or the reduction in variance of the
model is not significant at the <em>confidence_level</em> level. You may
set <strong>-I</strong> only, without an attached number; in this case the fit
will be iterative with a default confidence level of 0.51. Or choose
your own level between 0 and 1. See remarks section.</dd>
</dl>
<span class="target" id="v"></span><dl class="docutils">
<dt><strong>-V</strong>[<em>level</em>] <a class="reference internal" href="gmt.html#v-full"><span class="std std-ref">(more ...)</span></a></dt>
<dd>Select verbosity level [c].  </dd>
</dl>
<dl class="docutils" id="w">
<dt><strong>-W</strong></dt>
<dd>Weights are supplied in input column 4. Do a weighted least squares
fit [or start with these weights when doing the iterative robust
fit]. [Default reads only the first 3 columns.]</dd>
</dl>
<dl class="docutils">
<dt><strong>-bi</strong>[<em>ncols</em>][<strong>t</strong>] <a class="reference internal" href="gmt.html#bi-full"><span class="std std-ref">(more ...)</span></a></dt>
<dd>Select native binary input. [Default is 3 (or 4 if <strong>-W</strong> is set) input columns].</dd>
</dl>
<dl class="docutils">
<dt><strong>-bo</strong>[<em>ncols</em>][<em>type</em>] <a class="reference internal" href="gmt.html#bo-full"><span class="std std-ref">(more ...)</span></a></dt>
<dd>Select native binary output. [Default is 1-6 columns as set by <strong>-F</strong>].</dd>
</dl>
<dl class="docutils">
<dt><strong>-d</strong>[<strong>i</strong>|<strong>o</strong>]<em>nodata</em> <a class="reference internal" href="gmt.html#d-full"><span class="std std-ref">(more ...)</span></a></dt>
<dd>Replace input columns that equal <em>nodata</em> with NaN and do the reverse on output.  </dd>
</dl>
<dl class="docutils">
<dt><strong>-e</strong>[<strong>~</strong>]<em>&quot;pattern&quot;</em> <strong>|</strong> <strong>-e</strong>[<strong>~</strong>]/<em>regexp</em>/[<strong>i</strong>] <a class="reference internal" href="gmt.html#e-full"><span class="std std-ref">(more ...)</span></a></dt>
<dd>Only accept data records that match the given pattern.  </dd>
</dl>
<dl class="docutils">
<dt><strong>-f</strong>[<strong>i</strong>|<strong>o</strong>]<em>colinfo</em> <a class="reference internal" href="gmt.html#f-full"><span class="std std-ref">(more ...)</span></a></dt>
<dd>Specify data types of input and/or output columns.  </dd>
</dl>
<dl class="docutils">
<dt><strong>-h</strong>[<strong>i</strong>|<strong>o</strong>][<em>n</em>][<strong>+c</strong>][<strong>+d</strong>][<strong>+r</strong><em>remark</em>][<strong>+r</strong><em>title</em>] <a class="reference internal" href="gmt.html#h-full"><span class="std std-ref">(more ...)</span></a></dt>
<dd>Skip or produce header record(s).  </dd>
</dl>
<dl class="docutils">
<dt><strong>-i</strong><em>cols</em>[<strong>+l</strong>][<strong>+s</strong><em>scale</em>][<strong>+o</strong><em>offset</em>][,<em>...</em>] <a class="reference internal" href="gmt.html#icols-full"><span class="std std-ref">(more ...)</span></a></dt>
<dd>Select input columns and transformations (0 is first column).</dd>
</dl>
<dl class="docutils">
<dt><strong>-:</strong>[<strong>i</strong>|<strong>o</strong>] <a class="reference internal" href="gmt.html#colon-full"><span class="std std-ref">(more ...)</span></a></dt>
<dd>Swap 1st and 2nd column on input and/or output.</dd>
</dl>
<dl class="docutils">
<dt><strong>-^</strong> or just <strong>-</strong></dt>
<dd>Print a short message about the syntax of the command, then exits (NOTE: on Windows just use <strong>-</strong>).</dd>
<dt><strong>-+</strong> or just <strong>+</strong></dt>
<dd>Print an extensive usage (help) message, including the explanation of
any module-specific option (but not the GMT common options), then exits.</dd>
<dt><strong>-?</strong> or no arguments</dt>
<dd>Print a complete usage (help) message, including the explanation of all options, then exits.</dd>
</dl>
</div>
<div class="section" id="remarks">
<h2>Remarks<a class="headerlink" href="#remarks" title="Permalink to this headline">¶</a></h2>
<p>The domain of x and y will be shifted and scaled to [-1, 1] and the
basis functions are built from Chebyshev polynomials. These have a
numerical advantage in the form of the matrix which must be inverted and
allow more accurate solutions. In many applications of <strong>trend2d</strong> the
user has data located approximately along a line in the x,y plane which
makes an angle with the x axis (such as data collected along a road or
ship track). In this case the accuracy could be improved by a rotation
of the x,y axes. <strong>trend2d</strong> does not search for such a rotation;
instead, it may find that the matrix problem has deficient rank.
However, the solution is computed using the generalized inverse and
should still work out OK. The user should check the results graphically
if <strong>trend2d</strong> shows deficient rank. NOTE: The model parameters listed
with <strong>-V</strong> are Chebyshev coefficients; they are not numerically
equivalent to the m#s in the equation described above. The description
above is to allow the user to match <strong>-N</strong> with the order of the
polynomial surface. For evaluating Chebyshev polynomials, see
<a class="reference internal" href="grdmath.html"><span class="doc">grdmath</span></a>.</p>
<p>The <strong>-N</strong><em>n_model</em><strong>r</strong> (robust) and <strong>-I</strong> (iterative) options
evaluate the significance of the improvement in model misfit Chi-Squared
by an F test. The default confidence limit is set at 0.51; it can be
changed with the <strong>-I</strong> option. The user may be surprised to find that
in most cases the reduction in variance achieved by increasing the
number of terms in a model is not significant at a very high degree of
confidence. For example, with 120 degrees of freedom, Chi-Squared must
decrease by 26% or more to be significant at the 95% confidence level.
If you want to keep iterating as long as Chi-Squared is decreasing, set
<em>confidence_level</em> to zero.</p>
<p>A low confidence limit (such as the default value of 0.51) is needed to
make the robust method work. This method iteratively reweights the data
to reduce the influence of outliers. The weight is based on the Median
Absolute Deviation and a formula from Huber [1964], and is 95% efficient
when the model residuals have an outlier-free normal distribution. This
means that the influence of outliers is reduced only slightly at each
iteration; consequently the reduction in Chi-Squared is not very
significant. If the procedure needs a few iterations to successfully
attenuate their effect, the significance level of the F test must be
kept low.</p>
</div>
<div class="section" id="ascii-format-precision">
<h2>ASCII Format Precision<a class="headerlink" href="#ascii-format-precision" title="Permalink to this headline">¶</a></h2>
<p>The ASCII output formats of numerical data are controlled by parameters
in your <a class="reference internal" href="gmt.conf.html"><span class="doc">gmt.conf</span></a> file. Longitude and latitude are formatted
according to <a class="reference internal" href="gmt.conf.html#format-geo-out"><span class="std std-ref">FORMAT_GEO_OUT</span></a>, absolute time is
under the control of <a class="reference internal" href="gmt.conf.html#format-date-out"><span class="std std-ref">FORMAT_DATE_OUT</span></a> and
<a class="reference internal" href="gmt.conf.html#format-clock-out"><span class="std std-ref">FORMAT_CLOCK_OUT</span></a>, whereas general floating point values are formatted
according to <a class="reference internal" href="gmt.conf.html#format-float-out"><span class="std std-ref">FORMAT_FLOAT_OUT</span></a>. Be aware that the format in effect
can lead to loss of precision in ASCII output, which can lead to various
problems downstream. If you find the output is not written with enough
precision, consider switching to binary output (<strong>-bo</strong> if available) or
specify more decimals using the <a class="reference internal" href="gmt.conf.html#format-float-out"><span class="std std-ref">FORMAT_FLOAT_OUT</span></a> setting.</p>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<p>To remove a planar trend from data.xyz by ordinary least squares, use:</p>
<blockquote>
<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">gmt</span> <span class="n">trend2d</span> <span class="n">data</span><span class="o">.</span><span class="n">xyz</span> <span class="o">-</span><span class="n">Fxyr</span> <span class="o">-</span><span class="n">N2</span> <span class="o">&gt;</span> <span class="n">detrended_data</span><span class="o">.</span><span class="n">xyz</span>
</pre></div>
</div>
</div></blockquote>
<p>To make the above planar trend robust with respect to outliers, use:</p>
<blockquote>
<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">gmt</span> <span class="n">trend2d</span> <span class="n">data</span><span class="o">.</span><span class="n">xzy</span> <span class="o">-</span><span class="n">Fxyr</span> <span class="o">-</span><span class="n">N2</span><span class="o">+</span><span class="n">r</span> <span class="o">&gt;</span> <span class="n">detrended_data</span><span class="o">.</span><span class="n">xyz</span>
</pre></div>
</div>
</div></blockquote>
<p>To find out how many terms (up to 10 in a robust interpolant are
significant in fitting data.xyz, use:</p>
<blockquote>
<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">gmt</span> <span class="n">trend2d</span> <span class="n">data</span><span class="o">.</span><span class="n">xyz</span> <span class="o">-</span><span class="n">N10</span><span class="o">+</span><span class="n">r</span> <span class="o">-</span><span class="n">I</span> <span class="o">-</span><span class="n">V</span>
</pre></div>
</div>
</div></blockquote>
</div>
<div class="section" id="see-also">
<h2>See Also<a class="headerlink" href="#see-also" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="gmt.html"><span class="doc">gmt</span></a>,
<a class="reference internal" href="grdmath.html"><span class="doc">grdmath</span></a>,
<a class="reference internal" href="grdtrend.html"><span class="doc">grdtrend</span></a>,
<a class="reference internal" href="trend1d.html"><span class="doc">trend1d</span></a></p>
</div>
<div class="section" id="references">
<h2>References<a class="headerlink" href="#references" title="Permalink to this headline">¶</a></h2>
<p>Huber, P. J., 1964, Robust estimation of a location parameter, <em>Ann.
Math. Stat.</em>, <strong>35</strong>, 73-101.</p>
<p>Menke, W., 1989, Geophysical Data Analysis: Discrete Inverse Theory,
Revised Edition, Academic Press, San Diego.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">trend2d</a><ul>
<li><a class="reference internal" href="#synopsis">Synopsis</a></li>
<li><a class="reference internal" href="#description">Description</a></li>
<li><a class="reference internal" href="#required-arguments">Required Arguments</a></li>
<li><a class="reference internal" href="#optional-arguments">Optional Arguments</a></li>
<li><a class="reference internal" href="#remarks">Remarks</a></li>
<li><a class="reference internal" href="#ascii-format-precision">ASCII Format Precision</a></li>
<li><a class="reference internal" href="#examples">Examples</a></li>
<li><a class="reference internal" href="#see-also">See Also</a></li>
<li><a class="reference internal" href="#references">References</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="trend1d.html"
                        title="previous chapter">trend1d</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="triangulate.html"
                        title="next chapter">triangulate</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/trend2d.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="triangulate.html" title="triangulate"
             >next</a> </li>
        <li class="right" >
          <a href="trend1d.html" title="trend1d"
             >previous</a> </li>
  <li><a href="/projects/gmt/wiki/Documentation">Project Home</a>  &#187;</li>
  
        <li class="nav-item nav-item-0"><a href="index.html">GMT 5.4.4 documentation</a> &#187;</li>

          <li class="nav-item nav-item-1"><a href="man_pages.html" >Man Pages</a> &#187;</li>
<li class="right">
<form class="search" accept-charset="UTF-8" action="search.html" method="get">
  <div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"></div>
  <label for="q">
    <a class="search" href="search.html" accesskey="s" original-title="">Search:</a>
  </label>
  <input accesskey="f" class="small" id="q" name="q" size="20" type="text">
  <input type="hidden" name="check_keywords" value="yes">
  <input type="hidden" name="area" value="default">
</form></li>
   

      </ul>
    </div>
<div class="footer">
    &copy; Copyright 2018, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe.
  Last updated on Jun 28, 2018.
  Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.7.5.
  <br />Theme based on <a href="http://readthedocs.org/">Read The Docs</a>

</div>


  </body>
</html>