climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject [2/6] climate git commit: CLIMATE-542: Swap x and y names (lats = y axis, lons = x axis)
Date Thu, 06 Nov 2014 20:51:11 GMT
CLIMATE-542: Swap x and y names (lats = y axis, lons = x axis)


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/e0393a19
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/e0393a19
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/e0393a19

Branch: refs/heads/master
Commit: e0393a193f60bbbe1e718016a8a223ef5900eab4
Parents: 16578ed
Author: rlaidlaw <rlaidlaw.open@gmail.com>
Authored: Wed Nov 5 17:40:13 2014 -0800
Committer: rlaidlaw <rlaidlaw.open@gmail.com>
Committed: Wed Nov 5 17:40:13 2014 -0800

----------------------------------------------------------------------
 ocw/metrics.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/e0393a19/ocw/metrics.py
----------------------------------------------------------------------
diff --git a/ocw/metrics.py b/ocw/metrics.py
index 815380c..1504404 100644
--- a/ocw/metrics.py
+++ b/ocw/metrics.py
@@ -171,16 +171,16 @@ class TemporalCorrelation(BinaryMetric):
             array of confidence levels associated with the temporal correlation
             coefficients
         '''
-        nt, nx, ny = reference_dataset.values.shape
-        tc = numpy.zeros([nx, ny])
-        cl = numpy.zeros([nx, ny])
-        for ix in numpy.arange(nx):
-            for iy in numpy.arange(ny):
-                tc[ix, iy], cl[ix, iy] = stats.pearsonr(
-                                           reference_dataset.values[:, ix, iy],
-                                           target_dataset.values[:, ix, iy]
+        nt, ny, nx = reference_dataset.values.shape
+        tc = numpy.zeros([ny, nx])
+        cl = numpy.zeros([ny, nx])
+        for iy in numpy.arange(ny):
+            for ix in numpy.arange(nx):
+                tc[iy, ix], cl[iy, ix] = stats.pearsonr(
+                                           reference_dataset.values[:, iy, ix],
+                                           target_dataset.values[:, iy, ix]
                                          )
-                cl[ix, iy] = 1 - cl[ix, iy]
+                cl[iy, ix] = 1 - cl[iy, ix]
         return tc, cl 
 
 


Mime
View raw message