CLIMATE-110: Pull the raw_inputs out of calcPdf()

git-svn-id: https://svn.apache.org/repos/asf/incubator/climate/trunk@1507011 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: 9579ee7e5661967efbc58eae1cd30eae6f1c31b4
diff --git a/rcmet/src/main/python/rcmes/toolkit/metrics.py.REMOVED.git-id b/rcmet/src/main/python/rcmes/toolkit/metrics.py.REMOVED.git-id
index 45795f6..21cec8b 100644
--- a/rcmet/src/main/python/rcmes/toolkit/metrics.py.REMOVED.git-id
+++ b/rcmet/src/main/python/rcmes/toolkit/metrics.py.REMOVED.git-id
@@ -1 +1 @@
-48cd891229e7d00f4bc3ada690d5477d3ee634af
\ No newline at end of file
+e432930085da59f77d6867a36b85a1148824e7f0
\ No newline at end of file
diff --git a/rcmet/src/main/python/tests/test_metrics.py b/rcmet/src/main/python/tests/test_metrics.py
new file mode 100644
index 0000000..07ac33e
--- /dev/null
+++ b/rcmet/src/main/python/tests/test_metrics.py
@@ -0,0 +1,52 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+import unittest
+
+import toolkit.metrics
+
+import numpy as np
+import numpy.ma as ma
+
+
+class TestCalcPdf(unittest.TestCase):
+    
+    def testUsingSettingsKwarg(self):
+
+        # declare and initialize 1d arrays (mimick timeseries)
+        good_pdf = '0.091'
+      
+        # declare and initialize  3d(time,lat,lon) type array
+        evaluationDataset = np.arange(0, 12, 0.5)
+        evaluationDataset = evaluationDataset.reshape(4, 2, 3)
+        evaluationDataset = ma.array(evaluationDataset)
+    
+        referenceDataset = np.arange(10, 34)
+        referenceDataset = referenceDataset.reshape(4, 2, 3)
+        referenceDataset = ma.array(referenceDataset)
+
+        settings = (3, 10, 20)
+
+        pdf =  '%.3f' % toolkit.metrics.calcPdf(evaluationDataset, referenceDataset, settings)
+        # Checking accuracy to 3 decimal places using a simple string comparison
+        self.assertEqual(pdf, good_pdf)
+        
+
+if __name__ == '__main__':
+    unittest.main()