PageRenderTime 30ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/docs/2.0/generated/cf.FieldList.fill_value.html

https://bitbucket.org/cfpython/cfpython.bitbucket.org
HTML | 223 lines | 179 code | 14 blank | 30 comment | 0 complexity | 0e8615df271cf69041413ab51181ce55 MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>cf.FieldList.fill_value &#8212; Documentation</title>
  7. <link rel="stylesheet" href="../_static/classic.css" type="text/css" />
  8. <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: '../',
  12. VERSION: '2.0',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true,
  16. SOURCELINK_SUFFIX: '.txt'
  17. };
  18. </script>
  19. <script type="text/javascript" src="../_static/jquery.js"></script>
  20. <script type="text/javascript" src="../_static/underscore.js"></script>
  21. <script type="text/javascript" src="../_static/doctools.js"></script>
  22. <script type="text/javascript" src="../_static/copybutton.js"></script>
  23. <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  24. <link rel="index" title="Index" href="../genindex.html" />
  25. <link rel="search" title="Search" href="../search.html" />
  26. <link rel="next" title="cf.FieldList.identity" href="cf.FieldList.identity.html" />
  27. <link rel="prev" title="cf.FieldList.dump" href="cf.FieldList.dump.html" />
  28. </head>
  29. <body role="document">
  30. <div class="related" role="navigation" aria-label="related navigation">
  31. <h3>Navigation</h3>
  32. <ul>
  33. <li class="right" style="margin-right: 10px">
  34. <a href="../genindex.html" title="General Index"
  35. accesskey="I">index</a></li>
  36. <li class="right" >
  37. <a href="cf.FieldList.identity.html" title="cf.FieldList.identity"
  38. accesskey="N">next</a> |</li>
  39. <li class="right" >
  40. <a href="cf.FieldList.dump.html" title="cf.FieldList.dump"
  41. accesskey="P">previous</a> |</li>
  42. <li><a target="_blank" href="../../archive.html">Archive</a> &laquo;</li>
  43. <li><a target="_blank" href="http://cfpython.bitbucket.io">cf-python 2.0</a> &raquo;</li>
  44. <!--
  45. <li><a target="_blank" href="http://cfpython.bitbucket.io">cf-python</a> &raquo;</li>
  46. <li><select onchange="location = this.options[this.selectedIndex].value;">
  47. <option value="../../1.0/index.html">1.0
  48. <option value="../../0.9.9/index.html">0.9.9
  49. <option value="../../0.9.8.3/index.html">0.9.8.3
  50. <option value="../../archive.html">Archive
  51. </select>
  52. </li>
  53. -->
  54. <li class="nav-item nav-item-0"><a href="../index.html">Documentation</a> &#187;</li>
  55. <li class="nav-item nav-item-1"><a href="../reference.html" >Reference manual</a> &#187;</li>
  56. <li class="nav-item nav-item-2"><a href="../class.html" >Classes of the <code class="docutils literal"><span class="pre">cf</span></code> module</a> &#187;</li>
  57. <li class="nav-item nav-item-3"><a href="../classes/cf.FieldList.html" accesskey="U">cf.FieldList</a> &#187;</li>
  58. </ul>
  59. </div>
  60. <div class="document">
  61. <div class="documentwrapper">
  62. <div class="bodywrapper">
  63. <div class="body" role="main">
  64. <div class="section" id="cf-fieldlist-fill-value">
  65. <h1>cf.FieldList.fill_value<a class="headerlink" href="#cf-fieldlist-fill-value" title="Permalink to this headline">Âś</a></h1>
  66. <dl class="method">
  67. <dt id="cf.FieldList.fill_value">
  68. <code class="descclassname">FieldList.</code><code class="descname">fill_value</code><span class="sig-paren">(</span><em>default=None</em><span class="sig-paren">)</span><a class="reference external" href="https://bitbucket.org/cfpython/cf-python/src/v2.0/cf/variable.py#variable.py-5565"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cf.FieldList.fill_value" title="Permalink to this definition">Âś</a></dt>
  69. <dd><p>Return the data array missing data value.</p>
  70. <p>This is the value of the <code class="xref py py-obj docutils literal"><span class="pre">missing_value</span></code> CF property, or if that is
  71. not set, the value of the <code class="xref py py-obj docutils literal"><span class="pre">_FillValue</span></code> CF property, else if that is
  72. not set, <code class="docutils literal"><span class="pre">None</span></code>. In the last case the default <a class="reference external" href="https://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.13)"><code class="xref py py-obj docutils literal"><span class="pre">numpy</span></code></a> missing data
  73. value for the array&#8217;s data type is assumed if a missing data value is
  74. required.</p>
  75. <table class="docutils field-list" frame="void" rules="none">
  76. <col class="field-name" />
  77. <col class="field-body" />
  78. <tbody valign="top">
  79. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
  80. <dt>default</dt>
  81. <span class="classifier-delimiter">:</span> <span class="classifier"><em>optional</em></span><dd><p class="first">If the missing value is unset then return this value. By
  82. default, <em>default</em> is <a class="reference external" href="https://docs.python.org/2.7/library/constants.html#None" title="(in Python v2.7)"><code class="xref py py-obj docutils literal"><span class="pre">None</span></code></a>. If <em>default</em> is the special
  83. value <code class="docutils literal"><span class="pre">'netCDF'</span></code> then return the netCDF default value
  84. appropriate to the data array&#8217;s data type is used. These may
  85. be found as follows:</p>
  86. <div class="last highlight-python"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">netCDF4</span>
  87. <span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">netCDF4</span><span class="o">.</span><span class="n">default_fillvals</span>
  88. </pre></div>
  89. </div>
  90. </dd>
  91. </dl>
  92. </td>
  93. </tr>
  94. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first docutils">
  95. <dt>out :</dt>
  96. <dd><p class="first last">The missing data value, or the value specified by <em>default</em> if
  97. one has not been set.</p>
  98. </dd>
  99. </dl>
  100. </td>
  101. </tr>
  102. <tr class="field-odd field"><th class="field-name">Examples:</th><td class="field-body"></td>
  103. </tr>
  104. </tbody>
  105. </table>
  106. <div class="highlight-python"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">fill_value</span><span class="p">()</span>
  107. <span class="go">None</span>
  108. <span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">_FillValue</span> <span class="o">=</span> <span class="o">-</span><span class="mf">1e30</span>
  109. <span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">fill_value</span><span class="p">()</span>
  110. <span class="go">-1e30</span>
  111. <span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">missing_value</span> <span class="o">=</span> <span class="mi">1073741824</span>
  112. <span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">fill_value</span><span class="p">()</span>
  113. <span class="go">1073741824</span>
  114. <span class="gp">&gt;&gt;&gt; </span><span class="k">del</span> <span class="n">f</span><span class="o">.</span><span class="n">missing_value</span>
  115. <span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">fill_value</span><span class="p">()</span>
  116. <span class="go">-1e30</span>
  117. <span class="gp">&gt;&gt;&gt; </span><span class="k">del</span> <span class="n">f</span><span class="o">.</span><span class="n">_FillValue</span>
  118. <span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">fill_value</span><span class="p">()</span>
  119. <span class="go">None</span>
  120. <span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="p">,</span><span class="n">dtype</span>
  121. <span class="go">dtype(&#39;float64&#39;)</span>
  122. <span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">fill_value</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="s1">&#39;netCDF&#39;</span><span class="p">)</span>
  123. <span class="go">9.969209968386869e+36</span>
  124. <span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">_FillValue</span> <span class="o">=</span> <span class="o">-</span><span class="mi">999</span>
  125. <span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="o">.</span><span class="n">fill_value</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="s1">&#39;netCDF&#39;</span><span class="p">)</span>
  126. <span class="go">-999</span>
  127. </pre></div>
  128. </div>
  129. </dd></dl>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  135. <div class="sphinxsidebarwrapper">
  136. <h4>Previous topic</h4>
  137. <p class="topless"><a href="cf.FieldList.dump.html"
  138. title="previous chapter">cf.FieldList.dump</a></p>
  139. <h4>Next topic</h4>
  140. <p class="topless"><a href="cf.FieldList.identity.html"
  141. title="next chapter">cf.FieldList.identity</a></p>
  142. <div role="note" aria-label="source link">
  143. <h3>This Page</h3>
  144. <ul class="this-page-menu">
  145. <li><a href="../_sources/generated/cf.FieldList.fill_value.rst.txt"
  146. rel="nofollow">Show Source</a></li>
  147. </ul>
  148. </div>
  149. <div id="searchbox" style="display: none" role="search">
  150. <h3>Quick search</h3>
  151. <form class="search" action="../search.html" method="get">
  152. <div><input type="text" name="q" /></div>
  153. <div><input type="submit" value="Go" /></div>
  154. <input type="hidden" name="check_keywords" value="yes" />
  155. <input type="hidden" name="area" value="default" />
  156. </form>
  157. </div>
  158. <script type="text/javascript">$('#searchbox').show(0);</script>
  159. </div>
  160. </div>
  161. <div class="clearer"></div>
  162. </div>
  163. <div class="related" role="navigation" aria-label="related navigation">
  164. <h3>Navigation</h3>
  165. <ul>
  166. <li class="right" style="margin-right: 10px">
  167. <a href="../genindex.html" title="General Index"
  168. >index</a></li>
  169. <li class="right" >
  170. <a href="cf.FieldList.identity.html" title="cf.FieldList.identity"
  171. >next</a> |</li>
  172. <li class="right" >
  173. <a href="cf.FieldList.dump.html" title="cf.FieldList.dump"
  174. >previous</a> |</li>
  175. <li><a target="_blank" href="../../archive.html">Archive</a> &laquo;</li>
  176. <li><a target="_blank" href="http://cfpython.bitbucket.io">cf-python 2.0</a> &raquo;</li>
  177. <!--
  178. <li><a target="_blank" href="http://cfpython.bitbucket.io">cf-python</a> &raquo;</li>
  179. <li><select onchange="location = this.options[this.selectedIndex].value;">
  180. <option value="../../1.0/index.html">1.0
  181. <option value="../../0.9.9/index.html">0.9.9
  182. <option value="../../0.9.8.3/index.html">0.9.8.3
  183. <option value="../../archive.html">Archive
  184. </select>
  185. </li>
  186. -->
  187. <li class="nav-item nav-item-0"><a href="../index.html">Documentation</a> &#187;</li>
  188. <li class="nav-item nav-item-1"><a href="../reference.html" >Reference manual</a> &#187;</li>
  189. <li class="nav-item nav-item-2"><a href="../class.html" >Classes of the <code class="docutils literal"><span class="pre">cf</span></code> module</a> &#187;</li>
  190. <li class="nav-item nav-item-3"><a href="../classes/cf.FieldList.html" >cf.FieldList</a> &#187;</li>
  191. </ul>
  192. </div>
  193. <div class="footer" role="contentinfo">
  194. &#169; Copyright 2016, David Hassell.
  195. Last updated on Jul 07, 2017.
  196. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.1.
  197. </div>
  198. </body>
  199. </html>