Added: websites/staging/climate/trunk/content/api/current/ocw/dataset.html ============================================================================== --- websites/staging/climate/trunk/content/api/current/ocw/dataset.html (added) +++ websites/staging/climate/trunk/content/api/current/ocw/dataset.html Wed Jul 27 17:50:56 2016 @@ -0,0 +1,280 @@ +<!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"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>Dataset Module — Apache Open Climate Workbench 1.1.0 documentation</title> + + <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" /> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '../', + VERSION: '1.1.0', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </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> + <link rel="top" title="Apache Open Climate Workbench 1.1.0 documentation" href="../index.html" /> + <link rel="next" title="Dataset Processor Module" href="dataset_processor.html" /> + <link rel="prev" title="Overview" href="overview.html" /> + + + <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9"> + + </head> + <body role="document"> + <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="../http-routingtable.html" title="HTTP Routing Table" + >routing table</a> |</li> + <li class="right" > + <a href="../py-modindex.html" title="Python Module Index" + >modules</a> |</li> + <li class="right" > + <a href="dataset_processor.html" title="Dataset Processor Module" + accesskey="N">next</a> |</li> + <li class="right" > + <a href="overview.html" title="Overview" + accesskey="P">previous</a> |</li> + <li class="nav-item nav-item-0"><a href="../index.html">Apache Open Climate Workbench 1.1.0 documentation</a> »</li> + </ul> + </div> + + <div class="document"> + <div class="documentwrapper"> + <div class="bodywrapper"> + <div class="body" role="main"> + + <div class="section" id="dataset-module"> +<h1>Dataset Module<a class="headerlink" href="#dataset-module" title="Permalink to this headline">¶</a></h1> +<div class="section" id="bounds"> +<h2>Bounds<a class="headerlink" href="#bounds" title="Permalink to this headline">¶</a></h2> +<dl class="class"> +<dt id="dataset.Bounds"> +<em class="property">class </em><code class="descclassname">dataset.</code><code class="descname">Bounds</code><span class="sig-paren">(</span><em>lat_min</em>, <em>lat_max</em>, <em>lon_min</em>, <em>lon_max</em>, <em>start=None</em>, <em>end=None</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset.Bounds" title="Permalink to this definition">¶</a></dt> +<dd><p>Container for holding spatial and temporal bounds information.</p> +<p>Certain operations require valid bounding information to be present for +correct functioning. Bounds guarantees that a function receives well +formed information without the need to do the validation manually.</p> +<p>Spatial and temporal bounds must follow the following guidelines.</p> +<ul class="simple"> +<li>Latitude values must be in the range [-90, 90]</li> +<li>Longitude values must be in the range [-180, 180]</li> +<li>Lat/Lon Min values must be less than the corresponding Lat/Lon Max +values.</li> +<li>Temporal bounds must a valid datetime object</li> +</ul> +<p>Default Bounds constructor</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>lat_min</strong> (<a class="reference external" href="http://docs.python.org/2/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) – The minimum latitude bound.</li> +<li><strong>lat_max</strong> (<a class="reference external" href="http://docs.python.org/2/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) – The maximum latitude bound.</li> +<li><strong>lon_min</strong> (<a class="reference external" href="http://docs.python.org/2/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) – The minimum longitude bound.</li> +<li><strong>lon_max</strong> (<a class="reference external" href="http://docs.python.org/2/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>) – The maximum longitude bound.</li> +<li><strong>start</strong> (<a class="reference external" href="http://docs.python.org/2/library/datetime.html#datetime.datetime" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">datetime.datetime</span></code></a>) – An optional datetime object for the starting +datetime bound.</li> +<li><strong>end</strong> (<a class="reference external" href="http://docs.python.org/2/library/datetime.html#datetime.datetime" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">datetime.datetime</span></code></a>) – An optional datetime object for the ending datetime bound.</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">ValueError</p> +</td> +</tr> +</tbody> +</table> +</dd></dl> + +</div> +<div class="section" id="dataset"> +<h2>Dataset<a class="headerlink" href="#dataset" title="Permalink to this headline">¶</a></h2> +<dl class="class"> +<dt id="dataset.Dataset"> +<em class="property">class </em><code class="descclassname">dataset.</code><code class="descname">Dataset</code><span class="sig-paren">(</span><em>lats</em>, <em>lons</em>, <em>times</em>, <em>values</em>, <em>variable=None</em>, <em>units=None</em>, <em>origin=None</em>, <em>name=''</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset.Dataset" title="Permalink to this definition">¶</a></dt> +<dd><p>Container for a dataset’s attributes and data.</p> +<p>Default Dataset constructor</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>lats</strong> (<a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.11)"><code class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></code></a>) – One dimensional numpy array of unique latitude values.</li> +<li><strong>lons</strong> (<a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.11)"><code class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></code></a>) – One dimensional numpy array of unique longitude values.</li> +<li><strong>times</strong> (<a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.11)"><code class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></code></a>) – One dimensional numpy array of unique python datetime +objects.</li> +<li><strong>values</strong> (<a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.11)"><code class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></code></a>) – Three dimensional numpy array of parameter values with +shape [timesLength, latsLength, lonsLength].</li> +<li><strong>variable</strong> (<a class="reference external" href="http://docs.python.org/2/library/string.html#module-string" title="(in Python v2.7)"><code class="xref py py-mod docutils literal"><span class="pre">string</span></code></a>) – Name of the value variable.</li> +<li><strong>units</strong> (<a class="reference external" href="http://docs.python.org/2/library/string.html#module-string" title="(in Python v2.7)"><code class="xref py py-mod docutils literal"><span class="pre">string</span></code></a>) – Name of the value units</li> +<li><strong>name</strong> (<a class="reference external" href="http://docs.python.org/2/library/string.html#module-string" title="(in Python v2.7)"><code class="xref py py-mod docutils literal"><span class="pre">string</span></code></a>) – An optional string name for the Dataset.</li> +<li><strong>origin</strong> (<a class="reference external" href="http://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a>) – An optional object used to specify information on where +this dataset was loaded from.</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">ValueError</p> +</td> +</tr> +</tbody> +</table> +<dl class="method"> +<dt id="dataset.Dataset.spatial_boundaries"> +<code class="descname">spatial_boundaries</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#dataset.Dataset.spatial_boundaries" title="Permalink to this definition">¶</a></dt> +<dd><p>Calculate the spatial boundaries.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The Dataset’s bounding latitude and longitude values as a +tuple in the form (min_lat, max_lat, min_lon, max_lon)</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/2/library/functions.html#tuple" title="(in Python v2.7)"><code class="xref py py-func docutils literal"><span class="pre">tuple()</span></code></a> of the form (<a class="reference external" href="http://docs.python.org/2/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>, <a class="reference external" href="http://docs.python.org/2/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>, +<a class="reference external" href="http://docs.python.org/2/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>, <a class="reference external" href="http://docs.python.org/2/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>).</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="method"> +<dt id="dataset.Dataset.spatial_resolution"> +<code class="descname">spatial_resolution</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#dataset.Dataset.spatial_resolution" title="Permalink to this definition">¶</a></dt> +<dd><p>Calculate the latitudinal and longitudinal spatial resolution.</p> +<blockquote> +<div>If self.lats and self.lons are from curvilinear coordinates, +the output resolutions are approximate values.</div></blockquote> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The Dataset’s latitudinal and longitudinal spatial resolution +as a tuple of the form (lat_resolution, lon_resolution).</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">(<a class="reference external" href="http://docs.python.org/2/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>, <a class="reference external" href="http://docs.python.org/2/library/functions.html#float" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">float</span></code></a>)</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="method"> +<dt id="dataset.Dataset.temporal_resolution"> +<code class="descname">temporal_resolution</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#dataset.Dataset.temporal_resolution" title="Permalink to this definition">¶</a></dt> +<dd><p>Calculate the temporal resolution.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name" colspan="2">Raises ValueError:</th></tr> +<tr class="field-odd field"><td> </td><td class="field-body">If timedelta.days as calculated from the sorted list of times is an unrecognized value a ValueError is raised.</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The temporal resolution.</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/2/library/string.html#module-string" title="(in Python v2.7)"><code class="xref py py-mod docutils literal"><span class="pre">string</span></code></a></td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="method"> +<dt id="dataset.Dataset.time_range"> +<code class="descname">time_range</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#dataset.Dataset.time_range" title="Permalink to this definition">¶</a></dt> +<dd><p>Calculate the temporal range</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The start and end date of the Dataset’s temporal range as +a tuple in the form (start_time, end_time).</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/2/library/functions.html#tuple" title="(in Python v2.7)"><code class="xref py py-func docutils literal"><span class="pre">tuple()</span></code></a> of the form (<a class="reference external" href="http://docs.python.org/2/library/datetime.html#datetime.datetime" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">datetime.datetime</span></code></a>, +<a class="reference external" href="http://docs.python.org/2/library/datetime.html#datetime.datetime" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">datetime.datetime</span></code></a>)</td> +</tr> +</tbody> +</table> +</dd></dl> + +</dd></dl> + +</div> +</div> + + + </div> + </div> + </div> + <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> + <div class="sphinxsidebarwrapper"> + <p class="logo"><a href="../index.html"> + <img class="logo" src="../_static/ocw-logo-variant-sm-01-01-new.png" alt="Logo"/> + </a></p> + <h3><a href="../index.html">Table Of Contents</a></h3> + <ul> +<li><a class="reference internal" href="#">Dataset Module</a><ul> +<li><a class="reference internal" href="#bounds">Bounds</a></li> +<li><a class="reference internal" href="#dataset">Dataset</a></li> +</ul> +</li> +</ul> + + <h4>Previous topic</h4> + <p class="topless"><a href="overview.html" + title="previous chapter">Overview</a></p> + <h4>Next topic</h4> + <p class="topless"><a href="dataset_processor.html" + title="next chapter">Dataset Processor Module</a></p> + <div role="note" aria-label="source link"> + <h3>This Page</h3> + <ul class="this-page-menu"> + <li><a href="../_sources/ocw/dataset.txt" + rel="nofollow">Show Source</a></li> + </ul> + </div> +<div id="searchbox" style="display: none" role="search"> + <h3>Quick search</h3> + <form class="search" action="../search.html" method="get"> + <input type="text" name="q" /> + <input type="submit" value="Go" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> + <p class="searchtip" style="font-size: 90%"> + Enter search terms or a module, class or function name. + </p> +</div> +<script type="text/javascript">$('#searchbox').show(0);</script> + </div> + </div> + <div class="clearer"></div> + </div> + <div class="footer"> + ©2016, Apache Software Foundation. + + | + Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a> + & <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.4</a> + + | + <a href="../_sources/ocw/dataset.txt" + rel="nofollow">Page source</a></li> + </div> + + + + + </body> +</html> \ No newline at end of file
Added: websites/staging/climate/trunk/content/api/current/ocw/dataset_processor.html ============================================================================== --- websites/staging/climate/trunk/content/api/current/ocw/dataset_processor.html (added) +++ websites/staging/climate/trunk/content/api/current/ocw/dataset_processor.html Wed Jul 27 17:50:56 2016 @@ -0,0 +1,449 @@ +<!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"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>Dataset Processor Module — Apache Open Climate Workbench 1.1.0 documentation</title> + + <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" /> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '../', + VERSION: '1.1.0', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </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> + <link rel="top" title="Apache Open Climate Workbench 1.1.0 documentation" href="../index.html" /> + <link rel="next" title="Evaluation Module" href="evaluation.html" /> + <link rel="prev" title="Dataset Module" href="dataset.html" /> + + + <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9"> + + </head> + <body role="document"> + <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="../http-routingtable.html" title="HTTP Routing Table" + >routing table</a> |</li> + <li class="right" > + <a href="../py-modindex.html" title="Python Module Index" + >modules</a> |</li> + <li class="right" > + <a href="evaluation.html" title="Evaluation Module" + accesskey="N">next</a> |</li> + <li class="right" > + <a href="dataset.html" title="Dataset Module" + accesskey="P">previous</a> |</li> + <li class="nav-item nav-item-0"><a href="../index.html">Apache Open Climate Workbench 1.1.0 documentation</a> »</li> + </ul> + </div> + + <div class="document"> + <div class="documentwrapper"> + <div class="bodywrapper"> + <div class="body" role="main"> + + <div class="section" id="module-dataset_processor"> +<span id="dataset-processor-module"></span><h1>Dataset Processor Module<a class="headerlink" href="#module-dataset_processor" title="Permalink to this headline">¶</a></h1> +<dl class="function"> +<dt id="dataset_processor.ensemble"> +<code class="descclassname">dataset_processor.</code><code class="descname">ensemble</code><span class="sig-paren">(</span><em>datasets</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.ensemble" title="Permalink to this definition">¶</a></dt> +<dd><p>Generate a single dataset which is the mean of the input datasets</p> +<p>An ensemble datasets combines input datasets assuming the all have +similar shape, dimensions, and units.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>datasets</strong> – Datasets to be used to compose the ensemble dataset from. +All Datasets must be the same shape.</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a></td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.mask_missing_data"> +<code class="descclassname">dataset_processor.</code><code class="descname">mask_missing_data</code><span class="sig-paren">(</span><em>dataset_array</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.mask_missing_data" title="Permalink to this definition">¶</a></dt> +<dd><p>Check missing values in observation and model datasets. +If any of dataset in dataset_array has missing values at a grid point, +the values at the grid point in all other datasets are masked. +:param dataset_array: an array of OCW datasets</p> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.normalize_dataset_datetimes"> +<code class="descclassname">dataset_processor.</code><code class="descname">normalize_dataset_datetimes</code><span class="sig-paren">(</span><em>dataset</em>, <em>timestep</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.normalize_dataset_datetimes" title="Permalink to this definition">¶</a></dt> +<dd><p>Normalize Dataset datetime values.</p> +<p>Force daily to an hour time value of 00:00:00. +Force monthly data to the first of the month at midnight.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>dataset</strong> (<a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – The Dataset which will have its time value normalized.</li> +<li><strong>timestep</strong> (<a class="reference external" href="http://docs.python.org/2/library/string.html#module-string" title="(in Python v2.7)"><code class="xref py py-mod docutils literal"><span class="pre">string</span></code></a>) – The timestep of the Dataset’s values. Either ‘daily’ or +‘monthly’.</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A new Dataset with normalized datetime values.</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a></p> +</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.safe_subset"> +<code class="descclassname">dataset_processor.</code><code class="descname">safe_subset</code><span class="sig-paren">(</span><em>subregion</em>, <em>target_dataset</em>, <em>subregion_name=None</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.safe_subset" title="Permalink to this definition">¶</a></dt> +<dd><p>Safely subset given dataset with subregion information</p> +<p>A standard subset requires that the provided subregion be entirely +contained within the datasets bounds. <cite>safe_subset</cite> returns the +overlap of the subregion and dataset without returning an error.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>subregion</strong> (<a class="reference internal" href="dataset.html#dataset.Bounds" title="dataset.Bounds"><code class="xref py py-class docutils literal"><span class="pre">dataset.Bounds</span></code></a>) – The Bounds with which to subset the target Dataset.</li> +<li><strong>target_dataset</strong> (<a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – The Dataset object to subset.</li> +<li><strong>subregion_name</strong> (<a class="reference external" href="http://docs.python.org/2/library/string.html#module-string" title="(in Python v2.7)"><code class="xref py py-mod docutils literal"><span class="pre">string</span></code></a>) – The subset-ed Dataset name</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The subset-ed Dataset object</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a></p> +</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.spatial_regrid"> +<code class="descclassname">dataset_processor.</code><code class="descname">spatial_regrid</code><span class="sig-paren">(</span><em>target_dataset</em>, <em>new_latitudes</em>, <em>new_longitudes</em>, <em>boundary_check=True</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.spatial_regrid" title="Permalink to this definition">¶</a></dt> +<dd><p>Regrid a Dataset using the new latitudes and longitudes</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>target_dataset</strong> (<a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – Dataset object that needs spatially regridded</li> +<li><strong>new_latitudes</strong> (<a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.11)"><code class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></code></a>) – Array of latitudes</li> +<li><strong>new_longitudes</strong> (<a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.11)"><code class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></code></a>) – Array of longitudes</li> +<li><strong>boundary_check</strong> (<em>:class:’bool’</em>) – Check if the regriding domain’s boundaries +are outside target_dataset’s domain</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A new spatially regridded Dataset</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a></p> +</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.subset"> +<code class="descclassname">dataset_processor.</code><code class="descname">subset</code><span class="sig-paren">(</span><em>subregion</em>, <em>target_dataset</em>, <em>subregion_name=None</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.subset" title="Permalink to this definition">¶</a></dt> +<dd><p>Subset given dataset(s) with subregion information</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>subregion</strong> (<a class="reference internal" href="dataset.html#dataset.Bounds" title="dataset.Bounds"><code class="xref py py-class docutils literal"><span class="pre">dataset.Bounds</span></code></a>) – The Bounds with which to subset the target Dataset.</li> +<li><strong>target_dataset</strong> (<a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – The Dataset object to subset.</li> +<li><strong>subregion_name</strong> (<a class="reference external" href="http://docs.python.org/2/library/string.html#module-string" title="(in Python v2.7)"><code class="xref py py-mod docutils literal"><span class="pre">string</span></code></a>) – The subset-ed Dataset name</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The subset-ed Dataset object</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a></p> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">ValueError</p> +</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.temperature_unit_conversion"> +<code class="descclassname">dataset_processor.</code><code class="descname">temperature_unit_conversion</code><span class="sig-paren">(</span><em>dataset</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.temperature_unit_conversion" title="Permalink to this definition">¶</a></dt> +<dd><p>Convert temperature units as necessary</p> +<p>Automatically convert Celcius to Kelvin in the given dataset.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>dataset</strong> – The dataset for which units should be updated.</td> +</tr> +</tbody> +</table> +<p>:type dataset; <a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a></p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The dataset with (potentially) updated units.</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a></td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.temporal_rebin"> +<code class="descclassname">dataset_processor.</code><code class="descname">temporal_rebin</code><span class="sig-paren">(</span><em>target_dataset</em>, <em>temporal_resolution</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.temporal_rebin" title="Permalink to this definition">¶</a></dt> +<dd><p>Rebin a Dataset to a new temporal resolution</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>target_dataset</strong> (<a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – Dataset object that needs temporal rebinned</li> +<li><strong>temporal_resolution</strong> (<a class="reference external" href="http://docs.python.org/2/library/string.html#module-string" title="(in Python v2.7)"><code class="xref py py-mod docutils literal"><span class="pre">string</span></code></a>) – The new temporal resolution</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A new temporally rebinned Dataset</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a></p> +</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.temporal_rebin_with_time_index"> +<code class="descclassname">dataset_processor.</code><code class="descname">temporal_rebin_with_time_index</code><span class="sig-paren">(</span><em>target_dataset</em>, <em>nt_average</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.temporal_rebin_with_time_index" title="Permalink to this definition">¶</a></dt> +<dd><p>Rebin a Dataset to a new temporal resolution</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>target_dataset</strong> (<a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – Dataset object that needs temporal rebinned</li> +<li><strong>nt_average</strong> – Time resolution for the output datasets. +It is the same as the number of time indicies to be averaged. +length of time dimension in the rebinned dataset) = +(original time dimension length/nt_average)</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A new temporally rebinned Dataset</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a></p> +</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.temporal_slice"> +<code class="descclassname">dataset_processor.</code><code class="descname">temporal_slice</code><span class="sig-paren">(</span><em>start_time_index</em>, <em>end_time_index</em>, <em>target_dataset</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.temporal_slice" title="Permalink to this definition">¶</a></dt> +<dd><p>Temporally slice given dataset(s) with subregion information. This does not +spatially subset the target_Dataset</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>start_time_index</strong> (<em>:class:’int’</em>) – time index of the start time</li> +<li><strong>end_time_index</strong> (<em>:class:’int’</em>) – time index of the end time</li> +<li><strong>target_dataset</strong> (<a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – The Dataset object to subset.</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The subset-ed Dataset object</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a></p> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">ValueError</p> +</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.temporal_subset"> +<code class="descclassname">dataset_processor.</code><code class="descname">temporal_subset</code><span class="sig-paren">(</span><em>month_start</em>, <em>month_end</em>, <em>target_dataset</em>, <em>average_each_year=False</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.temporal_subset" title="Permalink to this definition">¶</a></dt> +<dd><p>Temporally subset data given month_index.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>month_start</strong> (<a class="reference external" href="http://docs.python.org/2/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) – An integer for beginning month (Jan=1)</li> +<li><strong>month_end</strong> (<a class="reference external" href="http://docs.python.org/2/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>) – An integer for ending month (Jan=1)</li> +<li><strong>target_dataset</strong> (<em>Open Climate Workbench Dataset Object</em>) – Dataset object that needs temporal subsetting</li> +<li><strong>average_each_year</strong> (<em>:class:’boolean’</em>) – If True, output dataset is averaged for each year</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A temporal subset OCW Dataset</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">Open Climate Workbench Dataset Object</p> +</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.variable_unit_conversion"> +<code class="descclassname">dataset_processor.</code><code class="descname">variable_unit_conversion</code><span class="sig-paren">(</span><em>dataset</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.variable_unit_conversion" title="Permalink to this definition">¶</a></dt> +<dd><p>Convert water flux or temperature variables units as necessary</p> +<p>For water flux variables, convert full SI units water flux units +to more common units. +For temperature, convert Celcius to Kelvin.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>dataset</strong> (<a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – The dataset to convert.</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A Dataset with values converted to new units.</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a></td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.water_flux_unit_conversion"> +<code class="descclassname">dataset_processor.</code><code class="descname">water_flux_unit_conversion</code><span class="sig-paren">(</span><em>dataset</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.water_flux_unit_conversion" title="Permalink to this definition">¶</a></dt> +<dd><p>Convert water flux variables units as necessary</p> +<p>Convert full SI units water flux units to more common units.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>dataset</strong> (<a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – The dataset to convert.</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A Dataset with values converted to new units.</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a></td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="dataset_processor.write_netcdf"> +<code class="descclassname">dataset_processor.</code><code class="descname">write_netcdf</code><span class="sig-paren">(</span><em>dataset</em>, <em>path</em>, <em>compress=True</em><span class="sig-paren">)</span><a class="headerlink" href="#dataset_processor.write_netcdf" title="Permalink to this definition">¶</a></dt> +<dd><p>Write a dataset to a NetCDF file.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> +<li><strong>dataset</strong> (<a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – The dataset to write.</li> +<li><strong>path</strong> (<a class="reference external" href="http://docs.python.org/2/library/string.html#module-string" title="(in Python v2.7)"><code class="xref py py-mod docutils literal"><span class="pre">string</span></code></a>) – The output file path.</li> +</ul> +</td> +</tr> +</tbody> +</table> +</dd></dl> + +</div> + + + </div> + </div> + </div> + <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> + <div class="sphinxsidebarwrapper"> + <p class="logo"><a href="../index.html"> + <img class="logo" src="../_static/ocw-logo-variant-sm-01-01-new.png" alt="Logo"/> + </a></p> + <h4>Previous topic</h4> + <p class="topless"><a href="dataset.html" + title="previous chapter">Dataset Module</a></p> + <h4>Next topic</h4> + <p class="topless"><a href="evaluation.html" + title="next chapter">Evaluation Module</a></p> + <div role="note" aria-label="source link"> + <h3>This Page</h3> + <ul class="this-page-menu"> + <li><a href="../_sources/ocw/dataset_processor.txt" + rel="nofollow">Show Source</a></li> + </ul> + </div> +<div id="searchbox" style="display: none" role="search"> + <h3>Quick search</h3> + <form class="search" action="../search.html" method="get"> + <input type="text" name="q" /> + <input type="submit" value="Go" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> + <p class="searchtip" style="font-size: 90%"> + Enter search terms or a module, class or function name. + </p> +</div> +<script type="text/javascript">$('#searchbox').show(0);</script> + </div> + </div> + <div class="clearer"></div> + </div> + <div class="footer"> + ©2016, Apache Software Foundation. + + | + Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a> + & <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.4</a> + + | + <a href="../_sources/ocw/dataset_processor.txt" + rel="nofollow">Page source</a></li> + </div> + + + + + </body> +</html> \ No newline at end of file Added: websites/staging/climate/trunk/content/api/current/ocw/evaluation.html ============================================================================== --- websites/staging/climate/trunk/content/api/current/ocw/evaluation.html (added) +++ websites/staging/climate/trunk/content/api/current/ocw/evaluation.html Wed Jul 27 17:50:56 2016 @@ -0,0 +1,292 @@ +<!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"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>Evaluation Module — Apache Open Climate Workbench 1.1.0 documentation</title> + + <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" /> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '../', + VERSION: '1.1.0', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </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> + <link rel="top" title="Apache Open Climate Workbench 1.1.0 documentation" href="../index.html" /> + <link rel="next" title="Metrics Module" href="metrics.html" /> + <link rel="prev" title="Dataset Processor Module" href="dataset_processor.html" /> + + + <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9"> + + </head> + <body role="document"> + <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="../http-routingtable.html" title="HTTP Routing Table" + >routing table</a> |</li> + <li class="right" > + <a href="../py-modindex.html" title="Python Module Index" + >modules</a> |</li> + <li class="right" > + <a href="metrics.html" title="Metrics Module" + accesskey="N">next</a> |</li> + <li class="right" > + <a href="dataset_processor.html" title="Dataset Processor Module" + accesskey="P">previous</a> |</li> + <li class="nav-item nav-item-0"><a href="../index.html">Apache Open Climate Workbench 1.1.0 documentation</a> »</li> + </ul> + </div> + + <div class="document"> + <div class="documentwrapper"> + <div class="bodywrapper"> + <div class="body" role="main"> + + <div class="section" id="evaluation-module"> +<h1>Evaluation Module<a class="headerlink" href="#evaluation-module" title="Permalink to this headline">¶</a></h1> +<dl class="class"> +<dt id="evaluation.Evaluation"> +<em class="property">class </em><code class="descclassname">evaluation.</code><code class="descname">Evaluation</code><span class="sig-paren">(</span><em>reference</em>, <em>targets</em>, <em>metrics</em>, <em>subregions=None</em><span class="sig-paren">)</span><a class="headerlink" href="#evaluation.Evaluation" title="Permalink to this definition">¶</a></dt> +<dd><p>Container for running an evaluation</p> +<p>An <em>Evaluation</em> is the running of one or more metrics on one or more +target datasets and a (possibly optional) reference dataset. Evaluation +can handle two types of metrics, <code class="docutils literal"><span class="pre">unary</span></code> and <code class="docutils literal"><span class="pre">binary</span></code>. The validity +of an Evaluation is dependent upon the number and type of metrics as well +as the number of datasets.</p> +<p>A <code class="docutils literal"><span class="pre">unary</span></code> metric is a metric that runs over a single dataset. If you add +a <code class="docutils literal"><span class="pre">unary</span></code> metric to the Evaluation you are only required to add a +reference dataset or a target dataset. If there are multiple datasets +in the evaluation then the <code class="docutils literal"><span class="pre">unary</span></code> metric is run over all of them.</p> +<p>A <code class="docutils literal"><span class="pre">binary</span></code> metric is a metric that runs over a reference dataset and +target dataset. If you add a <code class="docutils literal"><span class="pre">binary</span></code> metric you are required to add a +reference dataset and at least one target dataset. The <code class="docutils literal"><span class="pre">binary</span></code> metrics +are run over every (reference dataset, target dataset) pair in the +Evaluation.</p> +<p>An Evaluation must have at least one metric to be valid.</p> +<p>Default Evaluation constructor.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>reference</strong> (<a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – The reference Dataset for the evaluation.</li> +<li><strong>targets</strong> (<a class="reference external" href="http://docs.python.org/2/library/functions.html#list" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">list</span></code></a> of <a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – A list of one or more target datasets for the +evaluation.</li> +<li><strong>metrics</strong> (<a class="reference external" href="http://docs.python.org/2/library/functions.html#list" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">list</span></code></a> of <a class="reference internal" href="metrics.html#module-metrics" title="metrics"><code class="xref py py-mod docutils literal"><span class="pre">metrics</span></code></a>) – A list of one or more Metric instances to run +in the evaluation.</li> +<li><strong>subregions</strong> (<a class="reference external" href="http://docs.python.org/2/library/functions.html#list" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">list</span></code></a> of <a class="reference internal" href="dataset.html#dataset.Bounds" title="dataset.Bounds"><code class="xref py py-class docutils literal"><span class="pre">dataset.Bounds</span></code></a>) – (Optional) Subregion information to use in the +evaluation. A subregion is specified with a Bounds object.</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">ValueError</p> +</td> +</tr> +</tbody> +</table> +<dl class="method"> +<dt id="evaluation.Evaluation.add_dataset"> +<code class="descname">add_dataset</code><span class="sig-paren">(</span><em>target_dataset</em><span class="sig-paren">)</span><a class="headerlink" href="#evaluation.Evaluation.add_dataset" title="Permalink to this definition">¶</a></dt> +<dd><p>Add a Dataset to the Evaluation.</p> +<p>A target Dataset is compared against the reference dataset when the +Evaluation is run with one or more metrics.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>target_dataset</strong> (<a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – The target Dataset to add to the Evaluation.</td> +</tr> +<tr class="field-even field"><th class="field-name" colspan="2">Raises ValueError:</th></tr> +<tr class="field-even field"><td> </td><td class="field-body">If a dataset to add isn’t an instance of Dataset.</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="method"> +<dt id="evaluation.Evaluation.add_datasets"> +<code class="descname">add_datasets</code><span class="sig-paren">(</span><em>target_datasets</em><span class="sig-paren">)</span><a class="headerlink" href="#evaluation.Evaluation.add_datasets" title="Permalink to this definition">¶</a></dt> +<dd><p>Add multiple Datasets to the Evaluation.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>target_datasets</strong> (<a class="reference external" href="http://docs.python.org/2/library/functions.html#list" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">list</span></code></a> of <a class="reference internal" href="dataset.html#dataset.Dataset" title="dataset.Dataset"><code class="xref py py-class docutils literal"><span class="pre">dataset.Dataset</span></code></a>) – The list of datasets that should be added to +the Evaluation.</td> +</tr> +<tr class="field-even field"><th class="field-name" colspan="2">Raises ValueError:</th></tr> +<tr class="field-even field"><td> </td><td class="field-body">If a dataset to add isn’t an instance of Dataset.</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="method"> +<dt id="evaluation.Evaluation.add_metric"> +<code class="descname">add_metric</code><span class="sig-paren">(</span><em>metric</em><span class="sig-paren">)</span><a class="headerlink" href="#evaluation.Evaluation.add_metric" title="Permalink to this definition">¶</a></dt> +<dd><p>Add a metric to the Evaluation.</p> +<p>A metric is an instance of a class which inherits from metrics.Metric.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>metric</strong> (<a class="reference internal" href="metrics.html#module-metrics" title="metrics"><code class="xref py py-mod docutils literal"><span class="pre">metrics</span></code></a>) – The metric instance to add to the Evaluation.</td> +</tr> +<tr class="field-even field"><th class="field-name" colspan="2">Raises ValueError:</th></tr> +<tr class="field-even field"><td> </td><td class="field-body">If the metric to add isn’t a class that inherits +from metrics.Metric.</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="method"> +<dt id="evaluation.Evaluation.add_metrics"> +<code class="descname">add_metrics</code><span class="sig-paren">(</span><em>metrics</em><span class="sig-paren">)</span><a class="headerlink" href="#evaluation.Evaluation.add_metrics" title="Permalink to this definition">¶</a></dt> +<dd><p>Add multiple metrics to the Evaluation.</p> +<p>A metric is an instance of a class which inherits from metrics.Metric.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>metrics</strong> (<a class="reference external" href="http://docs.python.org/2/library/functions.html#list" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">list</span></code></a> of <a class="reference internal" href="metrics.html#module-metrics" title="metrics"><code class="xref py py-mod docutils literal"><span class="pre">metrics</span></code></a>) – The list of metric instances to add to the Evaluation.</td> +</tr> +<tr class="field-even field"><th class="field-name" colspan="2">Raises ValueError:</th></tr> +<tr class="field-even field"><td> </td><td class="field-body">If a metric to add isn’t a class that inherits +from metrics.Metric.</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="attribute"> +<dt id="evaluation.Evaluation.metrics"> +<code class="descname">metrics</code><em class="property"> = None</em><a class="headerlink" href="#evaluation.Evaluation.metrics" title="Permalink to this definition">¶</a></dt> +<dd><p>The list of “binary” metrics (A metric which takes two Datasets) +that the Evaluation should use.</p> +</dd></dl> + +<dl class="attribute"> +<dt id="evaluation.Evaluation.results"> +<code class="descname">results</code><em class="property"> = None</em><a class="headerlink" href="#evaluation.Evaluation.results" title="Permalink to this definition">¶</a></dt> +<dd><p>A list containing the results of running regular metric evaluations. +The shape of results is <code class="docutils literal"><span class="pre">(num_target_datasets,</span> <span class="pre">num_metrics)</span></code> if +the user doesn’t specify subregion information. Otherwise the shape +is <code class="docutils literal"><span class="pre">(num_target_datasets,</span> <span class="pre">num_metrics,</span> <span class="pre">num_subregions)</span></code>.</p> +</dd></dl> + +<dl class="method"> +<dt id="evaluation.Evaluation.run"> +<code class="descname">run</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#evaluation.Evaluation.run" title="Permalink to this definition">¶</a></dt> +<dd><p>Run the evaluation.</p> +<p>There are two phases to a run of the Evaluation. First, if there are +any “binary” metrics they are run through the evaluation. Binary +metrics are only run if there is a reference dataset and at least one +target dataset.</p> +<p>If there is subregion information provided then each dataset is subset +before being run through the binary metrics.</p> +<p>..note:: Only the binary metrics are subset with subregion information.</p> +<p>Next, if there are any “unary” metrics they are run. Unary metrics are +only run if there is at least one target dataset or a reference dataset.</p> +</dd></dl> + +<dl class="attribute"> +<dt id="evaluation.Evaluation.target_datasets"> +<code class="descname">target_datasets</code><em class="property"> = None</em><a class="headerlink" href="#evaluation.Evaluation.target_datasets" title="Permalink to this definition">¶</a></dt> +<dd><p>The target dataset(s) which should each be compared with +the reference dataset when the evaluation is run.</p> +</dd></dl> + +<dl class="attribute"> +<dt id="evaluation.Evaluation.unary_metrics"> +<code class="descname">unary_metrics</code><em class="property"> = None</em><a class="headerlink" href="#evaluation.Evaluation.unary_metrics" title="Permalink to this definition">¶</a></dt> +<dd><p>The list of “unary” metrics (A metric which takes one Dataset) that +the Evaluation should use.</p> +</dd></dl> + +<dl class="attribute"> +<dt id="evaluation.Evaluation.unary_results"> +<code class="descname">unary_results</code><em class="property"> = None</em><a class="headerlink" href="#evaluation.Evaluation.unary_results" title="Permalink to this definition">¶</a></dt> +<dd><p>A list containing the results of running the unary metric +evaluations. The shape of unary_results is +<code class="docutils literal"><span class="pre">(num_targets,</span> <span class="pre">num_metrics)</span></code> where <code class="docutils literal"><span class="pre">num_targets</span> <span class="pre">=</span> +<span class="pre">num_target_ds</span> <span class="pre">+</span> <span class="pre">(1</span> <span class="pre">if</span> <span class="pre">ref_dataset</span> <span class="pre">!=</span> <span class="pre">None</span> <span class="pre">else</span> <span class="pre">0</span></code></p> +</dd></dl> + +</dd></dl> + +</div> + + + </div> + </div> + </div> + <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> + <div class="sphinxsidebarwrapper"> + <p class="logo"><a href="../index.html"> + <img class="logo" src="../_static/ocw-logo-variant-sm-01-01-new.png" alt="Logo"/> + </a></p> + <h4>Previous topic</h4> + <p class="topless"><a href="dataset_processor.html" + title="previous chapter">Dataset Processor Module</a></p> + <h4>Next topic</h4> + <p class="topless"><a href="metrics.html" + title="next chapter">Metrics Module</a></p> + <div role="note" aria-label="source link"> + <h3>This Page</h3> + <ul class="this-page-menu"> + <li><a href="../_sources/ocw/evaluation.txt" + rel="nofollow">Show Source</a></li> + </ul> + </div> +<div id="searchbox" style="display: none" role="search"> + <h3>Quick search</h3> + <form class="search" action="../search.html" method="get"> + <input type="text" name="q" /> + <input type="submit" value="Go" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> + <p class="searchtip" style="font-size: 90%"> + Enter search terms or a module, class or function name. + </p> +</div> +<script type="text/javascript">$('#searchbox').show(0);</script> + </div> + </div> + <div class="clearer"></div> + </div> + <div class="footer"> + ©2016, Apache Software Foundation. + + | + Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a> + & <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.4</a> + + | + <a href="../_sources/ocw/evaluation.txt" + rel="nofollow">Page source</a></li> + </div> + + + + + </body> +</html> \ No newline at end of file