blob: 30c90cc7b0081214eb2501bb812cf9f251dbc126 [file] [log] [blame]
<!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 &mdash; Apache Open Climate Workbench 0.3-incubating documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.3-incubating',
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 0.3-incubating documentation" href="../index.html" />
<link rel="next" title="Evaluation Module" href="evaluation.html" />
<link rel="prev" title="Dataset Module" href="dataset.html" />
</head>
<body>
<div class="related">
<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><a href="../index.html">Apache Open Climate Workbench 0.3-incubating documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<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">
<tt class="descclassname">dataset_processor.</tt><tt class="descname">ensemble</tt><big>(</big><em>datasets</em><big>)</big><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>
<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> &#8211; Datasets to be used to compose the ensemble dataset from.</td>
</tr>
</tbody>
</table>
<p>Note - All Datasets must be the same shape
:type datasets: List of OCW Dataset Objects</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">New Dataset with a name of &#8216;Dataset Ensemble&#8217;</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">OCW Dataset Object</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="dataset_processor.normalize_dataset_datetimes">
<tt class="descclassname">dataset_processor.</tt><tt class="descname">normalize_dataset_datetimes</tt><big>(</big><em>dataset</em>, <em>timestep</em><big>)</big><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> (<em>Dataset</em>) &#8211; The Dataset which will have its&#8217; time value normalized.</li>
<li><strong>timestep</strong> (<em>String</em>) &#8211; The timestep of the Dataset&#8217;s values. Either &#8216;daily&#8217; or
&#8216;monthly&#8217;.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A new Dataset with normalized datetimes.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="dataset_processor.safe_subset">
<tt class="descclassname">dataset_processor.</tt><tt class="descname">safe_subset</tt><big>(</big><em>subregion</em>, <em>target_dataset</em><big>)</big><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> (<em>ocw.dataset.Bounds</em>) &#8211; The Bounds with which to subset the target Dataset.</li>
<li><strong>target_dataset</strong> (<em>ocw.dataset.Dataset</em>) &#8211; 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 last">Dataset</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="dataset_processor.spatial_regrid">
<tt class="descclassname">dataset_processor.</tt><tt class="descname">spatial_regrid</tt><big>(</big><em>target_dataset</em>, <em>new_latitudes</em>, <em>new_longitudes</em><big>)</big><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> (<em>Open Climate Workbench Dataset Object</em>) &#8211; Dataset object that needs temporal regridding applied</li>
<li><strong>new_latitudes</strong> (<em>1d Numpy Array</em>) &#8211; Array of latitudes</li>
<li><strong>new_longitudes</strong> (<em>1d Numpy Array</em>) &#8211; Array of longitudes</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">Open Climate Workbench Dataset Object</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="dataset_processor.subset">
<tt class="descclassname">dataset_processor.</tt><tt class="descname">subset</tt><big>(</big><em>subregion</em>, <em>target_dataset</em><big>)</big><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> (<em>Bounds</em>) &#8211; The Bounds with which to subset the target Dataset.</li>
<li><strong>target_dataset</strong> (<em>Dataset</em>) &#8211; 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">Dataset</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_rebin">
<tt class="descclassname">dataset_processor.</tt><tt class="descname">temporal_rebin</tt><big>(</big><em>target_dataset</em>, <em>temporal_resolution</em><big>)</big><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> (<em>Open Climate Workbench Dataset Object</em>) &#8211; Dataset object that needs temporal regridding</li>
<li><strong>temporal_resolution</strong> (<em>Python datetime.timedelta object</em>) &#8211; The new temporal bin size</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">Open Climate Workbench Dataset Object</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="dataset_processor.write_netcdf">
<tt class="descclassname">dataset_processor.</tt><tt class="descname">write_netcdf</tt><big>(</big><em>dataset</em>, <em>path</em>, <em>compress=True</em><big>)</big><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> (<em>ocw.dataset.Dataset</em>) &#8211; The dataset to write.</li>
<li><strong>path</strong> (<a class="reference external" href="http://docs.python.org/library/string.html#module-string" title="(in Python v2.7)"><em>string</em></a>) &#8211; The output file path.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<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>
<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 id="searchbox" style="display: none">
<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="related">
<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="../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"
>next</a> |</li>
<li class="right" >
<a href="dataset.html" title="Dataset Module"
>previous</a> |</li>
<li><a href="../index.html">Apache Open Climate Workbench 0.3-incubating documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2013, Michael Joyce.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.1.
</div>
</body>
</html>