Author: buildbot
Date: Mon Sep 28 18:53:23 2015
New Revision: 967106

Log:
Staging update by buildbot for climate

Added:
    websites/staging/climate/trunk/content/api/
    websites/staging/climate/trunk/content/api/_sources/
    websites/staging/climate/trunk/content/api/_sources/config/
    
websites/staging/climate/trunk/content/api/_sources/config/config_overview.txt
    websites/staging/climate/trunk/content/api/_sources/config/config_writer.txt
    
websites/staging/climate/trunk/content/api/_sources/config/dataset_information.txt
    
websites/staging/climate/trunk/content/api/_sources/config/evaluation_settings.txt
    
websites/staging/climate/trunk/content/api/_sources/config/metrics_information.txt
    
websites/staging/climate/trunk/content/api/_sources/config/plots_settings.txt
    websites/staging/climate/trunk/content/api/_sources/data_source/
    
websites/staging/climate/trunk/content/api/_sources/data_source/data_sources.txt
    websites/staging/climate/trunk/content/api/_sources/index.txt
    websites/staging/climate/trunk/content/api/_sources/ocw/
    websites/staging/climate/trunk/content/api/_sources/ocw/dataset.txt
    
websites/staging/climate/trunk/content/api/_sources/ocw/dataset_processor.txt
    websites/staging/climate/trunk/content/api/_sources/ocw/evaluation.txt
    websites/staging/climate/trunk/content/api/_sources/ocw/metrics.txt
    websites/staging/climate/trunk/content/api/_sources/ocw/overview.txt
    websites/staging/climate/trunk/content/api/_sources/ocw/plotter.txt
    websites/staging/climate/trunk/content/api/_sources/ocw/utils.txt
    websites/staging/climate/trunk/content/api/_sources/ui-backend/
    websites/staging/climate/trunk/content/api/_sources/ui-backend/backend.txt
    websites/staging/climate/trunk/content/api/_static/
    websites/staging/climate/trunk/content/api/_static/ajax-loader.gif   (with 
props)
    websites/staging/climate/trunk/content/api/_static/basic.css
    websites/staging/climate/trunk/content/api/_static/comment-bright.png   
(with props)
    websites/staging/climate/trunk/content/api/_static/comment-close.png   
(with props)
    websites/staging/climate/trunk/content/api/_static/comment.png   (with 
props)
    websites/staging/climate/trunk/content/api/_static/default.css
    websites/staging/climate/trunk/content/api/_static/doctools.js
    websites/staging/climate/trunk/content/api/_static/down-pressed.png   (with 
props)
    websites/staging/climate/trunk/content/api/_static/down.png   (with props)
    websites/staging/climate/trunk/content/api/_static/file.png   (with props)
    websites/staging/climate/trunk/content/api/_static/jquery.js
    websites/staging/climate/trunk/content/api/_static/minus.png   (with props)
    websites/staging/climate/trunk/content/api/_static/plus.png   (with props)
    websites/staging/climate/trunk/content/api/_static/pygments.css
    websites/staging/climate/trunk/content/api/_static/searchtools.js
    websites/staging/climate/trunk/content/api/_static/sidebar.js
    websites/staging/climate/trunk/content/api/_static/underscore.js
    websites/staging/climate/trunk/content/api/_static/up-pressed.png   (with 
props)
    websites/staging/climate/trunk/content/api/_static/up.png   (with props)
    websites/staging/climate/trunk/content/api/_static/websupport.js
    websites/staging/climate/trunk/content/api/config/
    websites/staging/climate/trunk/content/api/config/config_overview.html
    websites/staging/climate/trunk/content/api/config/config_writer.html
    websites/staging/climate/trunk/content/api/config/dataset_information.html
    websites/staging/climate/trunk/content/api/config/evaluation_settings.html
    websites/staging/climate/trunk/content/api/config/metrics_information.html
    websites/staging/climate/trunk/content/api/config/plots_settings.html
    websites/staging/climate/trunk/content/api/data_source/
    websites/staging/climate/trunk/content/api/data_source/data_sources.html
    websites/staging/climate/trunk/content/api/genindex.html
    websites/staging/climate/trunk/content/api/http-routingtable.html
    websites/staging/climate/trunk/content/api/index.html
    websites/staging/climate/trunk/content/api/objects.inv   (with props)
    websites/staging/climate/trunk/content/api/ocw/
    websites/staging/climate/trunk/content/api/ocw/dataset.html
    websites/staging/climate/trunk/content/api/ocw/dataset_processor.html
    websites/staging/climate/trunk/content/api/ocw/evaluation.html
    websites/staging/climate/trunk/content/api/ocw/metrics.html
    websites/staging/climate/trunk/content/api/ocw/overview.html
    websites/staging/climate/trunk/content/api/ocw/plotter.html
    websites/staging/climate/trunk/content/api/ocw/utils.html
    websites/staging/climate/trunk/content/api/py-modindex.html
    websites/staging/climate/trunk/content/api/search.html
    websites/staging/climate/trunk/content/api/searchindex.js
    websites/staging/climate/trunk/content/api/ui-backend/
    websites/staging/climate/trunk/content/api/ui-backend/backend.html
Modified:
    websites/staging/climate/trunk/content/   (props changed)
    websites/staging/climate/trunk/content/community/get-involved.html
    websites/staging/climate/trunk/content/community/mailing-lists.html
    websites/staging/climate/trunk/content/community/people.html
    websites/staging/climate/trunk/content/development/edit-website.html
    websites/staging/climate/trunk/content/development/license.html
    websites/staging/climate/trunk/content/development/source.html
    websites/staging/climate/trunk/content/downloads.html
    websites/staging/climate/trunk/content/index.html
    websites/staging/climate/trunk/content/sitemap.html

Propchange: websites/staging/climate/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Sep 28 18:53:23 2015
@@ -1 +1 @@
-1705560
+1705743

Added: 
websites/staging/climate/trunk/content/api/_sources/config/config_overview.txt
==============================================================================
--- 
websites/staging/climate/trunk/content/api/_sources/config/config_overview.txt 
(added)
+++ 
websites/staging/climate/trunk/content/api/_sources/config/config_overview.txt 
Mon Sep 28 18:53:23 2015
@@ -0,0 +1,85 @@
+Configuration File Overview
+===========================
+
+Apache Open Climate Workbench includes tools for creating and reading 
configuration files. Below is an explanation of the general configuration file 
structure, and in-depth look at the various configuration options, and 
explanations of how to use configuration files in an evaluation.
+
+Getting Started
+---------------
+
+OCW configuration files are written in `YAML <http://yaml.org/>`_ with type 
annotations that are supported by the `PyYAML library 
<http://pyyaml.org/wiki/PyYAMLDocumentation>`_. Let's look at an example 
configuration file to get started.
+
+.. code::
+
+    evaluation:
+        temporal_time_delta: 365
+        spatial_regrid_lats: !!python/tuple [-20, 20, 1]
+        spatial_regrid_lons: !!python/tuple [-20, 20, 1]
+
+    datasets:
+        reference:
+            data_source: local
+            file_count: 1
+            path: 
/tmp/AFRICA_KNMI-RACMO2.2b_CTL_ERAINT_MM_50km_1989-2008_tasmax.nc
+            variable: tasmax
+
+        targets:
+            - data_source: local
+              file_count: 1
+              path: 
/tmp/AFRICA_UC-WRF311_CTL_ERAINT_MM_50km-rg_1989-2008_tasmax.nc
+              variable: tasmax
+    metrics:
+        - Bias
+
+    plots:
+        - type: contour
+          results_indeces:
+              - !!python/tuple [0, 0]
+          lats:
+              range_min: -20
+              range_max: 20
+              range_step: 1
+          lons:
+              range_min: -20
+              range_max: 20
+              range_step: 1
+          output_name: wrf_bias_compared_to_knmi
+          optional_args:
+              gridshape: !!python/tuple [6, 6]
+    
+There are 4 main categories for configuration settings: Evaluation, Datasets, 
Metrics, and Plots.
+
+Evaluation Settings
+-------------------
+
+This is where you will set evaluation specific settings such as temporal and 
spatial bin sizes to use during dataset preparation. Visit the :doc:`Evaluation 
Settings <evaluation_settings>` page for additional information.
+
+Dataset Information
+-------------------
+
+The datasets section is where you specify all the datasets to use for an 
evaluation. You can specify what the reference dataset should be as well as 
giving a list of target datasets. Visit the :doc:`Dataset Information 
<dataset_information>` page for additional information.
+
+Metrics Information
+-------------------
+
+You will need to load some metrics if you want to get anything useful out of 
your evaluation. Visit the :doc:`Metrics Information <metrics_information>` 
page to learn how to specify the metrics that should be used in the evaluation.
+
+Plots Settings
+--------------
+
+This is where you specify what plots to make after running the evaluation. The 
:doc:`Plots Settings <plots_settings>` page provides examples for the supported 
plot types.
+
+Example Run
+-----------
+
+If you have tried the **simple_model_to_model_bias.py** example in the primary 
toolkit examples you can run the same evaluation but use a config file to do so 
instead of direct API scripting. From the **climate/ocw-config-runner/** 
directory run the following command to run the example::
+
+    python ocw_evaluation_from_config.py 
example/simple_model_to_model_bias.yaml
+
+.. note::
+
+    If you haven't run the previous example which downloads the necessary 
datasets this evaluation will fail. The necessary local files will not have 
been downloaded!
+
+Writing a Config File
+---------------------
+
+You can export an :class:`evaluation.Evaluation` object to a configuration 
file for easily repeatable evaluations. Checkout the documentation on the 
:doc:`configuration file writer API <config_writer>` for additional information.

Added: 
websites/staging/climate/trunk/content/api/_sources/config/config_writer.txt
==============================================================================
--- 
websites/staging/climate/trunk/content/api/_sources/config/config_writer.txt 
(added)
+++ 
websites/staging/climate/trunk/content/api/_sources/config/config_writer.txt 
Mon Sep 28 18:53:23 2015
@@ -0,0 +1,5 @@
+Configuration File Writer API
+=============================
+
+.. automodule:: configuration_writer
+    :members:

Added: 
websites/staging/climate/trunk/content/api/_sources/config/dataset_information.txt
==============================================================================
--- 
websites/staging/climate/trunk/content/api/_sources/config/dataset_information.txt
 (added)
+++ 
websites/staging/climate/trunk/content/api/_sources/config/dataset_information.txt
 Mon Sep 28 18:53:23 2015
@@ -0,0 +1,89 @@
+Dataset Information
+===================
+
+Dataset configuration information is passed in the **datasets** section of the 
configuration file. You can specify one reference dataset and one or more 
target datasets for your evaluation::
+
+    datasets:
+        reference:
+            data_source: local
+            file_count: 1
+            path: 
/tmp/AFRICA_KNMI-RACMO2.2b_CTL_ERAINT_MM_50km_1989-2008_tasmax.nc
+            variable: tasmax
+
+        targets:
+            - data_source: local
+              file_count: 1
+              path: 
/tmp/AFRICA_UC-WRF311_CTL_ERAINT_MM_50km-rg_1989-2008_tasmax.nc
+              variable: tasmax
+            - data_source: local
+              file_count: 1
+              path: 
/tmp/AFRICA_UC-WRF311_CTL_ERAINT_MM_50km-rg_1989-2008_tasmax.nc
+              variable: tasmax
+
+Each **data_source** module requires datasets to be passed in a slightly 
different manner. Below is an explanation of the format for each of the 
supported data sources.
+
+Local Dataset
+-------------
+.. code::
+
+    data_source: local
+    file_count: 1
+    path: /tmp/AFRICA_KNMI-RACMO2.2b_CTL_ERAINT_MM_50km_1989-2008_tasmax.nc
+    variable: tasmax
+
+The **path** flag is the location where the dataset is located on your 
computer. The **variable** flag is the variable that should be pulled out of 
the NetCDF file once it has been opened. You pass any optional flags that are 
accepted by :func:`local.load_file` by using the **optional_args** flag::
+
+    data_source: local
+    file_count: 1
+    path: /tmp/AFRICA_KNMI-RACMO2.2b_CTL_ERAINT_MM_50km_1989-2008_tasmax.nc
+    variable: tasmax
+    optional_args:
+        elevation_index=0,
+        name='foo'
+
+.. note::
+
+    The **file_count** flag is currently not used. It is there to support 
planned future functionality. However, you still need to specify it! Leave it 
as 1.
+
+
+RCMED Dataset
+-------------
+
+.. code::
+    
+    data_source: rcmed
+    dataset_id: 4
+    parameter_id: 32
+    min_lat: -10
+    max_lat: 10
+    min_lon: -20
+    max_lon: 20
+    start_time: 1997-01-01
+    end_time: 2000-01-01
+
+To load a dataset from the Jet Propulsion Laboratory's RCMED you will need to 
specify the above flags. The **dataset_id** and **parameter_id** are dataset 
specific and can be looked up on the `RCMES project website 
<https://rcmes.jpl.nasa.gov/content/rcmes-and-data>`_. Pretty much any common 
time format will be accepted for the start and end times. However, just to be 
safe you should try to stick with something very standard such as `ISO-8601 
<http://www.w3.org/TR/NOTE-datetime>`_ formatted time values. You may also pass 
any optional parameters that are accepted by :func:`rcmed.parameter_dataset` 
with the **optional_args** flag.
+
+ESGF Dataset
+------------
+
+In order to load an ESGF dataset you will need to specify the following 
parameters in addition to having an ESGF login::
+
+    data_source: esgf
+    dataset_id: obs4MIPs.CNES.AVISO.mon.v1|esg-datanode.jpl.nasa.gov
+    variable: zosStderr
+    esgf_password: totallynotmypassword
+    esgf_username: totallynotmyusername
+
+The **dataset_id** and **variable** flags are ESGF dataset specific. You can 
locate them through and ESGF nodes search page. You may also pass any optional 
parameters that are accepted by :func:`esgf.load_dataset` with the 
**optional_args** flag.
+
+
+OpenDAP Dataset
+---------------
+
+A dataset can be downloaded from an OpenDAP URL with the following settings::
+
+    data_source: dap
+    url: http://test.opendap.org/dap/data/nc/sst.mnmean.nc.gz
+    variable: sst
+
+You may also pass any optional parameters that are accepted by 
:func:`dap.load` with the **optional_args** flag.

Added: 
websites/staging/climate/trunk/content/api/_sources/config/evaluation_settings.txt
==============================================================================
--- 
websites/staging/climate/trunk/content/api/_sources/config/evaluation_settings.txt
 (added)
+++ 
websites/staging/climate/trunk/content/api/_sources/config/evaluation_settings.txt
 Mon Sep 28 18:53:23 2015
@@ -0,0 +1,56 @@
+Evaluation Settings
+===================
+
+The evaluation settings section of the configuration file allows you to set 
attributes that are critical for making adjustments to the loaded datasets 
prior to an evaluation run. Here is an example evaluation settings section of a 
configuration file. Below, we'll look at each of the configuration options in 
detail.
+
+.. code::
+
+    evaluation:
+        temporal_time_delta: 365
+        spatial_regrid_lats: !!python/tuple [-20, 20, 1]
+        spatial_regrid_lons: !!python/tuple [-20, 20, 1]
+
+Temporal Rebin
+--------------
+
+It is often necessary to temporally rebin datasets prior to an evaluation. The 
**temporal_time_delta** flag is where you can set the **temporal_resolution** 
parameter for :func:`dataset_processor.temporal_rebin`. The value that you pass 
here is interpreted as the number of days to assign to a 
:class:`datetime.timedelta` object before running the 
:func:`dataset_processor.temporal_rebin` function.
+
+.. note::
+
+    This attribute is only useful if you use the configuration data to create 
an :class:`evaluation.Evaluation` object with the 
:func:`evaluation_creation.generate_evaluation_from_config` config parser 
function.
+
+Spatial Regrid
+--------------
+
+.. note::
+
+    Some funcitonality here is still in development. Specifically, passing the 
spatial_regrid_* flags as lists of values.
+
+If you need to regrid your datasets onto a new lat/lon grid you will need to 
set the **spatial_regrid_lats** and **spatial_regrid_lons** options. These will 
be passed to the :func:`dataset_processor.spatial_regrid` function along with 
each dataset. There are two valid ways to pass these parameters. First, you can 
pass them as a list of all values::
+
+    evaluation:
+        spatial_regrid_lats: [-10, -5, 0, 5, 10]
+        spatial_regrid_lons: [-10, -5, 0, 5, 10]
+
+This is generally useful if you only need to pass a few parameters or if the 
sequence isn't easy to define as a valid **range** in Python. The other option 
is to pass **range** information as a tuple. This requires you to use `PyYAML's 
Python Type Annotations 
<http://pyyaml.org/wiki/PyYAMLDocumentation#YAMLtagsandPythontypes>`_ but 
provides a far more compact representation::
+
+    evaluation:
+        spatial_regrid_lats: !!python/tuple [-20, 20, 1]
+        spatial_regrid_lons: !!python/tuple [-20, 20, 1]
+
+Using this style directly maps to a call to :func:`numpy.arange`::
+
+    # spatial_regrid_lats: !!python/tuple [-20, 20, 1] becomes
+    lats = numpy.arange(-20, 20, 1)
+
+Be sure to pay special attention to the end value for your interval. The 
:func:`numpy.arange` function does not include the end value in the returned 
interval.
+
+Subset Bounds
+-------------
+
+In order to subset the datasets down to an area of interest you will need to 
pass bounds information::
+
+    evaluation:
+        subset: [-10, 10, -20, 20, "1997-01-01", "2000-01-01"]
+
+Here you're passing the bounding lat/lon box with the first 4 values as well 
as the valid temporal range bounds with the starting and end time values. 
Pretty much any common time format will be accepted. However, just to be safe 
you should try to stick with something very standard such as `ISO-8601 
<http://www.w3.org/TR/NOTE-datetime>`_ formatted time values.

Added: 
websites/staging/climate/trunk/content/api/_sources/config/metrics_information.txt
==============================================================================
--- 
websites/staging/climate/trunk/content/api/_sources/config/metrics_information.txt
 (added)
+++ 
websites/staging/climate/trunk/content/api/_sources/config/metrics_information.txt
 Mon Sep 28 18:53:23 2015
@@ -0,0 +1,12 @@
+Metrics Information
+===================
+
+.. note::
+
+    At the moment, you can only load metrics that are in :mod:`ocw.metrics`. 
In the future you will also be able to specify user defined metrics here as 
well. However, as a work around you can define your custom metrics in the 
:mod:`ocw.metrics` module.
+
+You can set the metrics you want to use in the evaluation in the **metrics** 
section of the config. You simply need to supply a list of the metric class 
names that you want to be used::
+
+    metrics:
+        - Bias
+        - TemporalStdDev

Added: 
websites/staging/climate/trunk/content/api/_sources/config/plots_settings.txt
==============================================================================
--- 
websites/staging/climate/trunk/content/api/_sources/config/plots_settings.txt 
(added)
+++ 
websites/staging/climate/trunk/content/api/_sources/config/plots_settings.txt 
Mon Sep 28 18:53:23 2015
@@ -0,0 +1,44 @@
+Plots Settings
+==============
+
+Plotting configuration information is passed in the **plots** section of the 
configuration file::
+
+    plots:
+        - type: contour
+          results_indeces:
+              - !!python/tuple [0, 0]
+          lats:
+              range_min: -20
+              range_max: 20
+              range_step: 1
+          lons:
+              range_min: -20
+              range_max: 20
+              range_step: 1
+          output_name: wrf_bias_compared_to_knmi
+          optional_args:
+              gridshape: !!python/tuple [6, 6]
+
+Each type of support plot has a different configuration format expected. Each 
of these are explained below. Note, most of these will require you to specify 
what result data you want included in the plots with the **results_indeces** 
flag. This relates the format that an Evaluation object outputs results in. 
Check the :class:`evaluation.Evaluation` documentation for more details.
+
+Contour Maps
+-------------
+
+The contour maps config configures data for OCW's contour plotter 
:func:`plotting.draw_contour_map`::
+
+    type: contour
+          results_indeces:
+              - !!python/tuple [0, 0]
+          lats:
+              range_min: -20
+              range_max: 20
+              range_step: 1
+          lons:
+              range_min: -20
+              range_max: 20
+              range_step: 1
+          output_name: wrf_bias_compared_to_knmi
+          optional_args:
+              gridshape: !!python/tuple [6, 6]
+
+The **lat** and **lon** parameters are specified as a range of values. Be 
aware that the **range_max** element is not included in the output range so you 
may need to adjust it slightly if you want a particular value included. The 
**output_name** parameter is the name of the resulting output graph. You may 
also pass any optional parameters that are supported by the 
:func:`plotting.draw_contour_map` function with the **optional_args** flag.

Added: 
websites/staging/climate/trunk/content/api/_sources/data_source/data_sources.txt
==============================================================================
--- 
websites/staging/climate/trunk/content/api/_sources/data_source/data_sources.txt
 (added)
+++ 
websites/staging/climate/trunk/content/api/_sources/data_source/data_sources.txt
 Mon Sep 28 18:53:23 2015
@@ -0,0 +1,22 @@
+Data Sources
+************
+
+Local Module
+============
+.. automodule:: local
+    :members:
+
+RCMED Module
+============
+.. automodule:: rcmed
+    :members:
+
+DAP Module
+==========
+.. automodule:: dap
+    :members:
+
+ESGF Module
+===========
+.. automodule:: esgf
+    :members:

Added: websites/staging/climate/trunk/content/api/_sources/index.txt
==============================================================================
--- websites/staging/climate/trunk/content/api/_sources/index.txt (added)
+++ websites/staging/climate/trunk/content/api/_sources/index.txt Mon Sep 28 
18:53:23 2015
@@ -0,0 +1,32 @@
+.. Apache Open Climate Workbench documentation master file, created by
+   sphinx-quickstart on Fri Oct 25 07:58:45 2013.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+Welcome to Apache Open Climate Workbench's documentation!
+=========================================================
+
+Contents:
+
+.. toctree::
+   :maxdepth: 4
+
+   ocw/overview
+   ocw/dataset
+   ocw/dataset_processor
+   ocw/evaluation
+   ocw/metrics
+   ocw/plotter
+   ocw/utils
+   data_source/data_sources
+   ui-backend/backend.rst
+   config/config_overview
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+

Added: websites/staging/climate/trunk/content/api/_sources/ocw/dataset.txt
==============================================================================
--- websites/staging/climate/trunk/content/api/_sources/ocw/dataset.txt (added)
+++ websites/staging/climate/trunk/content/api/_sources/ocw/dataset.txt Mon Sep 
28 18:53:23 2015
@@ -0,0 +1,12 @@
+Dataset Module
+**************
+
+Bounds
+======
+.. autoclass:: dataset.Bounds
+    :members:
+
+Dataset
+=======
+.. autoclass:: dataset.Dataset
+    :members:

Added: 
websites/staging/climate/trunk/content/api/_sources/ocw/dataset_processor.txt
==============================================================================
--- 
websites/staging/climate/trunk/content/api/_sources/ocw/dataset_processor.txt 
(added)
+++ 
websites/staging/climate/trunk/content/api/_sources/ocw/dataset_processor.txt 
Mon Sep 28 18:53:23 2015
@@ -0,0 +1,5 @@
+Dataset Processor Module
+************************
+
+.. automodule:: dataset_processor
+   :members:

Added: websites/staging/climate/trunk/content/api/_sources/ocw/evaluation.txt
==============================================================================
--- websites/staging/climate/trunk/content/api/_sources/ocw/evaluation.txt 
(added)
+++ websites/staging/climate/trunk/content/api/_sources/ocw/evaluation.txt Mon 
Sep 28 18:53:23 2015
@@ -0,0 +1,5 @@
+Evaluation Module
+*****************
+
+.. autoclass:: evaluation.Evaluation
+    :members:

Added: websites/staging/climate/trunk/content/api/_sources/ocw/metrics.txt
==============================================================================
--- websites/staging/climate/trunk/content/api/_sources/ocw/metrics.txt (added)
+++ websites/staging/climate/trunk/content/api/_sources/ocw/metrics.txt Mon Sep 
28 18:53:23 2015
@@ -0,0 +1,5 @@
+Metrics Module
+**************
+
+.. automodule:: metrics
+    :members:

Added: websites/staging/climate/trunk/content/api/_sources/ocw/overview.txt
==============================================================================
--- websites/staging/climate/trunk/content/api/_sources/ocw/overview.txt (added)
+++ websites/staging/climate/trunk/content/api/_sources/ocw/overview.txt Mon 
Sep 28 18:53:23 2015
@@ -0,0 +1,179 @@
+Overview
+========
+
+The Apache Open Climate Workbench toolkit aims to provide a suit of tools to 
make Climate Scientists lives easier. It does this by providing tools for 
loading and manipulating datasets, running evaluations, and plotting results. 
Below is a breakdown of many of the OCW components with an explanation of how 
to use them. An OCW evaluation usually has the following steps:
+
+1. Load one or more datasets
+2. Perform dataset manipulations (subset, temporal/spatial rebin, etc.)
+3. Load various metrics
+4. Instantiate and run the evaluation
+5. Plot results
+
+Common Data Abstraction
+-----------------------
+
+The OCW :class:`dataset.Dataset` class is the primary data abstraction used 
throughout OCW. It facilitates the uniform handling of data throughout the 
toolkit and provides a few useful helper functions such as 
:func:`dataset.Dataset.spatial_boundaries` and 
:func:`dataset.Dataset.time_range`. Creating a new dataset object is 
straightforward but generally you will want to use an OCW data source to load 
the data for you.
+
+Data Sources
+------------
+
+OCW data sources allow users to easily load :class:`dataset.Dataset` objects 
from a number of places. These data sources help with step 1 of an evaluation 
above. In general the primary file format that is supported is NetCDF. For 
instance, the :mod:`local`, :mod:`dap` and :mod:`esgf` data sources only 
support loading NetCDF files from your local machine, an OpenDAP URL, and the 
ESGF respectively. Some data sources, such as :mod:`rcmed`, point to externally 
supported data sources. In the case of the RCMED data source, the Regional 
Climate Model Evaluation Database is run by NASA's Jet Propulsion Laboratory. 
+
+Adding additional data sources is quite simple. The only API limitation that 
we have on a data source is that it returns a valid :class:`dataset.Dataset` 
object. Please feel free to send patches for adding more data sources. 
+
+A simple example using the :mod:`local` data source to load a NetCDF file from 
your local machine::
+
+>>> import ocw.data_source.local as local
+>>> ds = local.load_file('/tmp/some_dataset.nc', 'SomeVarInTheDataset')
+
+Dataset Manipulations
+---------------------
+
+All :class:`dataset.Dataset` manipulations are handled by the 
:mod:`dataset_processor` module. In general, an evaluation will include calls 
to :func:`dataset_processor.subset`, :func:`dataset_processor.spatial_regrid`, 
and :func:`dataset_processor.temporal_rebin` to ensure that the datasets can 
actually be compared. :mod:`dataset_processor` functions take a 
:class:`dataset.Dataset` object and some various parameters and return a 
modified :class:`dataset.Dataset` object. The original dataset is never 
manipulated in the process.
+
+Subsetting is a great way to speed up your processing and keep useless data 
out of your plots. Notice that we're using a :class:`dataset.Bounds` objec to 
represent the area of interest::
+
+>>> import ocw.dataset_processor as dsp
+>>> new_bounds = Bounds(min_lat, max_lat, min_lon, max_lon, start_time, 
end_time)
+>>> knmi_dataset = dsp.subset(new_bounds, knmi_dataset)
+
+Temporally re-binning a dataset is great when the time step of the data is too 
fine grain for the desired use. For instance, perhaps we want to see a yearly 
trend but we have daily data. We would need to make the following call to 
adjust our dataset::
+
+>>> knmi_dataset = dsp.temporal_rebin(knmi_dataset, 
datetime.timedelta(days=365))
+
+It is critically necessary for our datasets to be on the same lat/lon grid 
before we try to compare them. That's where spatial re-gridding comes in 
helpful. Here we re-grid our example dataset onto a 1-degree lat/lon grid 
within the range that we subsetted the dataset previously::
+
+>>> new_lons = np.arange(min_lon, max_lon, 1)
+>>> new_lats = np.arange(min_lat, max_lat, 1)
+>>> knmi_dataset = dsp.spatial_regrid(knmi_dataset, new_lats, new_lons)
+
+Metrics
+-------
+
+Metrics are the backbone of an evaluation. You'll find a number of (hopefully) 
useful "default" metrics in the :mod:`metrics` module in the toolkit. In 
general you won't be too likely to use a metric outside of an evaluation, 
however you could run a metric manually if you so desired.::
+
+>>> import ocw.metrics
+>>> # Load 2 datasets
+>>> bias = ocw.metrics.Bias()
+>>> print bias.run(dataset1, dataset2)
+
+While this might be exactly what you need to get the job done, it is far more 
likely that you'll need to run a number of metrics over a number of datasets. 
That's where running an evaluation comes in, but we'll get to that shortly.
+
+There are two "types" of metrics that the toolkit supports. A unary metric 
acts on a single dataset and returns a result. A binary metric acts on a target 
and reference dataset and returns a result. This is helpful to know if you 
decide that the included metrics aren't sufficient. We've attempted to make 
adding a new metric as simple as possible. You simply create a new class that 
inherits from either the unary or binary base classes and override the `run` 
function. At this point your metric will behave exactly like the included 
metrics in the toolkit. Below is an example of how one of the included metrics 
is implemented. If you need further assistance with your own metrics be sure to 
email the project's mailing list!::
+
+>>> class Bias(BinaryMetric):
+>>>     '''Calculate the bias between a reference and target dataset.'''
+>>> 
+>>>     def run(self, ref_dataset, target_dataset):
+>>>         '''Calculate the bias between a reference and target dataset.
+>>> 
+>>>         .. note::
+>>>            Overrides BinaryMetric.run()
+>>> 
+>>>         :param ref_dataset: The reference dataset to use in this metric 
run.
+>>>         :type ref_dataset: ocw.dataset.Dataset object
+>>>         :param target_dataset: The target dataset to evaluate against the
+>>>             reference dataset in this metric run.
+>>>         :type target_dataset: ocw.dataset.Dataset object
+>>> 
+>>>         :returns: The difference between the reference and target datasets.
+>>>         :rtype: Numpy Array
+>>>         '''
+>>>         return ref_dataset.values - target_dataset.values
+
+While this might look a bit scary at first, if we take out all the 
documentation you'll see that it's really extremely simple.::
+
+>>> # Our new Bias metric inherits from the Binary Metric base class
+>>> class Bias(BinaryMetric):
+>>>     # Since our new metric is a binary metric we need to override
+>>>     # the run funtion in the BinaryMetric base class.
+>>>     def run(self, ref_dataset, target_dataset):
+>>>         # To implement the bias metric we simply return the difference
+>>>         # between the reference and target dataset's values arrays.
+>>>         return ref_dataset.values - target_dataset.values
+
+It is very important to note that you shouldn't change the datasets that are 
passed into the metric that you're implementing. If you do you might cause 
unexpected results in future parts of the evaluation. If you need to do 
manipulations, copy the data first and do manipulations on the copy. Leave the 
original dataset alone!
+
+Handling an Evaluation
+----------------------
+
+We saw above that it is easy enough to run a metric over a few datasets 
manually. However, when we have a lot of datasets and/or a lot of metrics to 
run that can become tedious and error prone. This is where the 
:class:`evaluation.Evaluation` class comes in handy. It ensures that all the 
metrics that you choose are run over all combinations of the datasets that you 
input. Consider the following simple example::
+
+>>> import ocw.evaluation as eval
+>>> import ocw.data_source.local as local
+>>> import ocw.metrics as metrics
+>>> 
+>>> # Load a few datasets
+>>> ref_dataset = local.load_file(...)
+>>> target1 = local.load_file(...)
+>>> target2 = local.load_file(...)
+>>> target_datasets = [target1, target2]
+>>>
+>>> # Do some dataset manipulations here such as subsetting and regridding
+>>>
+>>> # Load a few metrics
+>>> bias = metrics.Bias()
+>>> tstd = metrics.TemporalStdDev()
+>>> metrics = [bias, tstd]
+>>>
+>>> new_eval = eval.Evaluation(ref_dataset, target_datasets, metrics)
+>>> new_eval.run()
+>>> print new_eval.results
+>>> print new_eval.unary_results
+
+First we load all of our datasets and do any manipulations (which we leave out 
for brevity). Then we load the metrics that we want to run, namely Bias and 
TemporalStdDev. We then load our evaluation object.::
+
+>>> new_eval = eval.Evaluation(ref_dataset, target_datasets, metrics)
+
+Notice two things about this. First, we're splitting the datasets into a 
reference dataset (ref_dataset) and a list of target datasets 
(target_datasets). Second, one of the metrics that we loaded 
(:class:`metrics.TemporalStdDev`) is a unary metric. The reference/target 
dataset split is necessary to handling binary metrics. When an evaluation is 
run, all the binary metrics are run against every (reference, target) dataset 
pair. So the above evaluation could be replaced with the following calls. Of 
course this wouldn't handle the unary metric, but we'll get to that in a 
second.::
+
+>>> result1 = bias.run(ref_dataset, target1)
+>>> result2 = bias.run(ref_dataset, target2)
+
+Unary metrics are handled slightly differently but they're still simple. Each 
unary metric passed into the evaluation is run against *every* dataset in the 
evaluation. So we could replace the above evaluation with the following calls::
+
+>>> unary_result1 = tstd(ref_dataset)
+>>> unary_result2 = tstd(target1)
+>>> unary_result3 = tstd(target2)
+
+The only other part that we need to explore to fully understand the 
:class:`evalution.Evaluation` class is how the results are stored internally 
from the run. The `results` list is a multidimensional array holding all the 
binary metric results and the `unary_results` is a list holding all the unary 
metric results. To more accurately replace the above evaluation with manual 
calls we would write the following::
+
+>>> results = [
+>>>     # Results for target1
+>>>     [
+>>>         bias.run(ref_dataset, target1)
+>>>         # If there were other binary metrics, the results would be here.
+>>>     ],
+>>>     # Results for target2
+>>>     [
+>>>         bias.run(ref_dataset, target2)
+>>>         # If there were other binary metrics, the results would be here.
+>>>     ]
+>>> ]
+>>>
+>>> unary_results = [
+>>>     # Results for TemporalStdDev
+>>>     [
+>>>         tstd(ref_dataset),
+>>>         tstd(target1),
+>>>         tstd(target2)
+>>>     ]
+>>>     # If there were other unary metrics, the results would be in a list 
here.
+>>> ]
+
+Plotting
+--------
+
+Plotting can be fairly complicated business. Luckily we have `pretty good 
documentation 
<https://cwiki.apache.org/confluence/display/CLIMATE/Guide+to+Plotting+API>`_ 
on the project wiki that can help you out. There are also fairly simple 
examples in the project's example folder with the remainder of the code such as 
the following::
+
+>>> # Let's grab the values returned for bias.run(ref_dataset, target1)
+>>> results = bias_evaluation.results[0][0]
+>>>
+>>> Here's the same lat/lons we used earlier when we were re-gridding
+>>> lats = new_lats
+>>> lons = new_lons
+>>> fname = 'My_Test_Plot'
+>>>  
+>>> plotter.draw_contour_map(results, lats, lons, fname)
+
+This would give you a contour map calls `My_Test_Plot` for the requested bias 
metric run.

Added: websites/staging/climate/trunk/content/api/_sources/ocw/plotter.txt
==============================================================================
--- websites/staging/climate/trunk/content/api/_sources/ocw/plotter.txt (added)
+++ websites/staging/climate/trunk/content/api/_sources/ocw/plotter.txt Mon Sep 
28 18:53:23 2015
@@ -0,0 +1,5 @@
+Plotter Module
+**************
+
+.. automodule:: plotter
+    :members:

Added: websites/staging/climate/trunk/content/api/_sources/ocw/utils.txt
==============================================================================
--- websites/staging/climate/trunk/content/api/_sources/ocw/utils.txt (added)
+++ websites/staging/climate/trunk/content/api/_sources/ocw/utils.txt Mon Sep 
28 18:53:23 2015
@@ -0,0 +1,5 @@
+Utils Module
+************
+
+.. automodule:: utils
+   :members:

Added: 
websites/staging/climate/trunk/content/api/_sources/ui-backend/backend.txt
==============================================================================
--- websites/staging/climate/trunk/content/api/_sources/ui-backend/backend.txt 
(added)
+++ websites/staging/climate/trunk/content/api/_sources/ui-backend/backend.txt 
Mon Sep 28 18:53:23 2015
@@ -0,0 +1,80 @@
+Evaluation UI Webservices
+*************************
+
+The OCW evaluation UI is a demonstration web application that is built upon the
+OCW toolkit. The web services for the application are written in Python on top
+of the Bottle Web Framework.
+
+Configuration and Dependencies
+==============================
+
+The Evaluation UI is built on top of the OCW toolkit and as such requires it to
+function properly. Please check the toolkit's documentation for relevant
+installation instructions. You will also need to ensure that you have Bottle
+installed. You can install it with:
+
+.. code::
+    
+    pip install bottle
+
+The backend serves the static files for the evaluation frontend as well. If you
+plan to use the frontend you need to ensure that the *app* directory is present
+in the main web service directory. The easiest way to do this is to create a
+symbolic link where the *run_webservices* module is located. Assuming you have
+the entire *ocw-ui* directory, you can do this with the following command.
+
+.. code::
+
+    cd ocw-ui/backend
+    ln -s ../frontend/app app
+
+Finally, to start the backend just run the following command.
+
+.. code::
+
+    python run_webservices.py
+    
+Web Service Explanation
+=======================
+
+The backend endpoints are broken up into a number of modules for ease of
+maintenance and understanding. The *run_webservices* module is the primary
+application module. It brings together all the various submodules into a
+useful system. It also defines a number of helpful endpoints for returning
+static files such as the index page, CSS files, JavaScript files, and more.
+
+Local File Metadata Extractors
+------------------------------
+
+The *local_file_metadata_extractors* module contains all the endpoints that are
+used to strip information out of various objects for display in the UI. At the
+moment, the main functionality is stripping out metadata from NetCDF files when
+a user wishes to *load* a local file into the evaluation.
+
+.. autobottle:: local_file_metadata_extractors:lfme_app
+
+Directory Helpers
+-----------------
+
+The *directory_helpers* module contains a number of endpoints for working
+directory manipulation. The frontend uses these endpoints to grab directory
+information (within a prefix path for security), return result directory
+information, and other things.
+
+.. autobottle:: directory_helpers:dir_app
+
+RCMED Helpers
+-------------
+
+The *rcmed_helpers* module contains endpoints for loading datasets from the
+Regional Climate Model Evaluation Database at NASA's Jet Propulsion Laboratory.
+
+.. autobottle:: rcmed_helpers:rcmed_app
+
+Processing Endpoints
+--------------------
+
+The *processing* module contains all the endpoints related to the running of
+evaluations.
+
+.. autobottle:: processing:processing_app

Added: websites/staging/climate/trunk/content/api/_static/ajax-loader.gif
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/climate/trunk/content/api/_static/ajax-loader.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: websites/staging/climate/trunk/content/api/_static/basic.css
==============================================================================
--- websites/staging/climate/trunk/content/api/_static/basic.css (added)
+++ websites/staging/climate/trunk/content/api/_static/basic.css Mon Sep 28 
18:53:23 2015
@@ -0,0 +1,537 @@
+/*
+ * basic.css
+ * ~~~~~~~~~
+ *
+ * Sphinx stylesheet -- basic theme.
+ *
+ * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+/* -- main layout ----------------------------------------------------------- 
*/
+
+div.clearer {
+    clear: both;
+}
+
+/* -- relbar ---------------------------------------------------------------- 
*/
+
+div.related {
+    width: 100%;
+    font-size: 90%;
+}
+
+div.related h3 {
+    display: none;
+}
+
+div.related ul {
+    margin: 0;
+    padding: 0 0 0 10px;
+    list-style: none;
+}
+
+div.related li {
+    display: inline;
+}
+
+div.related li.right {
+    float: right;
+    margin-right: 5px;
+}
+
+/* -- sidebar --------------------------------------------------------------- 
*/
+
+div.sphinxsidebarwrapper {
+    padding: 10px 5px 0 10px;
+}
+
+div.sphinxsidebar {
+    float: left;
+    width: 230px;
+    margin-left: -100%;
+    font-size: 90%;
+}
+
+div.sphinxsidebar ul {
+    list-style: none;
+}
+
+div.sphinxsidebar ul ul,
+div.sphinxsidebar ul.want-points {
+    margin-left: 20px;
+    list-style: square;
+}
+
+div.sphinxsidebar ul ul {
+    margin-top: 0;
+    margin-bottom: 0;
+}
+
+div.sphinxsidebar form {
+    margin-top: 10px;
+}
+
+div.sphinxsidebar input {
+    border: 1px solid #98dbcc;
+    font-family: sans-serif;
+    font-size: 1em;
+}
+
+div.sphinxsidebar #searchbox input[type="text"] {
+    width: 170px;
+}
+
+div.sphinxsidebar #searchbox input[type="submit"] {
+    width: 30px;
+}
+
+img {
+    border: 0;
+    max-width: 100%;
+}
+
+/* -- search page ----------------------------------------------------------- 
*/
+
+ul.search {
+    margin: 10px 0 0 20px;
+    padding: 0;
+}
+
+ul.search li {
+    padding: 5px 0 5px 20px;
+    background-image: url(file.png);
+    background-repeat: no-repeat;
+    background-position: 0 7px;
+}
+
+ul.search li a {
+    font-weight: bold;
+}
+
+ul.search li div.context {
+    color: #888;
+    margin: 2px 0 0 30px;
+    text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+    font-weight: bold;
+}
+
+/* -- index page ------------------------------------------------------------ 
*/
+
+table.contentstable {
+    width: 90%;
+}
+
+table.contentstable p.biglink {
+    line-height: 150%;
+}
+
+a.biglink {
+    font-size: 1.3em;
+}
+
+span.linkdescr {
+    font-style: italic;
+    padding-top: 5px;
+    font-size: 90%;
+}
+
+/* -- general index --------------------------------------------------------- 
*/
+
+table.indextable {
+    width: 100%;
+}
+
+table.indextable td {
+    text-align: left;
+    vertical-align: top;
+}
+
+table.indextable dl, table.indextable dd {
+    margin-top: 0;
+    margin-bottom: 0;
+}
+
+table.indextable tr.pcap {
+    height: 10px;
+}
+
+table.indextable tr.cap {
+    margin-top: 10px;
+    background-color: #f2f2f2;
+}
+
+img.toggler {
+    margin-right: 3px;
+    margin-top: 3px;
+    cursor: pointer;
+}
+
+div.modindex-jumpbox {
+    border-top: 1px solid #ddd;
+    border-bottom: 1px solid #ddd;
+    margin: 1em 0 1em 0;
+    padding: 0.4em;
+}
+
+div.genindex-jumpbox {
+    border-top: 1px solid #ddd;
+    border-bottom: 1px solid #ddd;
+    margin: 1em 0 1em 0;
+    padding: 0.4em;
+}
+
+/* -- general body styles --------------------------------------------------- 
*/
+
+a.headerlink {
+    visibility: hidden;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink {
+    visibility: visible;
+}
+
+div.body p.caption {
+    text-align: inherit;
+}
+
+div.body td {
+    text-align: left;
+}
+
+.field-list ul {
+    padding-left: 1em;
+}
+
+.first {
+    margin-top: 0 !important;
+}
+
+p.rubric {
+    margin-top: 30px;
+    font-weight: bold;
+}
+
+img.align-left, .figure.align-left, object.align-left {
+    clear: left;
+    float: left;
+    margin-right: 1em;
+}
+
+img.align-right, .figure.align-right, object.align-right {
+    clear: right;
+    float: right;
+    margin-left: 1em;
+}
+
+img.align-center, .figure.align-center, object.align-center {
+  display: block;
+  margin-left: auto;
+  margin-right: auto;
+}
+
+.align-left {
+    text-align: left;
+}
+
+.align-center {
+    text-align: center;
+}
+
+.align-right {
+    text-align: right;
+}
+
+/* -- sidebars -------------------------------------------------------------- 
*/
+
+div.sidebar {
+    margin: 0 0 0.5em 1em;
+    border: 1px solid #ddb;
+    padding: 7px 7px 0 7px;
+    background-color: #ffe;
+    width: 40%;
+    float: right;
+}
+
+p.sidebar-title {
+    font-weight: bold;
+}
+
+/* -- topics ---------------------------------------------------------------- 
*/
+
+div.topic {
+    border: 1px solid #ccc;
+    padding: 7px 7px 0 7px;
+    margin: 10px 0 10px 0;
+}
+
+p.topic-title {
+    font-size: 1.1em;
+    font-weight: bold;
+    margin-top: 10px;
+}
+
+/* -- admonitions ----------------------------------------------------------- 
*/
+
+div.admonition {
+    margin-top: 10px;
+    margin-bottom: 10px;
+    padding: 7px;
+}
+
+div.admonition dt {
+    font-weight: bold;
+}
+
+div.admonition dl {
+    margin-bottom: 0;
+}
+
+p.admonition-title {
+    margin: 0px 10px 5px 0px;
+    font-weight: bold;
+}
+
+div.body p.centered {
+    text-align: center;
+    margin-top: 25px;
+}
+
+/* -- tables ---------------------------------------------------------------- 
*/
+
+table.docutils {
+    border: 0;
+    border-collapse: collapse;
+}
+
+table.docutils td, table.docutils th {
+    padding: 1px 8px 1px 5px;
+    border-top: 0;
+    border-left: 0;
+    border-right: 0;
+    border-bottom: 1px solid #aaa;
+}
+
+table.field-list td, table.field-list th {
+    border: 0 !important;
+}
+
+table.footnote td, table.footnote th {
+    border: 0 !important;
+}
+
+th {
+    text-align: left;
+    padding-right: 5px;
+}
+
+table.citation {
+    border-left: solid 1px gray;
+    margin-left: 1px;
+}
+
+table.citation td {
+    border-bottom: none;
+}
+
+/* -- other body styles ----------------------------------------------------- 
*/
+
+ol.arabic {
+    list-style: decimal;
+}
+
+ol.loweralpha {
+    list-style: lower-alpha;
+}
+
+ol.upperalpha {
+    list-style: upper-alpha;
+}
+
+ol.lowerroman {
+    list-style: lower-roman;
+}
+
+ol.upperroman {
+    list-style: upper-roman;
+}
+
+dl {
+    margin-bottom: 15px;
+}
+
+dd p {
+    margin-top: 0px;
+}
+
+dd ul, dd table {
+    margin-bottom: 10px;
+}
+
+dd {
+    margin-top: 3px;
+    margin-bottom: 10px;
+    margin-left: 30px;
+}
+
+dt:target, .highlighted {
+    background-color: #fbe54e;
+}
+
+dl.glossary dt {
+    font-weight: bold;
+    font-size: 1.1em;
+}
+
+.field-list ul {
+    margin: 0;
+    padding-left: 1em;
+}
+
+.field-list p {
+    margin: 0;
+}
+
+.optional {
+    font-size: 1.3em;
+}
+
+.versionmodified {
+    font-style: italic;
+}
+
+.system-message {
+    background-color: #fda;
+    padding: 5px;
+    border: 3px solid red;
+}
+
+.footnote:target  {
+    background-color: #ffa;
+}
+
+.line-block {
+    display: block;
+    margin-top: 1em;
+    margin-bottom: 1em;
+}
+
+.line-block .line-block {
+    margin-top: 0;
+    margin-bottom: 0;
+    margin-left: 1.5em;
+}
+
+.guilabel, .menuselection {
+    font-family: sans-serif;
+}
+
+.accelerator {
+    text-decoration: underline;
+}
+
+.classifier {
+    font-style: oblique;
+}
+
+abbr, acronym {
+    border-bottom: dotted 1px;
+    cursor: help;
+}
+
+/* -- code displays --------------------------------------------------------- 
*/
+
+pre {
+    overflow: auto;
+    overflow-y: hidden;  /* fixes display issues on Chrome browsers */
+}
+
+td.linenos pre {
+    padding: 5px 0px;
+    border: 0;
+    background-color: transparent;
+    color: #aaa;
+}
+
+table.highlighttable {
+    margin-left: 0.5em;
+}
+
+table.highlighttable td {
+    padding: 0 0.5em 0 0.5em;
+}
+
+tt.descname {
+    background-color: transparent;
+    font-weight: bold;
+    font-size: 1.2em;
+}
+
+tt.descclassname {
+    background-color: transparent;
+}
+
+tt.xref, a tt {
+    background-color: transparent;
+    font-weight: bold;
+}
+
+h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
+    background-color: transparent;
+}
+
+.viewcode-link {
+    float: right;
+}
+
+.viewcode-back {
+    float: right;
+    font-family: sans-serif;
+}
+
+div.viewcode-block:target {
+    margin: -1px -10px;
+    padding: 0 10px;
+}
+
+/* -- math display ---------------------------------------------------------- 
*/
+
+img.math {
+    vertical-align: middle;
+}
+
+div.body div.math p {
+    text-align: center;
+}
+
+span.eqno {
+    float: right;
+}
+
+/* -- printout stylesheet --------------------------------------------------- 
*/
+
+@media print {
+    div.document,
+    div.documentwrapper,
+    div.bodywrapper {
+        margin: 0 !important;
+        width: 100%;
+    }
+
+    div.sphinxsidebar,
+    div.related,
+    div.footer,
+    #top-link {
+        display: none;
+    }
+}
\ No newline at end of file

Added: websites/staging/climate/trunk/content/api/_static/comment-bright.png
==============================================================================
Binary file - no diff available.

Propchange: 
websites/staging/climate/trunk/content/api/_static/comment-bright.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/climate/trunk/content/api/_static/comment-close.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/climate/trunk/content/api/_static/comment-close.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/climate/trunk/content/api/_static/comment.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/climate/trunk/content/api/_static/comment.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/climate/trunk/content/api/_static/default.css
==============================================================================
--- websites/staging/climate/trunk/content/api/_static/default.css (added)
+++ websites/staging/climate/trunk/content/api/_static/default.css Mon Sep 28 
18:53:23 2015
@@ -0,0 +1,256 @@
+/*
+ * default.css_t
+ * ~~~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- default theme.
+ *
+ * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+@import url("basic.css");
+
+/* -- page layout ----------------------------------------------------------- 
*/
+
+body {
+    font-family: sans-serif;
+    font-size: 100%;
+    background-color: #11303d;
+    color: #000;
+    margin: 0;
+    padding: 0;
+}
+
+div.document {
+    background-color: #1c4e63;
+}
+
+div.documentwrapper {
+    float: left;
+    width: 100%;
+}
+
+div.bodywrapper {
+    margin: 0 0 0 230px;
+}
+
+div.body {
+    background-color: #ffffff;
+    color: #000000;
+    padding: 0 20px 30px 20px;
+}
+
+div.footer {
+    color: #ffffff;
+    width: 100%;
+    padding: 9px 0 9px 0;
+    text-align: center;
+    font-size: 75%;
+}
+
+div.footer a {
+    color: #ffffff;
+    text-decoration: underline;
+}
+
+div.related {
+    background-color: #133f52;
+    line-height: 30px;
+    color: #ffffff;
+}
+
+div.related a {
+    color: #ffffff;
+}
+
+div.sphinxsidebar {
+}
+
+div.sphinxsidebar h3 {
+    font-family: 'Trebuchet MS', sans-serif;
+    color: #ffffff;
+    font-size: 1.4em;
+    font-weight: normal;
+    margin: 0;
+    padding: 0;
+}
+
+div.sphinxsidebar h3 a {
+    color: #ffffff;
+}
+
+div.sphinxsidebar h4 {
+    font-family: 'Trebuchet MS', sans-serif;
+    color: #ffffff;
+    font-size: 1.3em;
+    font-weight: normal;
+    margin: 5px 0 0 0;
+    padding: 0;
+}
+
+div.sphinxsidebar p {
+    color: #ffffff;
+}
+
+div.sphinxsidebar p.topless {
+    margin: 5px 10px 10px 10px;
+}
+
+div.sphinxsidebar ul {
+    margin: 10px;
+    padding: 0;
+    color: #ffffff;
+}
+
+div.sphinxsidebar a {
+    color: #98dbcc;
+}
+
+div.sphinxsidebar input {
+    border: 1px solid #98dbcc;
+    font-family: sans-serif;
+    font-size: 1em;
+}
+
+
+
+/* -- hyperlink styles ------------------------------------------------------ 
*/
+
+a {
+    color: #355f7c;
+    text-decoration: none;
+}
+
+a:visited {
+    color: #355f7c;
+    text-decoration: none;
+}
+
+a:hover {
+    text-decoration: underline;
+}
+
+
+
+/* -- body styles ----------------------------------------------------------- 
*/
+
+div.body h1,
+div.body h2,
+div.body h3,
+div.body h4,
+div.body h5,
+div.body h6 {
+    font-family: 'Trebuchet MS', sans-serif;
+    background-color: #f2f2f2;
+    font-weight: normal;
+    color: #20435c;
+    border-bottom: 1px solid #ccc;
+    margin: 20px -20px 10px -20px;
+    padding: 3px 0 3px 10px;
+}
+
+div.body h1 { margin-top: 0; font-size: 200%; }
+div.body h2 { font-size: 160%; }
+div.body h3 { font-size: 140%; }
+div.body h4 { font-size: 120%; }
+div.body h5 { font-size: 110%; }
+div.body h6 { font-size: 100%; }
+
+a.headerlink {
+    color: #c60f0f;
+    font-size: 0.8em;
+    padding: 0 4px 0 4px;
+    text-decoration: none;
+}
+
+a.headerlink:hover {
+    background-color: #c60f0f;
+    color: white;
+}
+
+div.body p, div.body dd, div.body li {
+    text-align: justify;
+    line-height: 130%;
+}
+
+div.admonition p.admonition-title + p {
+    display: inline;
+}
+
+div.admonition p {
+    margin-bottom: 5px;
+}
+
+div.admonition pre {
+    margin-bottom: 5px;
+}
+
+div.admonition ul, div.admonition ol {
+    margin-bottom: 5px;
+}
+
+div.note {
+    background-color: #eee;
+    border: 1px solid #ccc;
+}
+
+div.seealso {
+    background-color: #ffc;
+    border: 1px solid #ff6;
+}
+
+div.topic {
+    background-color: #eee;
+}
+
+div.warning {
+    background-color: #ffe4e4;
+    border: 1px solid #f66;
+}
+
+p.admonition-title {
+    display: inline;
+}
+
+p.admonition-title:after {
+    content: ":";
+}
+
+pre {
+    padding: 5px;
+    background-color: #eeffcc;
+    color: #333333;
+    line-height: 120%;
+    border: 1px solid #ac9;
+    border-left: none;
+    border-right: none;
+}
+
+tt {
+    background-color: #ecf0f3;
+    padding: 0 1px 0 1px;
+    font-size: 0.95em;
+}
+
+th {
+    background-color: #ede;
+}
+
+.warning tt {
+    background: #efc2c2;
+}
+
+.note tt {
+    background: #d6d6d6;
+}
+
+.viewcode-back {
+    font-family: sans-serif;
+}
+
+div.viewcode-block:target {
+    background-color: #f4debf;
+    border-top: 1px solid #ac9;
+    border-bottom: 1px solid #ac9;
+}
\ No newline at end of file

Added: websites/staging/climate/trunk/content/api/_static/doctools.js
==============================================================================
--- websites/staging/climate/trunk/content/api/_static/doctools.js (added)
+++ websites/staging/climate/trunk/content/api/_static/doctools.js Mon Sep 28 
18:53:23 2015
@@ -0,0 +1,238 @@
+/*
+ * doctools.js
+ * ~~~~~~~~~~~
+ *
+ * Sphinx JavaScript utilities for all documentation.
+ *
+ * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+/**
+ * select a different prefix for underscore
+ */
+$u = _.noConflict();
+
+/**
+ * make the code below compatible with browsers without
+ * an installed firebug like debugger
+if (!window.console || !console.firebug) {
+  var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
+    "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
+    "profile", "profileEnd"];
+  window.console = {};
+  for (var i = 0; i < names.length; ++i)
+    window.console[names[i]] = function() {};
+}
+ */
+
+/**
+ * small helper function to urldecode strings
+ */
+jQuery.urldecode = function(x) {
+  return decodeURIComponent(x).replace(/\+/g, ' ');
+};
+
+/**
+ * small helper function to urlencode strings
+ */
+jQuery.urlencode = encodeURIComponent;
+
+/**
+ * This function returns the parsed url parameters of the
+ * current request. Multiple values per key are supported,
+ * it will always return arrays of strings for the value parts.
+ */
+jQuery.getQueryParameters = function(s) {
+  if (typeof s == 'undefined')
+    s = document.location.search;
+  var parts = s.substr(s.indexOf('?') + 1).split('&');
+  var result = {};
+  for (var i = 0; i < parts.length; i++) {
+    var tmp = parts[i].split('=', 2);
+    var key = jQuery.urldecode(tmp[0]);
+    var value = jQuery.urldecode(tmp[1]);
+    if (key in result)
+      result[key].push(value);
+    else
+      result[key] = [value];
+  }
+  return result;
+};
+
+/**
+ * highlight a given string on a jquery object by wrapping it in
+ * span elements with the given class name.
+ */
+jQuery.fn.highlightText = function(text, className) {
+  function highlight(node) {
+    if (node.nodeType == 3) {
+      var val = node.nodeValue;
+      var pos = val.toLowerCase().indexOf(text);
+      if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
+        var span = document.createElement("span");
+        span.className = className;
+        span.appendChild(document.createTextNode(val.substr(pos, 
text.length)));
+        node.parentNode.insertBefore(span, node.parentNode.insertBefore(
+          document.createTextNode(val.substr(pos + text.length)),
+          node.nextSibling));
+        node.nodeValue = val.substr(0, pos);
+      }
+    }
+    else if (!jQuery(node).is("button, select, textarea")) {
+      jQuery.each(node.childNodes, function() {
+        highlight(this);
+      });
+    }
+  }
+  return this.each(function() {
+    highlight(this);
+  });
+};
+
+/**
+ * Small JavaScript module for the documentation.
+ */
+var Documentation = {
+
+  init : function() {
+    this.fixFirefoxAnchorBug();
+    this.highlightSearchWords();
+    this.initIndexTable();
+  },
+
+  /**
+   * i18n support
+   */
+  TRANSLATIONS : {},
+  PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
+  LOCALE : 'unknown',
+
+  // gettext and ngettext don't access this so that the functions
+  // can safely bound to a different name (_ = Documentation.gettext)
+  gettext : function(string) {
+    var translated = Documentation.TRANSLATIONS[string];
+    if (typeof translated == 'undefined')
+      return string;
+    return (typeof translated == 'string') ? translated : translated[0];
+  },
+
+  ngettext : function(singular, plural, n) {
+    var translated = Documentation.TRANSLATIONS[singular];
+    if (typeof translated == 'undefined')
+      return (n == 1) ? singular : plural;
+    return translated[Documentation.PLURALEXPR(n)];
+  },
+
+  addTranslations : function(catalog) {
+    for (var key in catalog.messages)
+      this.TRANSLATIONS[key] = catalog.messages[key];
+    this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + 
')');
+    this.LOCALE = catalog.locale;
+  },
+
+  /**
+   * add context elements like header anchor links
+   */
+  addContextElements : function() {
+    $('div[id] > :header:first').each(function() {
+      $('<a class="headerlink">\u00B6</a>').
+      attr('href', '#' + this.id).
+      attr('title', _('Permalink to this headline')).
+      appendTo(this);
+    });
+    $('dt[id]').each(function() {
+      $('<a class="headerlink">\u00B6</a>').
+      attr('href', '#' + this.id).
+      attr('title', _('Permalink to this definition')).
+      appendTo(this);
+    });
+  },
+
+  /**
+   * workaround a firefox stupidity
+   */
+  fixFirefoxAnchorBug : function() {
+    if (document.location.hash && $.browser.mozilla)
+      window.setTimeout(function() {
+        document.location.href += '';
+      }, 10);
+  },
+
+  /**
+   * highlight the search words provided in the url in the text
+   */
+  highlightSearchWords : function() {
+    var params = $.getQueryParameters();
+    var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
+    if (terms.length) {
+      var body = $('div.body');
+      if (!body.length) {
+        body = $('body');
+      }
+      window.setTimeout(function() {
+        $.each(terms, function() {
+          body.highlightText(this.toLowerCase(), 'highlighted');
+        });
+      }, 10);
+      $('<p class="highlight-link"><a href="javascript:Documentation.' +
+        'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
+          .appendTo($('#searchbox'));
+    }
+  },
+
+  /**
+   * init the domain index toggle buttons
+   */
+  initIndexTable : function() {
+    var togglers = $('img.toggler').click(function() {
+      var src = $(this).attr('src');
+      var idnum = $(this).attr('id').substr(7);
+      $('tr.cg-' + idnum).toggle();
+      if (src.substr(-9) == 'minus.png')
+        $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
+      else
+        $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
+    }).css('display', '');
+    if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
+        togglers.click();
+    }
+  },
+
+  /**
+   * helper function to hide the search marks again
+   */
+  hideSearchWords : function() {
+    $('#searchbox .highlight-link').fadeOut(300);
+    $('span.highlighted').removeClass('highlighted');
+  },
+
+  /**
+   * make the url absolute
+   */
+  makeURL : function(relativeURL) {
+    return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
+  },
+
+  /**
+   * get the current relative url
+   */
+  getCurrentURL : function() {
+    var path = document.location.pathname;
+    var parts = path.split(/\//);
+    $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
+      if (this == '..')
+        parts.pop();
+    });
+    var url = parts.join('/');
+    return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
+  }
+};
+
+// quick alias for translations
+_ = Documentation.gettext;
+
+$(document).ready(function() {
+  Documentation.init();
+});

Added: websites/staging/climate/trunk/content/api/_static/down-pressed.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/climate/trunk/content/api/_static/down-pressed.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/climate/trunk/content/api/_static/down.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/climate/trunk/content/api/_static/down.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/climate/trunk/content/api/_static/file.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/climate/trunk/content/api/_static/file.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/climate/trunk/content/api/_static/jquery.js
==============================================================================
--- websites/staging/climate/trunk/content/api/_static/jquery.js (added)
+++ websites/staging/climate/trunk/content/api/_static/jquery.js Mon Sep 28 
18:53:23 2015
@@ -0,0 +1,2 @@
+/*! jQuery v1.8.3 jquery.com | jquery.org/license */

[... 3 lines stripped ...]
Added: websites/staging/climate/trunk/content/api/_static/minus.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/climate/trunk/content/api/_static/minus.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/climate/trunk/content/api/_static/plus.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/climate/trunk/content/api/_static/plus.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/climate/trunk/content/api/_static/pygments.css
==============================================================================
--- websites/staging/climate/trunk/content/api/_static/pygments.css (added)
+++ websites/staging/climate/trunk/content/api/_static/pygments.css Mon Sep 28 
18:53:23 2015
@@ -0,0 +1,63 @@
+.highlight .hll { background-color: #ffffcc }
+.highlight  { background: #eeffcc; }
+.highlight .c { color: #408090; font-style: italic } /* Comment */
+.highlight .err { border: 1px solid #FF0000 } /* Error */
+.highlight .k { color: #007020; font-weight: bold } /* Keyword */
+.highlight .o { color: #666666 } /* Operator */
+.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
+.highlight .cp { color: #007020 } /* Comment.Preproc */
+.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
+.highlight .cs { color: #408090; background-color: #fff0f0 } /* 
Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #333333 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #007020 } /* Keyword.Pseudo */
+.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #902000 } /* Keyword.Type */
+.highlight .m { color: #208050 } /* Literal.Number */
+.highlight .s { color: #4070a0 } /* Literal.String */
+.highlight .na { color: #4070a0 } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
+.highlight .no { color: #60add5 } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #007020 } /* Name.Exception */
+.highlight .nf { color: #06287e } /* Name.Function */
+.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
+.highlight .nv { color: #bb60d5 } /* Name.Variable */
+.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #208050 } /* Literal.Number.Bin */
+.highlight .mf { color: #208050 } /* Literal.Number.Float */
+.highlight .mh { color: #208050 } /* Literal.Number.Hex */
+.highlight .mi { color: #208050 } /* Literal.Number.Integer */
+.highlight .mo { color: #208050 } /* Literal.Number.Oct */
+.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
+.highlight .sc { color: #4070a0 } /* Literal.String.Char */
+.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
+.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
+.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape 
*/
+.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
+.highlight .si { color: #70a0d0; font-style: italic } /* 
Literal.String.Interpol */
+.highlight .sx { color: #c65d09 } /* Literal.String.Other */
+.highlight .sr { color: #235388 } /* Literal.String.Regex */
+.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
+.highlight .ss { color: #517918 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
+.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
+.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
+.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
\ No newline at end of file

Added: websites/staging/climate/trunk/content/api/_static/searchtools.js
==============================================================================
--- websites/staging/climate/trunk/content/api/_static/searchtools.js (added)
+++ websites/staging/climate/trunk/content/api/_static/searchtools.js Mon Sep 
28 18:53:23 2015
@@ -0,0 +1,622 @@
+/*
+ * searchtools.js_t
+ * ~~~~~~~~~~~~~~~~
+ *
+ * Sphinx JavaScript utilties for the full-text search.
+ *
+ * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+
+/**
+ * Porter Stemmer
+ */
+var Stemmer = function() {
+
+  var step2list = {
+    ational: 'ate',
+    tional: 'tion',
+    enci: 'ence',
+    anci: 'ance',
+    izer: 'ize',
+    bli: 'ble',
+    alli: 'al',
+    entli: 'ent',
+    eli: 'e',
+    ousli: 'ous',
+    ization: 'ize',
+    ation: 'ate',
+    ator: 'ate',
+    alism: 'al',
+    iveness: 'ive',
+    fulness: 'ful',
+    ousness: 'ous',
+    aliti: 'al',
+    iviti: 'ive',
+    biliti: 'ble',
+    logi: 'log'
+  };
+
+  var step3list = {
+    icate: 'ic',
+    ative: '',
+    alize: 'al',
+    iciti: 'ic',
+    ical: 'ic',
+    ful: '',
+    ness: ''
+  };
+
+  var c = "[^aeiou]";          // consonant
+  var v = "[aeiouy]";          // vowel
+  var C = c + "[^aeiouy]*";    // consonant sequence
+  var V = v + "[aeiou]*";      // vowel sequence
+
+  var mgr0 = "^(" + C + ")?" + V + C;                      // [C]VC... is m>0
+  var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$";    // [C]VC[V] is m=1
+  var mgr1 = "^(" + C + ")?" + V + C + V + C;              // [C]VCVC... is m>1
+  var s_v   = "^(" + C + ")?" + v;                         // vowel in stem
+
+  this.stemWord = function (w) {
+    var stem;
+    var suffix;
+    var firstch;
+    var origword = w;
+
+    if (w.length < 3)
+      return w;
+
+    var re;
+    var re2;
+    var re3;
+    var re4;
+
+    firstch = w.substr(0,1);
+    if (firstch == "y")
+      w = firstch.toUpperCase() + w.substr(1);
+
+    // Step 1a
+    re = /^(.+?)(ss|i)es$/;
+    re2 = /^(.+?)([^s])s$/;
+
+    if (re.test(w))
+      w = w.replace(re,"$1$2");
+    else if (re2.test(w))
+      w = w.replace(re2,"$1$2");
+
+    // Step 1b
+    re = /^(.+?)eed$/;
+    re2 = /^(.+?)(ed|ing)$/;
+    if (re.test(w)) {
+      var fp = re.exec(w);
+      re = new RegExp(mgr0);
+      if (re.test(fp[1])) {
+        re = /.$/;
+        w = w.replace(re,"");
+      }
+    }
+    else if (re2.test(w)) {
+      var fp = re2.exec(w);
+      stem = fp[1];
+      re2 = new RegExp(s_v);
+      if (re2.test(stem)) {
+        w = stem;
+        re2 = /(at|bl|iz)$/;
+        re3 = new RegExp("([^aeiouylsz])\\1$");
+        re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
+        if (re2.test(w))
+          w = w + "e";
+        else if (re3.test(w)) {
+          re = /.$/;
+          w = w.replace(re,"");
+        }
+        else if (re4.test(w))
+          w = w + "e";
+      }
+    }
+
+    // Step 1c
+    re = /^(.+?)y$/;
+    if (re.test(w)) {
+      var fp = re.exec(w);
+      stem = fp[1];
+      re = new RegExp(s_v);
+      if (re.test(stem))
+        w = stem + "i";
+    }
+
+    // Step 2
+    re = 
/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
+    if (re.test(w)) {
+      var fp = re.exec(w);
+      stem = fp[1];
+      suffix = fp[2];
+      re = new RegExp(mgr0);
+      if (re.test(stem))
+        w = stem + step2list[suffix];
+    }
+
+    // Step 3
+    re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
+    if (re.test(w)) {
+      var fp = re.exec(w);
+      stem = fp[1];
+      suffix = fp[2];
+      re = new RegExp(mgr0);
+      if (re.test(stem))
+        w = stem + step3list[suffix];
+    }
+
+    // Step 4
+    re = 
/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
+    re2 = /^(.+?)(s|t)(ion)$/;
+    if (re.test(w)) {
+      var fp = re.exec(w);
+      stem = fp[1];
+      re = new RegExp(mgr1);
+      if (re.test(stem))
+        w = stem;
+    }
+    else if (re2.test(w)) {
+      var fp = re2.exec(w);
+      stem = fp[1] + fp[2];
+      re2 = new RegExp(mgr1);
+      if (re2.test(stem))
+        w = stem;
+    }
+
+    // Step 5
+    re = /^(.+?)e$/;
+    if (re.test(w)) {
+      var fp = re.exec(w);
+      stem = fp[1];
+      re = new RegExp(mgr1);
+      re2 = new RegExp(meq1);
+      re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
+      if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
+        w = stem;
+    }
+    re = /ll$/;
+    re2 = new RegExp(mgr1);
+    if (re.test(w) && re2.test(w)) {
+      re = /.$/;
+      w = w.replace(re,"");
+    }
+
+    // and turn initial Y back to y
+    if (firstch == "y")
+      w = firstch.toLowerCase() + w.substr(1);
+    return w;
+  }
+}
+
+
+
+/**
+ * Simple result scoring code.
+ */
+var Scorer = {
+  // Implement the following function to further tweak the score for each 
result
+  // The function takes a result array [filename, title, anchor, descr, score]
+  // and returns the new score.
+  /*
+  score: function(result) {
+    return result[4];
+  },
+  */
+
+  // query matches the full name of an object
+  objNameMatch: 11,
+  // or matches in the last dotted part of the object name
+  objPartialMatch: 6,
+  // Additive scores depending on the priority of the object
+  objPrio: {0:  15,   // used to be importantResults
+            1:  5,   // used to be objectResults
+            2: -5},  // used to be unimportantResults
+  //  Used when the priority is not in the mapping.
+  objPrioDefault: 0,
+
+  // query found in title
+  title: 15,
+  // query found in terms
+  term: 5
+};
+
+
+/**
+ * Search Module
+ */
+var Search = {
+
+  _index : null,
+  _queued_query : null,
+  _pulse_status : -1,
+
+  init : function() {
+      var params = $.getQueryParameters();
+      if (params.q) {
+          var query = params.q[0];
+          $('input[name="q"]')[0].value = query;
+          this.performSearch(query);
+      }
+  },
+
+  loadIndex : function(url) {
+    $.ajax({type: "GET", url: url, data: null,
+            dataType: "script", cache: true,
+            complete: function(jqxhr, textstatus) {
+              if (textstatus != "success") {
+                document.getElementById("searchindexloader").src = url;
+              }
+            }});
+  },
+
+  setIndex : function(index) {
+    var q;
+    this._index = index;
+    if ((q = this._queued_query) !== null) {
+      this._queued_query = null;
+      Search.query(q);
+    }
+  },
+
+  hasIndex : function() {
+      return this._index !== null;
+  },
+
+  deferQuery : function(query) {
+      this._queued_query = query;
+  },
+
+  stopPulse : function() {
+      this._pulse_status = 0;
+  },
+
+  startPulse : function() {
+    if (this._pulse_status >= 0)
+        return;
+    function pulse() {
+      var i;
+      Search._pulse_status = (Search._pulse_status + 1) % 4;
+      var dotString = '';
+      for (i = 0; i < Search._pulse_status; i++)
+        dotString += '.';
+      Search.dots.text(dotString);
+      if (Search._pulse_status > -1)
+        window.setTimeout(pulse, 500);
+    }
+    pulse();
+  },
+
+  /**
+   * perform a search for something (or wait until index is loaded)
+   */
+  performSearch : function(query) {
+    // create the required interface elements
+    this.out = $('#search-results');
+    this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
+    this.dots = $('<span></span>').appendTo(this.title);
+    this.status = $('<p style="display: none"></p>').appendTo(this.out);
+    this.output = $('<ul class="search"/>').appendTo(this.out);
+
+    $('#search-progress').text(_('Preparing search...'));
+    this.startPulse();
+
+    // index already loaded, the browser was quick!
+    if (this.hasIndex())
+      this.query(query);
+    else
+      this.deferQuery(query);
+  },
+
+  /**
+   * execute search (requires search index to be loaded)
+   */
+  query : function(query) {
+    var i;
+    var stopwords = 
["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
+
+    // stem the searchterms and add them to the correct list
+    var stemmer = new Stemmer();
+    var searchterms = [];
+    var excluded = [];
+    var hlterms = [];
+    var tmp = query.split(/\s+/);
+    var objectterms = [];
+    for (i = 0; i < tmp.length; i++) {
+      if (tmp[i] !== "") {
+          objectterms.push(tmp[i].toLowerCase());
+      }
+
+      if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || 
tmp[i].match(/^\d+$/) ||
+          tmp[i] === "") {
+        // skip this "word"
+        continue;
+      }
+      // stem the word
+      var word = stemmer.stemWord(tmp[i].toLowerCase());
+      var toAppend;
+      // select the correct list
+      if (word[0] == '-') {
+        toAppend = excluded;
+        word = word.substr(1);
+      }
+      else {
+        toAppend = searchterms;
+        hlterms.push(tmp[i].toLowerCase());
+      }
+      // only add if not already in the list
+      if (!$u.contains(toAppend, word))
+        toAppend.push(word);
+    }
+    var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
+
+    // console.debug('SEARCH: searching for:');
+    // console.info('required: ', searchterms);
+    // console.info('excluded: ', excluded);
+
+    // prepare search
+    var terms = this._index.terms;
+    var titleterms = this._index.titleterms;
+
+    // array of [filename, title, anchor, descr, score]
+    var results = [];
+    $('#search-progress').empty();
+
+    // lookup as object
+    for (i = 0; i < objectterms.length; i++) {
+      var others = [].concat(objectterms.slice(0, i),
+                             objectterms.slice(i+1, objectterms.length));
+      results = results.concat(this.performObjectSearch(objectterms[i], 
others));
+    }
+
+    // lookup as search terms in fulltext
+    results = results.concat(this.performTermsSearch(searchterms, excluded, 
terms, Scorer.term))
+                     .concat(this.performTermsSearch(searchterms, excluded, 
titleterms, Scorer.title));
+
+    // let the scorer override scores with a custom scoring function
+    if (Scorer.score) {
+      for (i = 0; i < results.length; i++)
+        results[i][4] = Scorer.score(results[i]);
+    }
+
+    // now sort the results by score (in opposite order of appearance, since 
the
+    // display function below uses pop() to retrieve items) and then
+    // alphabetically
+    results.sort(function(a, b) {
+      var left = a[4];
+      var right = b[4];
+      if (left > right) {
+        return 1;
+      } else if (left < right) {
+        return -1;
+      } else {
+        // same score: sort alphabetically
+        left = a[1].toLowerCase();
+        right = b[1].toLowerCase();
+        return (left > right) ? -1 : ((left < right) ? 1 : 0);
+      }
+    });
+
+    // for debugging
+    //Search.lastresults = results.slice();  // a copy
+    //console.info('search results:', Search.lastresults);
+
+    // print the results
+    var resultCount = results.length;
+    function displayNextItem() {
+      // results left, load the summary and display it
+      if (results.length) {
+        var item = results.pop();
+        var listItem = $('<li style="display:none"></li>');
+        if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
+          // dirhtml builder
+          var dirname = item[0] + '/';
+          if (dirname.match(/\/index\/$/)) {
+            dirname = dirname.substring(0, dirname.length-6);
+          } else if (dirname == 'index/') {
+            dirname = '';
+          }
+          listItem.append($('<a/>').attr('href',
+            DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
+            highlightstring + item[2]).html(item[1]));
+        } else {
+          // normal html builders
+          listItem.append($('<a/>').attr('href',
+            item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
+            highlightstring + item[2]).html(item[1]));
+        }
+        if (item[3]) {
+          listItem.append($('<span> (' + item[3] + ')</span>'));
+          Search.output.append(listItem);
+          listItem.slideDown(5, function() {
+            displayNextItem();
+          });
+        } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
+          $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[0] 
+ '.txt',
+                  dataType: "text",
+                  complete: function(jqxhr, textstatus) {
+                    var data = jqxhr.responseText;
+                    if (data !== '') {
+                      listItem.append(Search.makeSearchSummary(data, 
searchterms, hlterms));
+                    }
+                    Search.output.append(listItem);
+                    listItem.slideDown(5, function() {
+                      displayNextItem();
+                    });
+                  }});
+        } else {
+          // no source available, just display title
+          Search.output.append(listItem);
+          listItem.slideDown(5, function() {
+            displayNextItem();
+          });
+        }
+      }
+      // search finished, update title and status message
+      else {
+        Search.stopPulse();
+        Search.title.text(_('Search Results'));
+        if (!resultCount)
+          Search.status.text(_('Your search did not match any documents. 
Please make sure that all words are spelled correctly and that you\'ve selected 
enough categories.'));
+        else
+            Search.status.text(_('Search finished, found %s page(s) matching 
the search query.').replace('%s', resultCount));
+        Search.status.fadeIn(500);
+      }
+    }
+    displayNextItem();
+  },
+
+  /**
+   * search for object names
+   */
+  performObjectSearch : function(object, otherterms) {
+    var filenames = this._index.filenames;
+    var objects = this._index.objects;
+    var objnames = this._index.objnames;
+    var titles = this._index.titles;
+
+    var i;
+    var results = [];
+
+    for (var prefix in objects) {
+      for (var name in objects[prefix]) {
+        var fullname = (prefix ? prefix + '.' : '') + name;
+        if (fullname.toLowerCase().indexOf(object) > -1) {
+          var score = 0;
+          var parts = fullname.split('.');
+          // check for different match types: exact matches of full name or
+          // "last name" (i.e. last dotted part)
+          if (fullname == object || parts[parts.length - 1] == object) {
+            score += Scorer.objNameMatch;
+          // matches in last name
+          } else if (parts[parts.length - 1].indexOf(object) > -1) {
+            score += Scorer.objPartialMatch;
+          }
+          var match = objects[prefix][name];
+          var objname = objnames[match[1]][2];
+          var title = titles[match[0]];
+          // If more than one term searched for, we require other words to be
+          // found in the name/title/description
+          if (otherterms.length > 0) {
+            var haystack = (prefix + ' ' + name + ' ' +
+                            objname + ' ' + title).toLowerCase();
+            var allfound = true;
+            for (i = 0; i < otherterms.length; i++) {
+              if (haystack.indexOf(otherterms[i]) == -1) {
+                allfound = false;
+                break;
+              }
+            }
+            if (!allfound) {
+              continue;
+            }
+          }
+          var descr = objname + _(', in ') + title;
+
+          var anchor = match[3];
+          if (anchor === '')
+            anchor = fullname;
+          else if (anchor == '-')
+            anchor = objnames[match[1]][1] + '-' + fullname;
+          // add custom score for some objects according to scorer
+          if (Scorer.objPrio.hasOwnProperty(match[2])) {
+            score += Scorer.objPrio[match[2]];
+          } else {
+            score += Scorer.objPrioDefault;
+          }
+          results.push([filenames[match[0]], fullname, '#'+anchor, descr, 
score]);
+        }
+      }
+    }
+
+    return results;
+  },
+
+  /**
+   * search for full-text terms in the index
+   */
+  performTermsSearch : function(searchterms, excluded, terms, score) {
+    var filenames = this._index.filenames;
+    var titles = this._index.titles;
+
+    var i, j, file, files;
+    var fileMap = {};
+    var results = [];
+
+    // perform the search on the required terms
+    for (i = 0; i < searchterms.length; i++) {
+      var word = searchterms[i];
+      // no match but word was a required one
+      if ((files = terms[word]) === undefined)
+        break;
+      if (files.length === undefined) {
+        files = [files];
+      }
+      // create the mapping
+      for (j = 0; j < files.length; j++) {
+        file = files[j];
+        if (file in fileMap)
+          fileMap[file].push(word);
+        else
+          fileMap[file] = [word];
+      }
+    }
+
+    // now check if the files don't contain excluded terms
+    for (file in fileMap) {
+      var valid = true;
+
+      // check if all requirements are matched
+      if (fileMap[file].length != searchterms.length)
+          continue;
+
+      // ensure that none of the excluded terms is in the search result
+      for (i = 0; i < excluded.length; i++) {
+        if (terms[excluded[i]] == file ||
+          $u.contains(terms[excluded[i]] || [], file)) {
+          valid = false;
+          break;
+        }
+      }
+
+      // if we have still a valid result we can add it to the result list
+      if (valid) {
+        results.push([filenames[file], titles[file], '', null, score]);
+      }
+    }
+    return results;
+  },
+
+  /**
+   * helper function to return a node containing the
+   * search summary for a given text. keywords is a list
+   * of stemmed words, hlwords is the list of normal, unstemmed
+   * words. the first one is used to find the occurance, the
+   * latter for highlighting it.
+   */
+  makeSearchSummary : function(text, keywords, hlwords) {
+    var textLower = text.toLowerCase();
+    var start = 0;
+    $.each(keywords, function() {
+      var i = textLower.indexOf(this.toLowerCase());
+      if (i > -1)
+        start = i;
+    });
+    start = Math.max(start - 120, 0);
+    var excerpt = ((start > 0) ? '...' : '') +
+      $.trim(text.substr(start, 240)) +
+      ((start + 240 - text.length) ? '...' : '');
+    var rv = $('<div class="context"></div>').text(excerpt);
+    $.each(hlwords, function() {
+      rv = rv.highlightText(this, 'highlighted');
+    });
+    return rv;
+  }
+};
+
+$(document).ready(function() {
+  Search.init();
+});
\ No newline at end of file



Reply via email to