You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by go...@apache.org on 2013/07/09 16:47:17 UTC
svn commit: r1501301 -
/incubator/climate/trunk/rcmet/src/main/python/rcmes/utils/misc.py
Author: goodale
Date: Tue Jul 9 14:47:17 2013
New Revision: 1501301
URL: http://svn.apache.org/r1501301
Log:
CLIMATE-177 - Added in guards to prevent users for selecting inactive metrics when using the CLI.
Modified:
incubator/climate/trunk/rcmet/src/main/python/rcmes/utils/misc.py
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=1501301&r1=1501300&r2=1501301&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 Tue Jul 9 14:47:17 2013
@@ -1205,6 +1205,7 @@ def getSpatialGrid():
return False
else:
return spatialGrid
+
def askUserForVariableName(variableNames, targetName):
if targetName == "analysis":
print("Select the variable you want to use for analysis/metrics:")
@@ -1351,9 +1352,9 @@ def select_metrics():
print 'Metric options'
print '[0] Bias: mean bias across full time range'
print '[1] Mean Absolute Error: across full time range'
- print '[2] Spatial Pattern Correlation: results in a time series of spatial correlation coeff'
+ print '[2] TODO: Spatial Pattern Correlation: results in a time series of spatial correlation coeff'
print '[3] Temporal Correlation: results in 2-d array of temporal correlation coefficient'
- print '[4] Spatial Pattern Correlation between averaged fields: results in a single correlation coeff'
+ print '[4] TODO: Spatial Pattern Correlation between averaged fields: results in a single correlation coeff'
print '[5] RMSE in time: results in a 2-d array of RMSE over two time series'
print '[6] TODO: Probability Distribution Function similarity score'
choice = int(raw_input('Please make a selection from the options above\n> '))
@@ -1362,16 +1363,19 @@ def select_metrics():
metricOption = 'BIAS'
elif choice == 1:
metricOption = 'MAE'
- elif choice == 2:
- metricOption = 'PCt'
+ #elif choice == 2:
+ # metricOption = 'PCt'
elif choice == 3:
metricOption = 'TC'
- elif choice == 4:
- metricOption = 'PCC'
+ #elif choice == 4:
+ # metricOption = 'PCC'
elif choice == 5:
metricOption = 'RMSt'
- elif choice == 6:
- metricOption = 'pdfSkillScore'
- print 'in subroutine metricOption = ', metricOption
+ #elif choice == 6:
+ # metricOption = 'pdfSkillScore'
+ else:
+ print("Your selection: %s is invalid, please try again\n" % choice)
+ metricOption = select_metrics()
+
return metricOption