You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by hu...@apache.org on 2017/01/10 16:19:19 UTC

[1/3] climate git commit: fixed

Repository: climate
Updated Branches:
  refs/heads/master 9fa81d3bc -> d98d172f5


fixed


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

Branch: refs/heads/master
Commit: 1d7aaf7b5a9e0c72c86e5b6e0699e0c55b250497
Parents: 7187cf3
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Mon Jan 9 20:57:04 2017 -0800
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Mon Jan 9 20:57:04 2017 -0800

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


http://git-wip-us.apache.org/repos/asf/climate/blob/1d7aaf7b/ocw/metrics.py
----------------------------------------------------------------------
diff --git a/ocw/metrics.py b/ocw/metrics.py
index c796e96..2f56d75 100644
--- a/ocw/metrics.py
+++ b/ocw/metrics.py
@@ -330,7 +330,7 @@ def calc_correlation(target_array, reference_array):
     :param reference_array: an array of reference dataset
     :type reference_array: :class:'numpy.ma.core.MaskedArray'
 
-    :returns: pearson's correlation coefficient between the two input arrays
+    :returns: pearson's correlation coefficient between the two inumpy.t arrays
     :rtype: :class:'numpy.ma.core.MaskedArray'
     '''
 
@@ -418,10 +418,10 @@ def wet_spell_analysis(reference_array, threshold=0.1, nyear=1, dt=3.):
     '''
     nt = reference_array.shape[0]
     if reference_array.ndim == 3:
-        reshaped_array = reference_array.reshape[nt, reference_array.size / nt]
+        reshaped_array = reference_array.reshape([nt, reference_array.size / nt])
     else:
         reshaped_array = reference_array
-    xy_indices = np.where(reshaped_array.mask[0, :] == False)[0]
+    xy_indices = numpy.where(reshaped_array.mask[0, :] == False)[0]
 
     nt_each_year = nt / nyear
     spell_duration = []
@@ -429,16 +429,16 @@ def wet_spell_analysis(reference_array, threshold=0.1, nyear=1, dt=3.):
     total_rainfall = []
 
     for index in xy_indices:
-        for iyear in np.arange(nyear):
+        for iyear in numpy.arange(nyear):
             data0_temp = reshaped_array[nt_each_year * iyear:nt_each_year * (iyear + 1),
                                         index]
             # time indices when precipitation rate is smaller than the
             # threshold [mm/hr]
-            t_index = np.where((data0_temp <= threshold) &
+            t_index = numpy.where((data0_temp <= threshold) &
                                (data0_temp.mask == False))[0]
-            t_index = np.insert(t_index, 0, 0)
+            t_index = numpy.insert(t_index, 0, 0)
             t_index = t_index + nt_each_year * iyear
-            for it in np.arange(t_index.size - 1):
+            for it in numpy.arange(t_index.size - 1):
                 if t_index[it + 1] - t_index[it] > 1:
                     data1_temp = data0_temp[t_index[it] + 1:t_index[it + 1]]
                     if not ma.is_masked(data1_temp):
@@ -446,4 +446,4 @@ def wet_spell_analysis(reference_array, threshold=0.1, nyear=1, dt=3.):
                             (t_index[it + 1] - t_index[it] - 1) * dt)
                         peak_rainfall.append(data1_temp.max())
                         total_rainfall.append(data1_temp.sum())
-    return np.array(spell_duration), np.array(peak_rainfall), np.array(total_rainfall)
+    return numpy.array(spell_duration), numpy.array(peak_rainfall), numpy.array(total_rainfall)


[3/3] climate git commit: CLIMATE-893 - Debugging wet_spell_analysis

Posted by hu...@apache.org.
CLIMATE-893 - Debugging wet_spell_analysis


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

Branch: refs/heads/master
Commit: d98d172f54877fd00f0c81ae5b7c7ecf356ffca5
Parents: 9fa81d3 80483c2
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Tue Jan 10 08:18:55 2017 -0800
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Tue Jan 10 08:18:55 2017 -0800

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



[2/3] climate git commit: fixed2

Posted by hu...@apache.org.
fixed2


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

Branch: refs/heads/master
Commit: 80483c29cea17ce21c04c6dd183bae2eb556566a
Parents: 1d7aaf7
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Mon Jan 9 20:59:29 2017 -0800
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Mon Jan 9 20:59:29 2017 -0800

----------------------------------------------------------------------
 ocw/metrics.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/80483c29/ocw/metrics.py
----------------------------------------------------------------------
diff --git a/ocw/metrics.py b/ocw/metrics.py
index 2f56d75..ecd686c 100644
--- a/ocw/metrics.py
+++ b/ocw/metrics.py
@@ -330,7 +330,7 @@ def calc_correlation(target_array, reference_array):
     :param reference_array: an array of reference dataset
     :type reference_array: :class:'numpy.ma.core.MaskedArray'
 
-    :returns: pearson's correlation coefficient between the two inumpy.t arrays
+    :returns: pearson's correlation coefficient between the two input arrays
     :rtype: :class:'numpy.ma.core.MaskedArray'
     '''