PageRenderTime 39ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/GMT4.5.7/doc/html/man/grdtrend.html

#
HTML | 270 lines | 198 code | 70 blank | 2 comment | 0 complexity | 27eeced130e2d56f7dc6d4fc9dd5d4a2 MD5 | raw file
Possible License(s): GPL-2.0
  1. <!-- Creator : groff version 1.19.2 -->
  2. <!-- CreationDate: Thu Jul 14 07:01:37 2011 -->
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  4. "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta name="generator" content="groff -Thtml, see www.gnu.org">
  8. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  9. <meta name="Content-Style" content="text/css">
  10. <style type="text/css">
  11. p { margin-top: 0; margin-bottom: 0; }
  12. pre { margin-top: 0; margin-bottom: 0; }
  13. table { margin-top: 0; margin-bottom: 0; }
  14. </style>
  15. <title>GRDTREND</title>
  16. </head>
  17. <body bgcolor="#ffffff">
  18. <h1 align=center>GRDTREND</h1>
  19. <a href="#NAME">NAME</a><br>
  20. <a href="#SYNOPSIS">SYNOPSIS</a><br>
  21. <a href="#DESCRIPTION">DESCRIPTION</a><br>
  22. <a href="#OPTIONS">OPTIONS</a><br>
  23. <a href="#REMARKS">REMARKS</a><br>
  24. <a href="#GRID FILE FORMATS">GRID FILE FORMATS</a><br>
  25. <a href="#EXAMPLES">EXAMPLES</a><br>
  26. <a href="#SEE ALSO">SEE ALSO</a><br>
  27. <hr>
  28. <a name="NAME"></a>
  29. <h2>NAME</h2>
  30. <p style="margin-left:11%; margin-top: 1em">grdtrend
  31. &minus; Fit and/or remove a polynomial trend in a grid
  32. file</p>
  33. <a name="SYNOPSIS"></a>
  34. <h2>SYNOPSIS</h2>
  35. <p style="margin-left:11%; margin-top: 1em"><b>grdtrend</b>
  36. <i>grdfile</i> <b>&minus;N</b><i>n_model</i>[<b>r</b>] [
  37. <b>&minus;D</b><i>diff.grd</i> ] [
  38. <b>&minus;T</b><i>trend.grd</i> ] [ <b>&minus;V</b> ] [
  39. <b>&minus;W</b><i>weight.grd</i> ]</p>
  40. <a name="DESCRIPTION"></a>
  41. <h2>DESCRIPTION</h2>
  42. <p style="margin-left:11%; margin-top: 1em"><b>grdtrend</b>
  43. reads a 2-D grid file and fits a low-order polynomial trend
  44. to these data by [optionally weighted] least-squares. The
  45. trend surface is defined by:</p>
  46. <p style="margin-left:11%; margin-top: 1em">m1 + m2*x +
  47. m3*y + m4*x*y + m5*x*x + m6*y*y + m7*x*x*x + m8*x*x*y +
  48. m9*x*y*y + m10*y*y*y.</p>
  49. <p style="margin-left:11%; margin-top: 1em">The user must
  50. specify <b>&minus;N</b><i>n_model</i>, the number of model
  51. parameters to use; thus, <b>&minus;N</b><i>4</i> fits a
  52. bilinear trend, <b>&minus;N</b><i>6</i> a quadratic surface,
  53. and so on. Optionally, append <b>r</b> to the
  54. <b>&minus;N</b> option to perform a robust fit. In this
  55. case, the program will iteratively reweight the data based
  56. on a robust scale estimate, in order to converge to a
  57. solution insensitive to outliers. This may be handy when
  58. separating a &quot;regional&quot; field from a
  59. &quot;residual&quot; which should have non-zero mean, such
  60. as a local mountain on a regional surface.</p>
  61. <p style="margin-left:11%; margin-top: 1em">If data file
  62. has values set to NaN, these will be ignored during fitting;
  63. if output files are written, these will also have NaN in the
  64. same locations.</p>
  65. <p style="margin-left:11%; margin-top: 1em">No space
  66. between the option flag and the associated arguments.
  67. <i><br>
  68. grdfile</i></p>
  69. <p style="margin-left:22%;">The name of a 2-D binary grid
  70. file.</p>
  71. <table width="100%" border=0 rules="none" frame="void"
  72. cellspacing="0" cellpadding="0">
  73. <tr valign="top" align="left">
  74. <td width="11%"></td>
  75. <td width="3%">
  76. <p style="margin-top: 1em" valign="top"><b>&minus;N</b></p> </td>
  77. <td width="8%"></td>
  78. <td width="78%">
  79. <p style="margin-top: 1em" valign="top">[<b>r</b>]<i>n_model</i>
  80. sets the number of model parameters to fit. Append <b>r</b>
  81. for robust fit.</p></td>
  82. </table>
  83. <a name="OPTIONS"></a>
  84. <h2>OPTIONS</h2>
  85. <p style="margin-left:11%; margin-top: 1em">No space
  86. between the option flag and the associated arguments.</p>
  87. <table width="100%" border=0 rules="none" frame="void"
  88. cellspacing="0" cellpadding="0">
  89. <tr valign="top" align="left">
  90. <td width="11%"></td>
  91. <td width="3%">
  92. <p style="margin-top: 1em" valign="top"><b>&minus;D</b></p> </td>
  93. <td width="8%"></td>
  94. <td width="78%">
  95. <p style="margin-top: 1em" valign="top">Write the
  96. difference (input data - trend) to the file
  97. <i>diff.grd</i>.</p> </td>
  98. <tr valign="top" align="left">
  99. <td width="11%"></td>
  100. <td width="3%">
  101. <p style="margin-top: 1em" valign="top"><b>&minus;T</b></p> </td>
  102. <td width="8%"></td>
  103. <td width="78%">
  104. <p style="margin-top: 1em" valign="top">Write the fitted
  105. trend to the file <i>trend.grd</i>.</p></td>
  106. <tr valign="top" align="left">
  107. <td width="11%"></td>
  108. <td width="3%">
  109. <p style="margin-top: 1em" valign="top"><b>&minus;V</b></p> </td>
  110. <td width="8%"></td>
  111. <td width="78%">
  112. <p style="margin-top: 1em" valign="top">Selects verbose
  113. mode, which will send progress reports to stderr [Default
  114. runs &quot;silently&quot;].</p></td>
  115. <tr valign="top" align="left">
  116. <td width="11%"></td>
  117. <td width="3%">
  118. <p style="margin-top: 1em" valign="top"><b>&minus;W</b></p> </td>
  119. <td width="8%"></td>
  120. <td width="78%">
  121. <p style="margin-top: 1em" valign="top">If
  122. <i>weight.grd</i> exists, it will be read and used to solve
  123. a weighted least-squares problem. [Default: Ordinary
  124. least-squares fit.] If the robust option has been selected,
  125. the weights used in the robust fit will be written to
  126. <i>weight.grd</i>.</p> </td>
  127. </table>
  128. <a name="REMARKS"></a>
  129. <h2>REMARKS</h2>
  130. <p style="margin-left:11%; margin-top: 1em">The domain of x
  131. and y will be shifted and scaled to [-1, 1] and the basis
  132. functions are built from Legendre polynomials. These have a
  133. numerical advantage in the form of the matrix which must be
  134. inverted and allow more accurate solutions. NOTE: The model
  135. parameters listed with <b>&minus;V</b> are Legendre
  136. polynomial coefficients; they are not numerically equivalent
  137. to the m#s in the equation described above. The description
  138. above is to allow the user to match <b>&minus;N</b> with the
  139. order of the polynomial surface. See <b><A HREF="grdmath.html">grdmath</A></b> if you
  140. need to evaluate the trend using the reported
  141. coefficients.</p>
  142. <a name="GRID FILE FORMATS"></a>
  143. <h2>GRID FILE FORMATS</h2>
  144. <p style="margin-left:11%; margin-top: 1em">By default
  145. <b><A HREF="GMT.html">GMT</A></b> writes out grid as single precision floats in a
  146. COARDS-complaint netCDF file format. However, <b><A HREF="GMT.html">GMT</A></b> is
  147. able to produce grid files in many other commonly used grid
  148. file formats and also facilitates so called
  149. &quot;packing&quot; of grids, writing out floating point
  150. data as 2- or 4-byte integers. To specify the precision,
  151. scale and offset, the user should add the suffix
  152. <b>=</b><i>id</i>[<b>/</b><i>scale</i><b>/</b><i>offset</i>[<b>/</b><i>nan</i>]],
  153. where <i>id</i> is a two-letter identifier of the grid type
  154. and precision, and <i>scale</i> and <i>offset</i> are
  155. optional scale factor and offset to be applied to all grid
  156. values, and <i>nan</i> is the value used to indicate missing
  157. data. When reading grids, the format is generally
  158. automatically recognized. If not, the same suffix can be
  159. added to input grid file names. See <b><A HREF="grdreformat.html">grdreformat</A></b>(1)
  160. and Section 4.17 of the GMT Technical Reference and Cookbook
  161. for more information.</p>
  162. <p style="margin-left:11%; margin-top: 1em">When reading a
  163. netCDF file that contains multiple grids, <b><A HREF="GMT.html">GMT</A></b> will
  164. read, by default, the first 2-dimensional grid that can find
  165. in that file. To coax <b><A HREF="GMT.html">GMT</A></b> into reading another
  166. multi-dimensional variable in the grid file, append
  167. <b>?</b><i>varname</i> to the file name, where
  168. <i>varname</i> is the name of the variable. Note that you
  169. may need to escape the special meaning of <b>?</b> in your
  170. shell program by putting a backslash in front of it, or by
  171. placing the filename and suffix between quotes or double
  172. quotes. The <b>?</b><i>varname</i> suffix can also be used
  173. for output grids to specify a variable name different from
  174. the default: &quot;z&quot;. See <b><A HREF="grdreformat.html">grdreformat</A></b>(1) and
  175. Section 4.18 of the GMT Technical Reference and Cookbook for
  176. more information, particularly on how to read splices of 3-,
  177. 4-, or 5-dimensional grids.</p>
  178. <a name="EXAMPLES"></a>
  179. <h2>EXAMPLES</h2>
  180. <p style="margin-left:11%; margin-top: 1em">To remove a
  181. planar trend from hawaii_topo.grd and write result in
  182. hawaii_residual.grd:</p>
  183. <p style="margin-left:11%; margin-top: 1em"><b>grdtrend</b>
  184. hawaii_topo.grd <b>&minus;N</b>3
  185. <b>&minus;D</b>hawaii_residual.grd</p>
  186. <p style="margin-left:11%; margin-top: 1em">To do a robust
  187. fit of a bicubic surface to hawaii_topo.grd, writing the
  188. result in hawaii_trend.grd and the weights used in
  189. hawaii_weight.grd, and reporting the progress:</p>
  190. <p style="margin-left:11%; margin-top: 1em"><b>grdtrend</b>
  191. hawaii_topo.grd <b>&minus;N</b>10<b>r
  192. &minus;T</b>hawaii_trend.grd
  193. <b>&minus;W</b>hawaii_weight.grd <b>&minus;V</b></p>
  194. <a name="SEE ALSO"></a>
  195. <h2>SEE ALSO</h2>
  196. <p style="margin-left:11%; margin-top: 1em"><i><A HREF="GMT.html">GMT</A></i>(1),
  197. <i><A HREF="grdfft.html">grdfft</A></i>(1), <i><A HREF="grdfilter.html">grdfilter</A></i>(1)</p>
  198. <hr>
  199. </body>
  200. </html>