diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-01-08 12:09:08 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-01-08 12:20:03 +0100 |
commit | 58820d2e538068bf0c19abc8ab2182c90727bed7 (patch) | |
tree | d7f1c15816a265aac208592c4673d5e26b8b7871 /test | |
parent | 9ebde005aa7ddee8ffe855f93601fecc33690f8c (diff) |
doublenull: use interp.py for 2D interpolation
Diffstat (limited to 'test')
-rw-r--r-- | test/test_doublenull.npz | bin | 103064 -> 103064 bytes | |||
-rw-r--r-- | test/test_doublenull.py | 15 |
2 files changed, 12 insertions, 3 deletions
diff --git a/test/test_doublenull.npz b/test/test_doublenull.npz Binary files differindex 4745593..c668973 100644 --- a/test/test_doublenull.npz +++ b/test/test_doublenull.npz diff --git a/test/test_doublenull.py b/test/test_doublenull.py index a61af33..204870d 100644 --- a/test/test_doublenull.py +++ b/test/test_doublenull.py @@ -9,10 +9,15 @@ from nr_analysis_axi import doublenull, invars class TestDoubleNull(TestCase): - def setUp(self): - datafile = os.path.splitext(__file__)[0] + '.npz' + def _data_path(self): + return os.path.splitext(__file__)[0] + '.npz' + + def update_refs(self, **kwargs): + data = dict(self.data) | kwargs + np.savez(self._data_path(), **data) - self.data = np.load(datafile) + def setUp(self): + self.data = np.load(self._data_path()) def test_null_curves(self): rays = doublenull.null_curves(self.data['t'], self.data['x'], @@ -23,6 +28,8 @@ class TestDoubleNull(TestCase): assert_allclose(rays[1], self.data['rays_pos'], 1e-12) assert_allclose(rays[2], self.data['rays_neg'], 1e-12) + #self.update_refs(ray_times = rays[0], rays_pos = rays[1], rays_neg = rays[2]) + def test_null_coordinates(self): x = self.data['x'] idx = x.shape[0] // 2 @@ -34,3 +41,5 @@ class TestDoubleNull(TestCase): -(self.data['alpha'] ** 2)) assert_allclose(coords[0], self.data['uxt'], 1e-12) assert_allclose(coords[1], self.data['vxt'], 1e-12) + + #self.update_refs(uxt = coords[0], vxt = coords[1]) |