climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huiky...@apache.org
Subject svn commit: r1491557 - in /incubator/climate/trunk/rcmet/src/main/python/rcmes: resources/cordexAF.cfg utils/misc.py
Date Mon, 10 Jun 2013 18:30:55 GMT
Author: huikyole
Date: Mon Jun 10 18:30:54 2013
New Revision: 1491557

URL: http://svn.apache.org/r1491557
Log:
Review Board #11743 & JIRA CLIATE-88: Small update to misc.py for improving performance
in metrics.py. Kyo is committing this for Alex until his SVN access is approved

Modified:
    incubator/climate/trunk/rcmet/src/main/python/rcmes/resources/cordexAF.cfg
    incubator/climate/trunk/rcmet/src/main/python/rcmes/utils/misc.py

Modified: incubator/climate/trunk/rcmet/src/main/python/rcmes/resources/cordexAF.cfg
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/python/rcmes/resources/cordexAF.cfg?rev=1491557&r1=1491556&r2=1491557&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/python/rcmes/resources/cordexAF.cfg (original)
+++ incubator/climate/trunk/rcmet/src/main/python/rcmes/resources/cordexAF.cfg Mon Jun 10
18:30:54 2013
@@ -1,6 +1,6 @@
 [SETTINGS]
-workDir=/home/huikyole/work/RCMES/cases/cordex-af
-cacheDir=/nas/share4-cf/huikyole/RCMES_cache
+workDir=/Users/huikyole/work/RCMES/cases/cordex-af
+cacheDir=/Users/huikyole/work/RCMES/cache
 # Choices: full, annual, monthly, daily
 temporalGrid=monthly
 # Choices, obs, model, user
@@ -14,7 +14,7 @@ lonMax=60.28 ; only use with user spatia
 # Choices: False, NetCDF
 outputFile=NetCDF
 [MODEL]
-filenamePattern=/nas/share4-cf/jinwonki/data/cordex-af/*pr.nc
+filenamePattern=/Users/huikyole/data/cordex-af/*pr.nc
 latVariable=lat
 lonVariable=lon
 timeVariable=time

Modified: incubator/climate/trunk/rcmet/src/main/python/rcmes/utils/misc.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/python/rcmes/utils/misc.py?rev=1491557&r1=1491556&r2=1491557&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/python/rcmes/utils/misc.py (original)
+++ incubator/climate/trunk/rcmet/src/main/python/rcmes/utils/misc.py Mon Jun 10 18:30:54
2013
@@ -16,6 +16,29 @@ import classes
 
 from fortranfile import FortranFile
 
+def reshapeMonthlyData(dataset1):
+    """
+    Purpose::
+       Returns a view of an array with shape (nMonth, ...)
+       reshaped to (nYR, 12, ...) in order to assist in monthly
+       calculations
+    Input::
+       dataset1 - an input array with the first dimension corresponding
+       to the number of months, which must be a multiple of 12
+    Output::
+       data - A view of dataset1 but with shape (nYR, 12, ...).
+    """
+    
+    # Create a view of dataset1. This lets us change the shape
+    # without copying or modifying the original array.
+    data = dataset1[:]
+    ishape = data.shape
+    nMonth = ishape[0]
+    nshape = nMonth/12, 12
+    
+    # Combine the number of years / months (nshape) with other dimensions
+    data.shape = tuple(list(nshape) + list(ishape[1:]))
+    return data
 
 def configToDict(config):
     """



Mime
View raw message