-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from borondics/test_functions
Starting to test functions
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import unittest | ||
import os | ||
|
||
import numpy as np | ||
|
||
import pySNOM | ||
from pySNOM import NeaImage | ||
|
||
|
||
class test_public_functions(unittest.TestCase): | ||
def test_normalize_simple(self): | ||
f = 'datasets/image.gwy' | ||
im = NeaImage() | ||
im.read_from_gwyfile(os.path.join(pySNOM.__path__[0], f), 'M1A raw') | ||
|
||
im2 = pySNOM.normalize_simple(im) | ||
|
||
np.testing.assert_almost_equal(im2.data[4][8], -0.018852233886) | ||
np.testing.assert_almost_equal(im2.data[7][5], 2.023254394531) | ||
|
||
def self_reference(self): | ||
# TODO for testing these we need to have a better test file with actual optical data | ||
f = 'datasets/image.gwy' | ||
im = NeaImage() | ||
im.read_from_gwyfile(os.path.join(pySNOM.__path__[0], f), 'M1A raw') | ||
|
||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |