summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2019-06-21 10:21:18 +0100
committerEdoardo Pasca <edo.paskino@gmail.com>2019-06-21 10:21:18 +0100
commitdfa613cee88cc7fc5891e1a270b402986ce6bf5b (patch)
treee9b0110c9116a2258b5615ea1d04a3e1ed86f7d5
parentb384d772d707089ac9a56d80b9c6bf0fe37070dd (diff)
downloadframework-dfa613cee88cc7fc5891e1a270b402986ce6bf5b.tar.gz
framework-dfa613cee88cc7fc5891e1a270b402986ce6bf5b.tar.bz2
framework-dfa613cee88cc7fc5891e1a270b402986ce6bf5b.tar.xz
framework-dfa613cee88cc7fc5891e1a270b402986ce6bf5b.zip
added initial test for random_noise
-rwxr-xr-xWrappers/Python/test/test_TestData.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Wrappers/Python/test/test_TestData.py b/Wrappers/Python/test/test_TestData.py
new file mode 100755
index 0000000..cb44a07
--- /dev/null
+++ b/Wrappers/Python/test/test_TestData.py
@@ -0,0 +1,18 @@
+from .testclass import CCPiTestClass
+import numpy
+from ccpi.framework import TestData
+import os
+
+
+
+class TestTestData(CCPiTestClass):
+ def test_random_noise(self):
+ #loader = TestData(data_dir=os.path.join(sys.prefix, 'share','ccpi'))
+ #data_dir=os.path.join(os.path.dirname(__file__),'..', 'data')
+ loader = TestData()
+
+ camera = loader.load(TestData.CAMERA)
+
+ noisy_camera = TestData.random_noise(camera, seed=1)
+ norm = (camera-noisy_camera).norm()
+ self.assertAlmostEqual(norm, 48.881268, places=4)