Welcome to Apache Open Climate Workbench’s documentation!

Contents:

Dataset Module

Bounds

class dataset.Bounds(lat_min, lat_max, lon_min, lon_max, start, end)

Container for holding spatial and temporal bounds information.

Certain operations require valid bounding information to be present for correct functioning. Bounds guarantees that a function receives well formed information without the need to do the validation manually.

Spatial and temporal bounds must follow the following guidelines.

  • Latitude values must be in the range [-90, 90]
  • Longitude values must be in the range [-180, 180]
  • Lat/Lon Min values must be less than the corresponding Lat/Lon Max values.
  • Temporal bounds must a valid datetime object

Default Bounds constructor

Parameters:
  • lat_min (float) – The minimum latitude bound.
  • lat_max (float) – The maximum latitude bound.
  • lon_min (float) – The minimum longitude bound.
  • lon_max (float) – The maximum longitude bound.
  • start (datetime) – The starting datetime bound.
  • end (datetime) – The ending datetime bound.
Raises:

ValueError

Dataset

class dataset.Dataset(lats, lons, times, values, variable=None, name='')

Container for a dataset’s attributes and data.

Default Dataset constructor

Parameters:
  • lats (numpy array) – One dimensional numpy array of unique latitude values.
  • lons (numpy array) – One dimensional numpy array of unique longitude values.
  • times (numpy array) – One dimensional numpy array of unique python datetime objects.
  • values (numpy array) – Three dimensional numpy array of parameter values with shape [timesLength, latsLength, lonsLength].
  • variable (string) – Name of the value variable.
  • name – An optional string name for the Dataset.
Raises:

ValueError

spatial_boundaries()

Calculate the spatial boundaries.

Returns:The Dataset’s bounding latitude and longitude values as a tuple in the form (min_lat, max_lat, min_lon, max_lon)
Return type:(float, float, float, float)
spatial_resolution()

Calculate the latitudinal and longitudinal spatial resolution.

Warning

This only works with properly gridded data.

Returns:The Dataset’s latitudinal and longitudinal spatial resolution as a tuple of the form (lat_resolution, lon_resolution).
Return type:(float, float)
temporal_resolution()

Calculate the temporal resolution.

Raises ValueError:
 If timedelta.days as calculated from the sorted list of times is an unrecognized value a ValueError is raised.
Returns:The temporal resolution.
Return type:string
time_range()

Calculate the temporal range

Returns:The start and end date of the Dataset’s temporal range as a tuple in the form (start_time, end_time).
Return type:(datetime, datetime)

Dataset Processor Module

Evaluation Module

Metrics Module

UnaryMetric

class metrics.UnaryMetric

Abstract Base Class from which all unary metrics inherit.

x.__init__(...) initializes x; see help(type(x)) for signature

run(target_dataset)

Run the metric for a given target dataset.

Parameters:target_dataset – The dataset on which the current metric will be run.
Returns:The result of evaluating the metric on the target_dataset.

BinaryMetric

class metrics.BinaryMetric

Abstract Base Class from which all binary metrics inherit.

x.__init__(...) initializes x; see help(type(x)) for signature

run(ref_dataset, target_dataset)

Run the metric for the given reference and target datasets.

Parameters:
  • ref_dataset (Dataset) – The Dataset to use as the reference dataset when running the evaluation.
  • target_dataset – The Dataset to use as the target dataset when running the evaluation.
Returns:

The result of evaluation the metric on the reference and target dataset.

Bias

class metrics.Bias

Calculate the bias between a reference and target dataset.

x.__init__(...) initializes x; see help(type(x)) for signature

run(ref_dataset, target_dataset)

Calculate the bias between a reference and target dataset.

Note

Overrides BinaryMetric.run()

Parameters:
  • ref_dataset (Dataset.) – The reference dataset to use in this metric run.
  • target_dataset (Dataset.) – The target dataset to evaluate against the reference dataset in this metric run.
Returns:

The difference between the reference and target datasets.

Return type:

Numpy Array

TemporalStdDev

class metrics.TemporalStdDev

Calculate the standard deviation over the time.

x.__init__(...) initializes x; see help(type(x)) for signature

run(target_dataset)

Calculate the temporal std. dev. for a datasets.

Note

Overrides UnaryMetric.run()

Parameters:target_dataset (Dataset) – The target_dataset on which to calculate the temporal standard deviation.
Returns:The temporal standard deviation of the target dataset
Return type:Numpy Array

Plotter Module

Data Sources

Local Module

RCMED Module

DAP Module

Indices and tables