Added: websites/staging/climate/trunk/content/api/1.1.0/config/config_writer.html ============================================================================== --- websites/staging/climate/trunk/content/api/1.1.0/config/config_writer.html (added) +++ websites/staging/climate/trunk/content/api/1.1.0/config/config_writer.html Wed Jul 27 17:45:58 2016 @@ -0,0 +1,243 @@ + + + + + + + + Configuration File Writer API — Apache Open Climate Workbench 1.1.0 documentation + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Configuration File Writer API¶

+
+
+ocw_config_runner.configuration_writer.export_evaluation_to_config(evaluation, file_path='./exported_eval.yaml')¶
+

Export an evaluation to a config file

+ +++ + + + +
Parameters:
    +
  • evaluation (evaluation.Evaluation) – The evaluation object to export.
  • +
  • file_path (string) – Optional file path where the config file should be saved.
  • +
+
+
+ +
+
+ocw_config_runner.configuration_writer.generate_dataset_config(dataset)¶
+

Generate dataset config file output for a given Dataset object.

+ +++ + + + + + + + + +
Parameters:dataset (dataset.Dataset) – The dataset from which to extract configuration +information.
Returns:dict() containing necessary information for +dataset to be saved into a configuration object.
Raises AttributeError:
 If dataset does not contain expected source data.
+
+ +
+
+ocw_config_runner.configuration_writer.generate_dataset_information(evaluation)¶
+

Generate dataset config file output for a given Evaluation object.

+ +++ + + + + + + + +
Parameters:evaluation (evaluation.Evaluation) – The evaluation object from which to extract metrics.
Returns:A dict() of dataset configuration information for export +to a configuration file.
Return type:dict()
+
+ +
+
+ocw_config_runner.configuration_writer.generate_evaluation_information(evaluation)¶
+

Generate evaluation-related config file output.

+

Attempts to parse out temporal and spatial rebinning/regridding information +from the supplied evaluation object. If no datasets can be found, values +are defaulted to sane defaults or (potentially) excluded entirely.

+

It’s important to note that this function does its best to extrapolate the +configuration information. It’s possible that you will encounter a scenario +where the guessed values are not what you want/expect. Please double +check the output before blinding trusting what this generates.

+ +++ + + + + + + + +
Parameters:evaluation (evaluation.Evaluation) – The evaluation object from which to extract metrics.
Returns:A dictionary of valid evaluation section settings for export +to a configuration file.
Return type:dict()
+
+ +
+
+ocw_config_runner.configuration_writer.generate_metric_information(evaluation)¶
+

Generate metric config file output from a given Evaluation object.

+ +++ + + + + + + + +
Parameters:evaluation (evaluation.Evaluation) – The evaluation object from which to extract metrics.
Returns:A list() of metrics object names for output into +a configuration file.
Return type:list() of metrics
+
+ +
+
+ocw_config_runner.configuration_writer.generate_subregion_information(evaluation)¶
+

Generate subregion config file output from a given Evaluation object.

+ +++ + + + + + + + +
Parameters:evaluation (evaluation.Evaluation) – The evaluation object from which to extract metrics.
Returns:A list() of list() objects containing bounding +box info for export into a configuration file
Return type:list() of list()
+
+ +
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file Added: websites/staging/climate/trunk/content/api/1.1.0/config/dataset_information.html ============================================================================== --- websites/staging/climate/trunk/content/api/1.1.0/config/dataset_information.html (added) +++ websites/staging/climate/trunk/content/api/1.1.0/config/dataset_information.html Wed Jul 27 17:45:58 2016 @@ -0,0 +1,212 @@ + + + + + + + + Dataset Information — Apache Open Climate Workbench 1.1.0 documentation + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

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¶

+
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 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¶

+
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. 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 formatted time values. You may also pass any optional parameters that are accepted by 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 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 dap.load() with the optional_args flag.

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file Added: websites/staging/climate/trunk/content/api/1.1.0/config/evaluation_settings.html ============================================================================== --- websites/staging/climate/trunk/content/api/1.1.0/config/evaluation_settings.html (added) +++ websites/staging/climate/trunk/content/api/1.1.0/config/evaluation_settings.html Wed Jul 27 17:45:58 2016 @@ -0,0 +1,180 @@ + + + + + + + + Evaluation Settings — Apache Open Climate Workbench 1.1.0 documentation + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

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.

+
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 dataset_processor.temporal_rebin(). The value that you pass here is interpreted as the number of days to assign to a datetime.timedelta object before running the dataset_processor.temporal_rebin() function.

+
+

Note

+

This attribute is only useful if you use the configuration data to create an evaluation.Evaluation object with the 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 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 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 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 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 formatted time values.

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file Added: websites/staging/climate/trunk/content/api/1.1.0/config/metrics_information.html ============================================================================== --- websites/staging/climate/trunk/content/api/1.1.0/config/metrics_information.html (added) +++ websites/staging/climate/trunk/content/api/1.1.0/config/metrics_information.html Wed Jul 27 17:45:58 2016 @@ -0,0 +1,131 @@ + + + + + + + + Metrics Information — Apache Open Climate Workbench 1.1.0 documentation + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Metrics Information¶

+
+

Note

+

At the moment, you can only load metrics that are in 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 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
+
+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file Added: websites/staging/climate/trunk/content/api/1.1.0/config/plots_settings.html ============================================================================== --- websites/staging/climate/trunk/content/api/1.1.0/config/plots_settings.html (added) +++ websites/staging/climate/trunk/content/api/1.1.0/config/plots_settings.html Wed Jul 27 17:45:58 2016 @@ -0,0 +1,162 @@ + + + + + + + + Plots Settings — Apache Open Climate Workbench 1.1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

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 evaluation.Evaluation documentation for more details.

+
+

Contour Maps¶

+

The contour maps config configures data for OCW’s contour plotter 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 plotting.draw_contour_map() function with the optional_args flag.

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file