Loading ale/base/data_isis.py +8 −0 Original line number Diff line number Diff line Loading @@ -205,6 +205,8 @@ class IsisSpice(): binary_data = read_table_data(table, self._file) self._inst_pointing_table = parse_table(table, binary_data) return self._inst_pointing_table raise ValueError(f'Could not find InstrumentPointing table on file {self._file}') return self._inst_pointing_table @property def body_orientation_table(self): Loading @@ -223,6 +225,8 @@ class IsisSpice(): binary_data = read_table_data(table, self._file) self._body_orientation_table = parse_table(table, binary_data) return self._body_orientation_table raise ValueError(f'Could not find BodyRotation table on file {self._file}') return self._body_orientation_table @property def inst_position_table(self): Loading @@ -241,6 +245,8 @@ class IsisSpice(): binary_data = read_table_data(table, self._file) self._inst_position_table = parse_table(table, binary_data) return self._inst_position_table raise ValueError(f'Could not find InstrumentPosition table on file {self._file}') return self._inst_position_table @property def sun_position_table(self): Loading @@ -259,6 +265,8 @@ class IsisSpice(): binary_data = read_table_data(table, self._file) self._sun_position_table = parse_table(table, binary_data) return self._sun_position_table raise ValueError(f'Could not find SunPosition table on file {self._file}') return self._sun_position_table def __enter__(self): """ Loading tests/pytests/test_data_isis.py +15 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import pvl import numpy as np from ale.base.data_isis import IsisSpice from conftest import get_image_label testlabel = """ Object = IsisCube Loading Loading @@ -699,3 +700,17 @@ def test_inst_position_cache(testdata): [[-1000, -2000*np.pi*np.sqrt(3)/9, 2000*np.pi*np.sqrt(3)/9], [-2000*np.pi*np.sqrt(3)/9, 2000*np.pi*np.sqrt(3)/9, -1000]]) np.testing.assert_equal(sensor_times, [0, 1]) def test_no_tables(): test_file = get_image_label('B10_013341_1010_XN_79S172W') test_mix_in = IsisSpice() test_mix_in._file = test_file test_mix_in.label = pvl.load(test_file) with pytest.raises(ValueError): test_mix_in.inst_pointing_table with pytest.raises(ValueError): test_mix_in.body_orientation_table with pytest.raises(ValueError): test_mix_in.inst_position_table with pytest.raises(ValueError): test_mix_in.sun_position_table Loading
ale/base/data_isis.py +8 −0 Original line number Diff line number Diff line Loading @@ -205,6 +205,8 @@ class IsisSpice(): binary_data = read_table_data(table, self._file) self._inst_pointing_table = parse_table(table, binary_data) return self._inst_pointing_table raise ValueError(f'Could not find InstrumentPointing table on file {self._file}') return self._inst_pointing_table @property def body_orientation_table(self): Loading @@ -223,6 +225,8 @@ class IsisSpice(): binary_data = read_table_data(table, self._file) self._body_orientation_table = parse_table(table, binary_data) return self._body_orientation_table raise ValueError(f'Could not find BodyRotation table on file {self._file}') return self._body_orientation_table @property def inst_position_table(self): Loading @@ -241,6 +245,8 @@ class IsisSpice(): binary_data = read_table_data(table, self._file) self._inst_position_table = parse_table(table, binary_data) return self._inst_position_table raise ValueError(f'Could not find InstrumentPosition table on file {self._file}') return self._inst_position_table @property def sun_position_table(self): Loading @@ -259,6 +265,8 @@ class IsisSpice(): binary_data = read_table_data(table, self._file) self._sun_position_table = parse_table(table, binary_data) return self._sun_position_table raise ValueError(f'Could not find SunPosition table on file {self._file}') return self._sun_position_table def __enter__(self): """ Loading
tests/pytests/test_data_isis.py +15 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import pvl import numpy as np from ale.base.data_isis import IsisSpice from conftest import get_image_label testlabel = """ Object = IsisCube Loading Loading @@ -699,3 +700,17 @@ def test_inst_position_cache(testdata): [[-1000, -2000*np.pi*np.sqrt(3)/9, 2000*np.pi*np.sqrt(3)/9], [-2000*np.pi*np.sqrt(3)/9, 2000*np.pi*np.sqrt(3)/9, -1000]]) np.testing.assert_equal(sensor_times, [0, 1]) def test_no_tables(): test_file = get_image_label('B10_013341_1010_XN_79S172W') test_mix_in = IsisSpice() test_mix_in._file = test_file test_mix_in.label = pvl.load(test_file) with pytest.raises(ValueError): test_mix_in.inst_pointing_table with pytest.raises(ValueError): test_mix_in.body_orientation_table with pytest.raises(ValueError): test_mix_in.inst_position_table with pytest.raises(ValueError): test_mix_in.sun_position_table