Commit 14e4a41b authored by Carl Schaffer's avatar Carl Schaffer
Browse files

adding test for slit_orientation method

parent 3864ec09
...@@ -188,6 +188,21 @@ class TestGris(unittest.TestCase): ...@@ -188,6 +188,21 @@ class TestGris(unittest.TestCase):
self.assertEqual(len(ax.patches), 4) self.assertEqual(len(ax.patches), 4)
return fig, ax return fig, ax
def test_slit_orientation(self):
"""
Test the slit_orientation method of gris fitsfile. It should reproduce the angle given
in a cross correlation file.
We currently set the tolerance to 15 degrees, as the performance has not been fully understood.
"""
target_data = idl.readsav(coord_save)
target_angle = target_data['slit_angle']
gff = GrisFitsFile(raw_files[0])
gff_angle = gff.slit_orientation
self.assertTrue(np.isclose(gff_angle, target_angle, atol=15),
"angle from cross correlation and GrisFitsFile don't match")
def test_gris_archive(self): def test_gris_archive(self):
""" test GrisArchive""" """ test GrisArchive"""
ga = GrisArchive(Path(self.daytarget).parent) ga = GrisArchive(Path(self.daytarget).parent)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment