You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2014/07/02 18:23:23 UTC
[1/2] git commit: CLIMATE-482 - Add basic StdDevRatio metric
Repository: climate
Updated Branches:
refs/heads/master 9b6d73d48 -> 2b71d0b9e
CLIMATE-482 - Add basic StdDevRatio metric
- Add a version of StdDevRatio without an yearly/seasonal rebinning
prior to metric calculation.
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/b632d481
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/b632d481
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/b632d481
Branch: refs/heads/master
Commit: b632d48105cd6b662a201ebd8673d31684add3bf
Parents: 9b6d73d
Author: Michael Joyce <jo...@apache.org>
Authored: Wed Jul 2 07:48:22 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Wed Jul 2 07:48:22 2014 -0700
----------------------------------------------------------------------
ocw/metrics.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/b632d481/ocw/metrics.py
----------------------------------------------------------------------
diff --git a/ocw/metrics.py b/ocw/metrics.py
index d040c11..b7036c4 100644
--- a/ocw/metrics.py
+++ b/ocw/metrics.py
@@ -106,6 +106,26 @@ class TemporalStdDev(UnaryMetric):
return target_dataset.values.std(axis=0, ddof=1)
+class StdDevRatio(BinaryMetric):
+ '''Calculate the standard deviation ratio between two datasets.'''
+
+ def run(self, ref_dataset, target_dataset):
+ '''Calculate the standard deviation ratio.
+
+ .. 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 standard deviation ratio of the reference and target
+ '''
+ return target_dataset.values.std() / ref_dataset.values.std()
+
+
class SpatialStdDevRatio(BinaryMetric):
'''Calculate the ratio of spatial standard deviation (model standard
deviation)/(observed standard deviation)'''
[2/2] git commit: Resolve CLIMATE-482. Merge PR #84.
Posted by jo...@apache.org.
Resolve CLIMATE-482. Merge PR #84.
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/2b71d0b9
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/2b71d0b9
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/2b71d0b9
Branch: refs/heads/master
Commit: 2b71d0b9e97de2d4083762098a900a0f125f9663
Parents: 9b6d73d b632d48
Author: Michael Joyce <jo...@apache.org>
Authored: Wed Jul 2 09:23:01 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Wed Jul 2 09:23:01 2014 -0700
----------------------------------------------------------------------
ocw/metrics.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
----------------------------------------------------------------------