diff --git a/.travis.yml b/.travis.yml index c58ef777ec91d8f6baf210c7382aa55a5f302459..bcff8d8d101769ad846e113c78800908961958a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,8 @@ install: - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - conda config --set always_yes yes - - conda env create -f environment.yml -n ale + - conda env create -n ale python=3.7.3 + - conda env update -f environment.yml -n ale - source activate ale - conda install pytest diff --git a/ale/base/data_naif.py b/ale/base/data_naif.py index b6a025c32690b2b1a8c93fd91d9e7e1b994d4cdd..504242022c429b6668c3f02643cb69a6d21cd5fc 100644 --- a/ale/base/data_naif.py +++ b/ale/base/data_naif.py @@ -322,12 +322,12 @@ class NaifSpice(): pos = [] vel = [] - target = self.target_name - observer = self.spacecraft_name + target = self.spacecraft_name + observer = self.target_name # Check for ISIS flag to fix target and observer swapping if self.swap_observer_target: - target = self.spacecraft_name - observer = self.target_name + target = self.target_name + observer = self.spacecraft_name for time in ephem: # spkezr returns a vector from the observer's location to the aberration-corrected @@ -339,11 +339,11 @@ class NaifSpice(): self.light_time_correction, observer) if self.swap_observer_target: - pos.append(state[:3]) - vel.append(state[3:]) - else: pos.append(-state[:3]) vel.append(-state[3:]) + else: + pos.append(state[:3]) + vel.append(state[3:]) # By default, SPICE works in km, so convert to m self._position = [p * 1000 for p in pos] @@ -353,7 +353,10 @@ class NaifSpice(): @property def frame_chain(self): if not hasattr(self, '_frame_chain'): - self._frame_chain = FrameChain.from_spice(frame_changes = [(1, self.sensor_frame_id), (1, self.target_frame_id)], ephemeris_time=self.ephemeris_time) + self._frame_chain = FrameChain.from_spice(sensor_frame=self.sensor_frame_id, + target_frame=self.target_frame_id, + center_ephemeris_time=self.center_ephemeris_time, + ephemeris_times=self.ephemeris_time) return self._frame_chain @property diff --git a/ale/drivers/co_drivers.py b/ale/drivers/co_drivers.py index fb4cf135332a098b07fff40e03745545fef0852c..725ac1b9e48d57fb5e1b629e5012c90e907a8297 100644 --- a/ale/drivers/co_drivers.py +++ b/ale/drivers/co_drivers.py @@ -212,17 +212,6 @@ class CassiniIssPds3LabelNaifSpiceDriver(Framer, Pds3Label, NaifSpice, RadialDis """ return 1 - @property - def frame_chain(self): - if not hasattr(self, '_frame_chain'): - if self.instrument_id == 'CASSINI_ISS_NAC': - self._frame_chain = FrameChain.from_spice(frame_changes = [(1, self._original_naif_sensor_frame_id), (1, self.target_frame_id)], ephemeris_time=self.ephemeris_time) - rot_180 = Rotation.from_euler('z', 180, degrees=True) - self._frame_chain.add_edge(self._original_naif_sensor_frame_id, self.sensor_frame_id, ConstantRotation(rot_180.as_quat(), self._original_naif_sensor_frame_id, self.sensor_frame_id)) - elif self.instrument_id == "CASSINI_ISS_WAC": - self._frame_chain = super(CassiniIssPds3LabelNaifSpiceDriver, self).frame_chain - return self._frame_chain - @property def focal_length(self): """ diff --git a/ale/formatters/isis_formatter.py b/ale/formatters/isis_formatter.py index 9ee2bd4c54fed1ab4eb6ff3d1a00b9f3ffde1d0b..13944fa81555243500d7698fb8a3530152792814 100644 --- a/ale/formatters/isis_formatter.py +++ b/ale/formatters/isis_formatter.py @@ -29,29 +29,26 @@ def to_isis(driver): target_frame = driver.target_frame_id instrument_pointing = {} - source_frame, destination_frame, time_dependent_sensor_frame = frame_chain.last_time_dependent_frame_between(sensor_frame, 1) - - if source_frame != 1: - # Reverse the frame order because ISIS orders frames as - # (destination, intermediate, ..., intermediate, source) - instrument_pointing['TimeDependentFrames'] = shortest_path(frame_chain, source_frame, 1) - time_dependent_rotation = frame_chain.compute_rotation(1, source_frame) - instrument_pointing['CkTableStartTime'] = time_dependent_rotation.times[0] - instrument_pointing['CkTableEndTime'] = time_dependent_rotation.times[-1] - instrument_pointing['CkTableOriginalSize'] = len(time_dependent_rotation.times) - instrument_pointing['EphemerisTimes'] = time_dependent_rotation.times - instrument_pointing['Quaternions'] = time_dependent_rotation.quats[:, [3, 0, 1, 2]] - - if source_frame != sensor_frame: - # Reverse the frame order because ISIS orders frames as - # (destination, intermediate, ..., intermediate, source) - instrument_pointing['ConstantFrames'] = shortest_path(frame_chain, sensor_frame, source_frame) - constant_rotation = frame_chain.compute_rotation(source_frame, sensor_frame) - instrument_pointing['ConstantRotation'] = constant_rotation.rotation_matrix() + source_frame, destination_frame, time_dependent_sensor_frame = frame_chain.last_time_dependent_frame_between(1, sensor_frame) + + # Reverse the frame order because ISIS orders frames as + # (destination, intermediate, ..., intermediate, source) + instrument_pointing['TimeDependentFrames'] = shortest_path(frame_chain, destination_frame, 1) + time_dependent_rotation = frame_chain.compute_rotation(1, destination_frame) + instrument_pointing['CkTableStartTime'] = time_dependent_rotation.times[0] + instrument_pointing['CkTableEndTime'] = time_dependent_rotation.times[-1] + instrument_pointing['CkTableOriginalSize'] = len(time_dependent_rotation.times) + instrument_pointing['EphemerisTimes'] = time_dependent_rotation.times + instrument_pointing['Quaternions'] = time_dependent_rotation.quats[:, [3, 0, 1, 2]] + + # Reverse the frame order because ISIS orders frames as + # (destination, intermediate, ..., intermediate, source) + instrument_pointing['ConstantFrames'] = shortest_path(frame_chain, sensor_frame, destination_frame) + constant_rotation = frame_chain.compute_rotation(destination_frame, sensor_frame) + instrument_pointing['ConstantRotation'] = constant_rotation.rotation_matrix().flatten() meta_data['InstrumentPointing'] = instrument_pointing body_rotation = {} - target_frame = driver.target_frame_id source_frame, destination_frame, time_dependent_target_frame = frame_chain.last_time_dependent_frame_between(target_frame, 1) if source_frame != 1: @@ -70,7 +67,8 @@ def to_isis(driver): # (destination, intermediate, ..., intermediate, source) body_rotation['ConstantFrames'] = shortest_path(frame_chain, target_frame, source_frame) constant_rotation = frame_chain.compute_rotation(source_frame, target_frame) - body_rotation['ConstantRotation'] = constant_rotation.rotation_matrix() + body_rotation['ConstantRotation'] = constant_rotation.rotation_matrix().flatten() + meta_data['BodyRotation'] = body_rotation j2000_rotation = frame_chain.compute_rotation(target_frame, 1) @@ -82,9 +80,9 @@ def to_isis(driver): instrument_position['SpkTableOriginalSize'] = len(times) instrument_position['EphemerisTimes'] = times # Rotate positions and velocities into J2000 then scale into kilometers - positions = j2000_rotation._rots.apply(positions) * 1/1000 + velocities = j2000_rotation.rotate_velocity_at(positions, velocities, times)/1000 + positions = j2000_rotation.apply_at(positions, times)/1000 instrument_position['Positions'] = positions - velocities = j2000_rotation._rots.apply(velocities) * 1/1000 instrument_position['Velocities'] = velocities meta_data['InstrumentPosition'] = instrument_position @@ -95,9 +93,9 @@ def to_isis(driver): sun_position['SpkTableOriginalSize'] = len(times) sun_position['EphemerisTimes'] = times # Rotate positions and velocities into J2000 then scale into kilometers - positions = j2000_rotation._rots.apply(positions) * 1/1000 + velocities = j2000_rotation.rotate_velocity_at(positions, velocities, times)/1000 + positions = j2000_rotation.apply_at(positions, times)/1000 sun_position['Positions'] = positions - velocities = j2000_rotation._rots.apply(velocities) * 1/1000 sun_position['Velocities'] = velocities meta_data['SunPosition'] = sun_position diff --git a/ale/transformation.py b/ale/transformation.py index 24cebdfdd14119e45f46433efbbc33b991be12d1..6b1adb8e1b2528653430394bbd0672eb8bcb5f20 100644 --- a/ale/transformation.py +++ b/ale/transformation.py @@ -89,40 +89,119 @@ class FrameChain(nx.DiGraph): of frame rotations in the frame chain """ @classmethod - def from_spice(cls, *args, frame_changes=[], ephemeris_time=[], **kwargs): + def from_spice(cls, *args, sensor_frame, target_frame, center_ephemeris_time, ephemeris_times=[], **kwargs): frame_chain = cls() - times = np.array(ephemeris_time) + times = np.array(ephemeris_times) + + sensor_time_dependent_frames, sensor_constant_frames = cls.frame_trace(sensor_frame, center_ephemeris_time) + target_time_dependent_frames, target_constant_frames = cls.frame_trace(target_frame, center_ephemeris_time) + + time_dependent_frames = list(zip(sensor_time_dependent_frames[:-1], sensor_time_dependent_frames[1:])) + constant_frames = list(zip(sensor_constant_frames[:-1], sensor_constant_frames[1:])) + target_time_dependent_frames = list(zip(target_time_dependent_frames[:-1], target_time_dependent_frames[1:])) + target_constant_frames = list(zip(target_constant_frames[:-1], target_constant_frames[1:])) + + time_dependent_frames.extend(target_time_dependent_frames) + constant_frames.extend(target_constant_frames) + quats = np.zeros((len(times), 4)) - for s, d in frame_changes: - for i, time in enumerate(times): + for s, d in time_dependent_frames: + for j, time in enumerate(times): rotation_matrix = spice.pxform(spice.frmnam(s), spice.frmnam(d), time) quat_from_rotation = spice.m2q(rotation_matrix) - quats[i,:3] = quat_from_rotation[1:] - quats[i,3] = quat_from_rotation[0] + quats[j,:3] = quat_from_rotation[1:] + quats[j,3] = quat_from_rotation[0] + rotation = TimeDependentRotation(quats, times, s, d) - frame_chain.add_edge(s, d, rotation=rotation) + frame_chain.add_edge(rotation=rotation) + + quats = np.zeros(4) + + for s, d in constant_frames: + rotation_matrix = spice.pxform(spice.frmnam(s), spice.frmnam(d), times[0]) + quat_from_rotation = spice.m2q(rotation_matrix) + quats[:3] = quat_from_rotation[1:] + quats[3] = quat_from_rotation[0] + + rotation = ConstantRotation(quats, s, d) + + frame_chain.add_edge(rotation=rotation) + return frame_chain + @staticmethod + def frame_trace(reference_frame, ephemeris_time): + frame_codes = [reference_frame] + _, frame_type, _ = spice.frinfo(frame_codes[-1]) + frame_types = [frame_type] + + while(frame_codes[-1] != 1): + try: + center, frame_type, frame_type_id = spice.frinfo(frame_codes[-1]) + except Exception as e: + print(e) + break + + if frame_type is 1 or frame_type is 2: + frame_code = 1 + + elif frame_type is 3: + try: + matrix, frame_code = spice.ckfrot(frame_type_id, ephemeris_time) + except: + raise Exception(f"The ck rotation from frame {frame_codes[-1]} can not \ + be found due to no pointing available at requested time \ + or a problem with the frame") + elif frame_type is 4: + try: + matrix, frame_code = spice.tkfram(frame_type_id) + except: + raise Exception(f"The tk rotation from frame {frame_codes[-1]} can not \ + be found") + elif frame_type is 5: + matrix, frame_code = spice.zzdynrot(frame_type_id, center, ephemeris_time) + + else: + raise Exception(f"The frame {frame_codes[-1]} has a type {frame_type_id} \ + not supported by your version of Naif Spicelib. \ + You need to update.") + + frame_codes.append(frame_code) + frame_types.append(frame_type) + constant_frames = [] + while frame_codes: + if frame_types[0] == 4: + constant_frames.append(frame_codes.pop(0)) + frame_types.pop(0) + else: + break + + time_dependent_frames = [] + if len(constant_frames) != 0: + time_dependent_frames.append(constant_frames[-1]) + + while frame_codes: + time_dependent_frames.append(frame_codes.pop(0)) + + return time_dependent_frames, constant_frames + @classmethod def from_isis_tables(cls, *args, inst_pointing={}, body_orientation={}, **kwargs): frame_chain = cls() for rotation in create_rotations(inst_pointing): - frame_chain.add_edge(rotation.source, - rotation.dest, - rotation=rotation) + frame_chain.add_edge(rotation=rotation) for rotation in create_rotations(body_orientation): - frame_chain.add_edge(rotation.source, - rotation.dest, - rotation=rotation) + frame_chain.add_edge(rotation=rotation) return frame_chain - def add_edge(self, s, d, rotation, **kwargs): - super(FrameChain, self).add_edge(s, d, rotation=rotation, **kwargs) - super(FrameChain, self).add_edge(d, s, rotation=rotation.inverse(), **kwargs) + def add_edge(self, rotation, **kwargs): + super(FrameChain, self).add_edge(rotation.source, rotation.dest, rotation=rotation, **kwargs) + rotation = rotation.inverse() + super(FrameChain, self).add_edge(rotation.source, rotation.dest, rotation=rotation, **kwargs) def compute_rotation(self, source, destination): """ diff --git a/environment.yml b/environment.yml index 9077abf3b949de142d90f36941dc6f48ee68cb3e..8ae2025f6f427556eb0feaabfbe4ff2919a6a991 100644 --- a/environment.yml +++ b/environment.yml @@ -2,6 +2,7 @@ name: ale channels: - conda-forge - default + - usgs-astrogeology dependencies: - cmake>=3.10 @@ -16,7 +17,7 @@ dependencies: - python=3.7.1 - python-dateutil - scipy - - spiceypy + - spiceypy=2.2.2 - quaternion - pyyaml - networkx diff --git a/recipe/meta.yaml b/recipe/meta.yaml index f22d5693eb055f05f31fd23957e2991e4389b6ef..bab606420e09216f15107bfbb782ac35210c75fb 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -30,7 +30,7 @@ requirements: run: - eigen - gsl - - netowrkx + - networkx - numpy - openblas - python diff --git a/tests/pytests/test_cassini_drivers.py b/tests/pytests/test_cassini_drivers.py index 978871ba98a63343cb959e2225ced5d628766044..5c4344618e3cf0b2ebb80c6d93c60c1a718d4955 100644 --- a/tests/pytests/test_cassini_drivers.py +++ b/tests/pytests/test_cassini_drivers.py @@ -4,7 +4,7 @@ import os import numpy as np from ale.drivers import co_drivers -import unittest +import unittest from unittest.mock import patch from conftest import get_image_label, get_image_kernels, convert_kernels, compare_dicts @@ -14,40 +14,40 @@ from conftest import get_image_kernels, convert_kernels, get_image_label @pytest.fixture() def usgscsm_compare_dict(): - return {'radii': - {'semimajor': 256.6, - 'semiminor': 248.3, - 'unit': 'km'}, - 'sensor_position': - {'positions': [np.array([ -2256954.95303959, -24306346.83742413, -639245.80662036])], - 'velocities': [np.array([-6890.54418209, -2939.21925245, 21.83699238])], - 'unit': 'm'}, - 'sun_position': - {'positions': [np.array([-2.30750862e+11, -1.39662303e+12, 3.09841240e+11])], - 'velocities': [np.array([-7.41107317e+07, 1.22577658e+07, 3.91731010e+03])], - 'unit': 'm'}, - 'sensor_orientation': - {'quaternions': [[-0.21183452, -0.66567547, -0.69966839, 0.14988809]]}, - 'detector_sample_summing': 1, - 'detector_line_summing': 1, - 'focal_length_model': {'focal_length': 2003.09}, - 'detector_center': {'line': 511.5, 'sample': 511.5}, - 'starting_detector_line': 0, - 'starting_detector_sample': 0, - 'focal2pixel_lines': [0.0, 0.0, 83.33333333333333], - 'focal2pixel_samples': [0.0, 83.33333333333333, 0.0], - 'optical_distortion': - {'radial': - {'coefficients': [-8e-06, 0, 0]}}, - 'image_lines': 1024, - 'image_samples': 1024, - 'name_platform': 'CASSINI ORBITER', - 'name_sensor': 'IMAGING SCIENCE SUBSYSTEM - NARROW ANGLE', - 'reference_height': - {'maxheight': 1000, - 'minheight': -1000, - 'unit': 'm'}, - 'name_model': 'USGS_ASTRO_FRAME_SENSOR_MODEL', + return {'radii': + {'semimajor': 256.6, + 'semiminor': 248.3, + 'unit': 'km'}, + 'sensor_position': + {'positions': np.array([[-2256845.0758612, -24304022.50656576, -639184.92761627]]), + 'velocities': np.array([[-6889.88091886, -2938.52964751, 21.84486935]]), + 'unit': 'm'}, + 'sun_position': + {'positions': [np.array([-2.30750862e+11, -1.39662303e+12, 3.09841240e+11])], + 'velocities': [np.array([-7.41107317e+07, 1.22577658e+07, 3.91731010e+03])], + 'unit': 'm'}, + 'sensor_orientation': + {'quaternions': np.array([[-0.21183452, -0.66567547, -0.69966839, 0.14988809]])}, + 'detector_sample_summing': 1, + 'detector_line_summing': 1, + 'focal_length_model': {'focal_length': 2003.09}, + 'detector_center': {'line': 511.5, 'sample': 511.5}, + 'starting_detector_line': 0, + 'starting_detector_sample': 0, + 'focal2pixel_lines': [0.0, 0.0, 83.33333333333333], + 'focal2pixel_samples': [0.0, 83.33333333333333, 0.0], + 'optical_distortion': + {'radial': + {'coefficients': [-8e-06, 0, 0]}}, + 'image_lines': 1024, + 'image_samples': 1024, + 'name_platform': 'CASSINI ORBITER', + 'name_sensor': 'IMAGING SCIENCE SUBSYSTEM - NARROW ANGLE', + 'reference_height': + {'maxheight': 1000, + 'minheight': -1000, + 'unit': 'm'}, + 'name_model': 'USGS_ASTRO_FRAME_SENSOR_MODEL', 'center_ephemeris_time': 376938208.24072826} @pytest.fixture() @@ -61,67 +61,68 @@ def test_kernels(scope="module", autouse=True): def test_cassini_load(test_kernels, usgscsm_compare_dict): label_file = get_image_label("N1702360370_1") usgscsm_isd = ale.load(label_file, props={'kernels': test_kernels}, formatter='usgscsm') + print(usgscsm_isd['sensor_position']) + print(usgscsm_isd['sensor_orientation']) assert compare_dicts(usgscsm_isd, usgscsm_compare_dict) == [] # ========= Test cassini pds3label and naifspice driver ========= class test_cassini_pds3_naif(unittest.TestCase): - + def setUp(self): label = get_image_label("N1702360370_1", "pds3") self.driver = CassiniIssPds3LabelNaifSpiceDriver(label) - + def test_short_mission_name(self): assert self.driver.short_mission_name == "co" - + def test_spacecraft_name(self): assert self.driver.spacecraft_name == "CASSINI" - + def test_focal2pixel_samples(self): with patch('ale.drivers.co_drivers.spice.gdpool', return_value=[12.0]) as gdpool, \ patch('ale.base.data_naif.spice.bods2c', return_value=-12345) as bods2c: assert self.driver.focal2pixel_samples == [0.0, 83.33333333333333, 0.0] gdpool.assert_called_with('INS-12345_PIXEL_SIZE', 0, 1) - + def test_focal2pixel_lines(self): with patch('ale.drivers.co_drivers.spice.gdpool', return_value=[12.0]) as gdpool, \ patch('ale.base.data_naif.spice.bods2c', return_value=-12345) as bods2c: assert self.driver.focal2pixel_lines == [0.0, 0.0, 83.33333333333333] gdpool.assert_called_with('INS-12345_PIXEL_SIZE', 0, 1) - + def test_odtk(self): assert self.driver.odtk == [-8e-06, 0, 0] - + def test_instrument_id(self): assert self.driver.instrument_id == "CASSINI_ISS_NAC" - + def test_focal_epsilon(self): with patch('ale.drivers.co_drivers.spice.gdpool', return_value=[0.03]) as gdpool, \ patch('ale.base.data_naif.spice.bods2c', return_value=-12345) as bods2c: assert self.driver.focal_epsilon == 0.03 gdpool.assert_called_with('INS-12345_FL_UNCERTAINTY', 0, 1) - + def test_focal_length(self): # This value isn't used for anything in the test, as it's only used for the # default focal length calculation if the filter can't be found. with patch('ale.drivers.co_drivers.spice.gdpool', return_value=[10.0]) as gdpool, \ patch('ale.base.data_naif.spice.bods2c', return_value=-12345) as bods2c: assert self.driver.focal_length == 2003.09 - + def test_detector_center_sample(self): with patch('ale.drivers.co_drivers.spice.gdpool', return_value=[511.5, 511.5]) as gdpool, \ patch('ale.base.data_naif.spice.bods2c', return_value=-12345) as bods2c: assert self.driver.detector_center_sample == 511.5 gdpool.assert_called_with('INS-12345_FOV_CENTER_PIXEL', 0, 2) - + def test_detector_center_line(self): with patch('ale.drivers.co_drivers.spice.gdpool', return_value=[511.5, 511.5]) as gdpool, \ patch('ale.base.data_naif.spice.bods2c', return_value=-12345) as bods2c: assert self.driver.detector_center_sample == 511.5 gdpool.assert_called_with('INS-12345_FOV_CENTER_PIXEL', 0, 2) - + def test_sensor_model_version(self): assert self.driver.sensor_model_version == 1 - + def test_sensor_frame_id(self): assert self.driver.sensor_frame_id == 14082360 - diff --git a/tests/pytests/test_dawn_drivers.py b/tests/pytests/test_dawn_drivers.py index 7a195cc87fdf2ce5fa577752d9bf61f95be11fd8..154bc7f1efbd13fcecebbb83574f1b85055da2ef 100644 --- a/tests/pytests/test_dawn_drivers.py +++ b/tests/pytests/test_dawn_drivers.py @@ -20,15 +20,15 @@ def usgscsm_compare_dict(): 'semiminor': 446.0, 'unit': 'km'}, 'sensor_position': { - 'positions': [[ 257925.27016132, 15117.796357 , -4862708.42068566]], - 'velocities': [[-104.55545524, -85.0501252 , -5.78752004]], + 'positions': [[257924.25395483, 15116.92833465, -4862688.37323513]], + 'velocities': [[-104.55513399, -85.04943875, -5.79043523]], 'unit': 'm'}, 'sun_position': { 'positions': [[3.60779830e+11, 2.46614935e+11, 3.05966427e+10]], 'velocities': [[ 4.74251599e+07, -6.93781387e+07, 1.94478534e+02]], 'unit': 'm'}, 'sensor_orientation': { - 'quaternions': [[ 0.00184844, 0.02139268, -0.27802966, -0.96033246]]}, + 'quaternions': [[0.00184844, 0.02139268, -0.27802966, -0.96033246]]}, 'detector_sample_summing': 1, 'detector_line_summing': 1, 'focal_length_model': { diff --git a/tests/pytests/test_isis_formatter.py b/tests/pytests/test_isis_formatter.py index cc41939ff333522c5f300a94bb1463f3e3bba5ff..d666f0c453b419913de32407acbe05ea7f061e55 100644 --- a/tests/pytests/test_isis_formatter.py +++ b/tests/pytests/test_isis_formatter.py @@ -82,7 +82,7 @@ class TestDriver(Driver): 100, 1 ) - frame_chain.add_edge(100, 1, rotation=body_rotation) + frame_chain.add_edge(rotation=body_rotation) spacecraft_rotation = TimeDependentRotation( np.array([[0, 0, 0, 1], [0, 0, 0, 1]]), @@ -90,10 +90,10 @@ class TestDriver(Driver): 1000, 1 ) - frame_chain.add_edge(1000, 1, rotation=spacecraft_rotation) + frame_chain.add_edge(rotation=spacecraft_rotation) sensor_rotation = ConstantRotation(np.array([0, 0, 0, 1]), 1010, 1000) - frame_chain.add_edge(1010, 1000, rotation=sensor_rotation) + frame_chain.add_edge(rotation=sensor_rotation) return frame_chain @property @@ -164,7 +164,7 @@ def test_instrument_pointing(driver): pointing = meta_data['InstrumentPointing'] assert pointing['TimeDependentFrames'] == [1000, 1] assert pointing['ConstantFrames'] == [1010, 1000] - np.testing.assert_equal(pointing['ConstantRotation'], np.array([[1, 0 ,0], [0, 1, 0], [0, 0, 1]])) + np.testing.assert_equal(pointing['ConstantRotation'], np.array([1., 0., 0., 0., 1., 0., 0., 0., 1.])) assert pointing['CkTableStartTime'] == 0 assert pointing['CkTableEndTime'] == 1 assert pointing['CkTableOriginalSize'] == 2 diff --git a/tests/pytests/test_kaguya_drivers.py b/tests/pytests/test_kaguya_drivers.py index d8d85cc8e22bfd7ac4590d67736adee5e176cfd5..3e874e5ec15a20e2af9750f6f03fb5f54deb1bc9 100644 --- a/tests/pytests/test_kaguya_drivers.py +++ b/tests/pytests/test_kaguya_drivers.py @@ -108,12 +108,12 @@ def test_load(test_kernels): [ 193824.32093681, 210061.95495794, -1767367.56104995], [ 193267.90484827, 209421.16305764, -1767500.49120063], [ 192711.44397634, 208780.32318594, -1767633.01318365]]), - 'velocities': np.array([[-1069.70946002, -1231.97108635, -258.37361381], - [-1069.79925825, -1232.06226912, -257.58879787], - [-1069.88881194, -1232.15316986, -256.80391882], - [-1069.97812106, -1232.24378854, -256.01897702], - [-1070.06718562, -1232.33412517, -255.23397236], - [-1070.15600557, -1232.42417969, -254.44890536]]), + 'velocities': np.array([[-1069.71225785, -1231.97438089, -258.37880523], + [-1069.80205939, -1232.06556741, -257.5939851 ], + [-1069.89161639, -1232.15647191, -256.80910187], + [-1069.98092881, -1232.24709434, -256.02415587], + [-1070.06999666, -1232.33743471, -255.2391471 ], + [-1070.15881991, -1232.42749298, -254.4540759 ]]), 'unit': 'm'}, 'sun_position': { 'positions': np.array([[9.50465237e+10, 1.15903815e+11, 3.78729685e+09]]), @@ -165,5 +165,6 @@ def test_load(test_kernels): new_callable=PropertyMock) as mock_reference_frame: mock_reference_frame.return_value = 'IAU_MOON' usgscsm_isd = ale.load(label_file, props={'kernels': test_kernels}, formatter='usgscsm') + print(usgscsm_isd) assert compare_dicts(usgscsm_isd, isd) == [] diff --git a/tests/pytests/test_lro_drivers.py b/tests/pytests/test_lro_drivers.py index 1a97c00aa057fd7f99e88634a842447f1fd95078..db179ecdbeee51d8969b6f6b6441c199d3dbdf2a 100644 --- a/tests/pytests/test_lro_drivers.py +++ b/tests/pytests/test_lro_drivers.py @@ -138,4 +138,5 @@ def test_exposure_duration(driver): def test_load(test_kernels, usgscsm_comparison_isd): label_file = get_image_label('M103595705LE') usgscsm_isd = ale.load(label_file, props={'kernels': test_kernels}, formatter='usgscsm') + print(usgscsm_isd) assert compare_dicts(usgscsm_isd, usgscsm_comparison_isd) == [] diff --git a/tests/pytests/test_mdis_drivers.py b/tests/pytests/test_mdis_drivers.py index ddb0099a93cf152d61fa0f6d2142ec6d1f4c61dd..df67513487a40c913978f009e402609adf39f324 100644 --- a/tests/pytests/test_mdis_drivers.py +++ b/tests/pytests/test_mdis_drivers.py @@ -28,15 +28,15 @@ def usgscsm_compare_dict(): 'semiminor': 2439.4, 'unit': 'km'}, 'sensor_position': { - 'positions': np.array([[-629657.4559945846, -1583350.7374122413, 1784408.773440049]]), - 'velocities': np.array([[1732.8734290653545, 2504.0213215928925, 2412.578186708735]]), + 'positions': np.array([[-629496.4862139452, -1582946.0091313303, 1783952.6403104223]]), + 'velocities': np.array([[1732.186663134826, 2502.768253236102, 2412.6523222267365]]), 'unit': 'm'}, 'sun_position': { 'positions': np.array([[-4.68946673e+10, -5.36158427e+08, 2.71167863e+07]]), 'velocities': np.array([[-4629.73346128, 256.72086237, 10.63960444]]), 'unit': 'm'}, 'sensor_orientation': { - 'quaternions': np.array([[ 0.93418372, 0.00144773, -0.00449382, -0.35676112]])}, + 'quaternions': np.array([[-0.9341837162001089, -0.0014477307579469636, 0.0044938223368195815, 0.3567611161870253]])}, 'detector_sample_summing': 2, 'detector_line_summing': 2, 'focal_length_model': { diff --git a/tests/pytests/test_mro_drivers.py b/tests/pytests/test_mro_drivers.py index 39bde0f4295deb3a338f788b41f1c97611f05f6f..93bedff99a1439baa5a31a33aaf70b7ea4392c64 100644 --- a/tests/pytests/test_mro_drivers.py +++ b/tests/pytests/test_mro_drivers.py @@ -16,28 +16,28 @@ from conftest import get_image_kernels, convert_kernels, get_image_label, compar def usgscsm_compare_dict(): return { 'radii': {'semimajor': 3396.19, 'semiminor': 3376.2, 'unit': 'km'}, - 'sensor_position': {'positions': [[-615012.0886971647, -97968.2345594813, -3573947.032011338], - [-615520.6109230528, -97906.4784443392, -3573862.281296898], - [-616029.119550515, -97844.70954517406, -3573777.458632478], - [-616537.6144124779, -97782.9278549998, -3573692.564075001], - [-617046.0958326485, -97721.13339810426, -3573607.5975138554], - [-617554.5636389386, -97659.32615734483, -3573522.559012526]], - 'velocities': [[-3386.5803072963226, 411.22659677345894, 564.1630407463263], - [-3386.4898408011636, 411.3117338896111, 564.6421991495939], - [-3386.3993050254394, 411.39686089826347, 565.1213459594977], - [-3386.3087000099817, 411.4819777303558, 565.600480994323], - [-3386.218025688375, 411.56708444186563, 566.0796046032438], - [-3386.127282099038, 411.65218101277696, 566.5587166016444]], + 'sensor_position': {'positions': [[-615024.6029557, -97969.68743736, -3574019.26371975], + [-615533.14603391, -97907.93120584, -3573934.57376263], + [-616041.67554001, -97846.16219439, -3573849.81184277], + [-616550.19123687, -97784.38044738, -3573764.97799019], + [-617058.69359867, -97722.58582759, -3573680.07219406], + [-617567.18227279, -97660.77852259, -3573595.09438568]], + 'velocities': [[-3386.71997092, 411.22641239, 563.75851535], + [-3386.62961915, 411.31156579, 564.23771317], + [-3386.53919809, 411.39670907, 564.71689945], + [-3386.44870778, 411.48184218, 565.19607397], + [-3386.35814814, 411.56696521, 565.6752371], + [-3386.26751923, 411.65207807, 566.15438866]], 'unit': 'm'}, 'sun_position': {'positions': [[-127052102329.16032, 139728839049.65073, -88111530293.94502]], 'velocities': [[9883868.06162645, 8989183.29614645, 881.9339912834714]], 'unit': 'm'}, - 'sensor_orientation': {'quaternions': [[0.0839325155418465, 0.01773153459973076, 0.9946048838768001, 0.05832709905329919], - [0.08400255389846112, 0.017728573660888338, 0.9945982552324419, 0.058340203145592955], - [0.0840727438677933, 0.01772597983213093, 0.9945916990701015, 0.058351653947255284], - [0.08414295024563542, 0.0177232314764712, 0.9945850926215932, 0.058363897444302155], - [0.08421298603777543, 0.017720474751607065, 0.9945784602692478, 0.05837674302007016], - [0.08428244063999622, 0.01771827039990229, 0.9945719105583338, 0.058388764519787986]]}, + 'sensor_orientation': {'quaternions': [[0.0839325155418464, 0.01773153459973093, 0.9946048838768001, 0.05832709905329942], + [0.08400255389846106, 0.017728573660888425, 0.9945982552324419, 0.05834020314559307], + [0.08407274386779334, 0.01772597983213095, 0.9945916990701015, 0.058351653947255444], + [0.08414295024563552, 0.01772323147647109, 0.9945850926215931, 0.05836389744430205], + [0.08421298603777544, 0.017720474751607096, 0.9945784602692478, 0.05837674302007029], + [0.08428244063999614, 0.017718270399902286, 0.9945719105583338, 0.05838876451978814]]}, 'detector_sample_summing': 1, 'detector_line_summing': 1, 'focal_length_model': {'focal_length': 352.9271664}, @@ -108,60 +108,52 @@ def isis_compare_dict(): 'INS-74021_CK_REFERENCE_ID': -74900.0, 'TKFRAME_-74021_RELATIVE': 'MRO_CTX_BASE', 'INS-74021_PIXEL_SIZE': [0.007, 0.007]}, - 'InstrumentPointing': {'TimeDependentFrames': [-74021, 1], + 'InstrumentPointing': {'TimeDependentFrames': [-74000, -74900, 1], + 'ConstantFrames': [-74021, -74020, -74699, -74690, -74000], + 'ConstantRotation': [0.9999995608798441, -1.51960241928035e-05, 0.0009370214510594064, 1.5276552075356694e-05, 0.9999999961910578, -8.593317911879532e-05, -0.000937020141647677, 8.594745584079714e-05, 0.9999995573030465], 'CkTableStartTime': 297088762.24158406, 'CkTableEndTime': 297088762.9923841, 'CkTableOriginalSize': 6, 'EphemerisTimes': [297088762.24158406, 297088762.3917441, 297088762.5419041, 297088762.69206405, 297088762.84222406, 297088762.9923841], - 'Quaternions': [[0.42070904282056604, 0.18648266589041404, -0.2396394764713814, 0.8548690179951135], - [0.4207203854384721, 0.18654399941209654, -0.23960773322048612, 0.8548589519568615], - [0.42073322917454875, 0.18660480854159617, -0.2395758135567815, 0.8548483051723957], - [0.4207453753832475, 0.18666593205145582, -0.23954391528431818, 0.8548379212197076], - [0.4207569541186571, 0.18672709386922662, -0.2395120269907863, 0.8548277995612382], - [0.4207691445740938, 0.18678728502603456, -0.23948004737140324, 0.8548176086382281]]}, + 'Quaternions': [[0.42061125, 0.18606223, -0.23980124, 0.85496338], + [0.42062261, 0.18612356, -0.23976951, 0.85495335], + [0.42063547, 0.18618438, -0.23973759, 0.85494273], + [0.42064763, 0.18624551, -0.2397057 , 0.85493237], + [0.42065923, 0.18630667, -0.23967382, 0.85492228], + [0.42067144, 0.18636687, -0.23964185, 0.85491211]]}, 'BodyRotation': {'TimeDependentFrames': [10014, 1], 'CkTableStartTime': 297088762.24158406, 'CkTableEndTime': 297088762.9923841, 'CkTableOriginalSize': 6, 'EphemerisTimes': [297088762.24158406, 297088762.3917441, 297088762.5419041, 297088762.69206405, 297088762.84222406, 297088762.9923841], - 'Quaternions': [[0.8371209459443085, -0.2996928944391797, -0.10720760458181891, -0.4448811306448063], - [0.8371185783490869, -0.2996934649760026, -0.1072060096645597, -0.4448855856569007], - [0.8371162107293473, -0.2996940355045328, -0.10720441474371896, -0.44489004065791765], - [0.8371138430875174, -0.2996946060241849, -0.1072028198209324, -0.44489449564328926], - [0.8371114754203602, -0.2996951765357392, -0.10720122489401934, -0.44489895061910595], - [0.8371091077303039, -0.29969574703861046, -0.10719962996461516, -0.4449034055807993]]}, + 'Quaternions': [[-0.8371209459443085, 0.2996928944391797, 0.10720760458181891, 0.4448811306448063], + [-0.8371185783490869, 0.2996934649760026, 0.1072060096645597, 0.4448855856569007], + [-0.8371162107293473, 0.2996940355045328, 0.10720441474371896, 0.44489004065791765], + [-0.8371138430875174, 0.2996946060241849, 0.1072028198209324, 0.44489449564328926], + [-0.8371114754203602, 0.2996951765357392, 0.10720122489401934, 0.44489895061910595], + [-0.8371091077303039, 0.29969574703861046, 0.10719962996461516, 0.4449034055807993]]}, 'InstrumentPosition': {'SpkTableStartTime': 297088762.24158406, 'SpkTableEndTime': 297088762.9923841, 'SpkTableOriginalSize': 6, 'EphemerisTimes': [297088762.24158406, 297088762.3917441, 297088762.5419041, 297088762.69206405, 297088762.84222406, 297088762.9923841], - 'Positions': [[-1885.2595574396726, 913.1466129090919, -2961.9072734074616], - [-1885.5542519556852, 912.7250080871751, -2961.850963369567], - [-1885.8489085311885, 912.3033848578856, -2961.794593708069], - [-1886.1435271048538, 911.8817433844737, -2961.7381644454717], - [-1886.4381077924143, 911.4600833470981, -2961.681675541305], - [-1886.732650539467, 911.0384049200497, -2961.6251270167986]], - 'Velocities': [[-1.996367491737628, -2.7947535723103862, 0.40022835507075183], - [-1.9961370953858215, -2.7948577920481075, 0.40064724633288534], - [-1.995906659162522, -2.7949619556787955, 0.40106612935145375], - [-1.9956761831571486, -2.7950660631619337, 0.40148500394594044], - [-1.995445667175973, -2.795170114597101, 0.40190387042237496], - [-1.995215111338196, -2.7952741099180174, 0.4023227286300164]]}, + 'Positions': [[-1885.29806756, 913.1652236, -2961.966828], + [-1885.59280128, 912.7436266, -2961.91056824], + [-1885.88749707, 912.32201117, -2961.85424884], + [-1886.18215477, 911.90037749, -2961.79786985], + [-1886.47677475, 911.47872522, -2961.7414312], + [-1886.77135665, 911.05705456, -2961.68493293]], + 'Velocities': [[-1.96292377, -2.80759072, 0.37446658], + [-1.96267123, -2.80771348, 0.37486368], + [-1.96241863, -2.80783619, 0.37526077], + [-1.96216602, -2.80795883, 0.37565786], + [-1.96191334, -2.80808143, 0.37605493], + [-1.96166065, -2.80820396, 0.376452]]}, 'SunPosition': {'SpkTableStartTime': 297088762.61698407, 'SpkTableEndTime': 297088762.61698407, 'SpkTableOriginalSize': 1, 'EphemerisTimes': [297088762.61698407], - 'Positions': [[-208246783.16649625, -7672643.572718078, 2105891.871806553], - [-208246727.14724845, -7674420.97378656, 2104954.712096058], - [-208246671.10884315, -7676198.370536743, 2104017.543867386], - [-208246615.05133778, -7677975.761145981, 2103080.368081583], - [-208246558.97465575, -7679753.148044037, 2102143.183457432], - [-208246502.87885448, -7681530.529408173, 2101205.9909560373]], - 'Velocities': [[-373.21084988516105, 11812.830032566408, 6230.090308526069], - [-373.3380528336456, 11812.79727998301, 6230.144788806889], - [-373.4652557832692, 11812.764526050134, 6230.199268400618], - [-373.59245860358607, 11812.731770801367, 6230.253747251377], - [-373.71966146848814, 11812.69901419193, 6230.308225433648], - [-373.846864247526, 11812.666256255417, 6230.362702891557]]}} + 'Positions': [[-208246643.00357282, -7677078.093689713, 2103553.070434019]], + 'Velocities': [[-0.21024935169058154, -23.900370491465555, -10.956673494157382]]}} @pytest.fixture(scope='module') def test_kernels(): @@ -172,7 +164,7 @@ def test_kernels(): os.remove(kern) @pytest.mark.parametrize("label_type", ['pds3', 'isis3']) -@pytest.mark.parametrize("formatter", ['usgscsm', 'isis']) +@pytest.mark.parametrize("formatter", ['isis', 'usgscsm']) def test_mro_load(test_kernels, label_type, formatter, usgscsm_compare_dict, isis_compare_dict): label_file = get_image_label('B10_013341_1010_XN_79S172W', label_type) diff --git a/tests/pytests/test_transformation.py b/tests/pytests/test_transformation.py index 8df994204f624a432d75b49c2b22ef7425165fc8..6f1c5f217b89331dfad03ee040b1eb022e899113 100644 --- a/tests/pytests/test_transformation.py +++ b/tests/pytests/test_transformation.py @@ -71,9 +71,9 @@ def frame_tree(request): ConstantRotation(np.array([1.0/np.sqrt(2), 0, 0, 1.0/np.sqrt(2)]), 3, 2), ConstantRotation(np.array([1.0/np.sqrt(2), 0, 0, 1.0/np.sqrt(2)]), 4, 1) ] - frame_chain.add_edge(2, 1, rotation = rotations[0]) - frame_chain.add_edge(3, 2, rotation = rotations[1]) - frame_chain.add_edge(4, 1, rotation = rotations[2]) + frame_chain.add_edge(rotation = rotations[0]) + frame_chain.add_edge(rotation = rotations[1]) + frame_chain.add_edge(rotation = rotations[2]) return frame_chain, rotations @@ -156,10 +156,10 @@ def test_last_time_dependent_frame_between(): np.array([1]), 4, 1), ConstantRotation(np.array([1.0/np.sqrt(2), 0, 0, 1.0/np.sqrt(2)]), 5, 4) ] - frame_chain.add_edge(2, 1, rotation = rotations[0]) - frame_chain.add_edge(3, 2, rotation = rotations[1]) - frame_chain.add_edge(4, 1, rotation = rotations[2]) - frame_chain.add_edge(5, 4, rotation = rotations[3]) + frame_chain.add_edge(rotation = rotations[0]) + frame_chain.add_edge(rotation = rotations[1]) + frame_chain.add_edge(rotation = rotations[2]) + frame_chain.add_edge(rotation = rotations[3]) # last frame from node 1 to node 3 s31, d31, _ = frame_chain.last_time_dependent_frame_between(1, 3) diff --git a/tests/pytests/test_usgscsm_formatter.py b/tests/pytests/test_usgscsm_formatter.py index d5995649110486aaf796a79c257a982645c4bf8b..9a9ae6d604e82339d0c4d43339a434afe36a7ede 100644 --- a/tests/pytests/test_usgscsm_formatter.py +++ b/tests/pytests/test_usgscsm_formatter.py @@ -27,7 +27,7 @@ class TestDriver(Driver, NaifSpice): 100, 1 ) - frame_chain.add_edge(100, 1, rotation=body_rotation) + frame_chain.add_edge(rotation=body_rotation) spacecraft_rotation = TimeDependentRotation( np.array([[0, 0, 0, 1], [0, 0, 0, 1]]), @@ -35,10 +35,10 @@ class TestDriver(Driver, NaifSpice): 1000, 1 ) - frame_chain.add_edge(1000, 1, rotation=spacecraft_rotation) + frame_chain.add_edge(rotation=spacecraft_rotation) sensor_rotation = ConstantRotation(np.array([0, 0, 0, 1]), 1010, 1000) - frame_chain.add_edge(1010, 1000, rotation=sensor_rotation) + frame_chain.add_edge(rotation=sensor_rotation) return frame_chain @property diff --git a/tests/pytests/test_voyager_drivers.py b/tests/pytests/test_voyager_drivers.py index 1306e81e1102c1b68f40b657856d0f3beeb5f784..7c054f6500cc9259132744557b8893799f128052 100644 --- a/tests/pytests/test_voyager_drivers.py +++ b/tests/pytests/test_voyager_drivers.py @@ -18,14 +18,35 @@ def isis_compare_dict(): 'CameraVersion': 1, 'NaifKeywords': {'BODY502_RADII': [1564.13, 1561.23, 1560.93], 'BODY_FRAME_CODE': 10024, - 'INS-32101_PIXEL_SIZE': 0.011789473651194, - 'INS-32101_ITRANSL': [0.0, 0.0, 84.821428808971], - 'INS-32101_ITRANSS': [0.0, 84.821428808971, 0.0], + 'BODY_CODE': 502, + 'FRAME_-32101_CLASS_ID': -32101.0, + 'TKFRAME_-32101_AXES': [1.0, 2.0, 3.0], + 'TKFRAME_-32101_SPEC': 'ANGLES', + 'INS-32101_CK_REFERENCE_ID': 2.0, + 'TKFRAME_-32101_ANGLES': [0.0, 0.0, 0.0], + 'FRAME_-32101_CENTER': -32.0, + 'INS-32101_PLATFORM_ID': -32001.0, + 'TKFRAME_-32101_RELATIVE': 'VG2_SCAN_PLATFORM', 'INS-32101_FOCAL_LENGTH': 1503.49, - 'INS-32101_BORESIGHT_SAMPLE': 500, - 'INS-32101_BORESIGHT_LINE': 500}, + 'INS-32101_TRANSX': [0.0, 0.011789473651194, 0.0], + 'FRAME_-32101_CLASS': 4.0, + 'INS-32101_TRANSY': [0.0, 0.0, 0.011789473651194], + 'INS-32101_BORESIGHT': [0.0, 0.0, 1.0], + 'INS-32101_PIXEL_PITCH': 0.011789473651194, + 'INS-32101_FOV_SHAPE': 'RECTANGLE', + 'INS-32101_ITRANSL': [0.0, 0.0, 84.8214288089711], + 'INS-32101_ITRANSS': [0.0, 84.8214288089711, 0.0], + 'INS-32101_FOV_BOUNDARY_CORNERS': [0.003700098, 0.003700098, 1.0, -0.003700098, 0.003700098, 1.0, -0.003700098, -0.003700098, 1.0, 0.003700098], + 'INS-32101_CK_FRAME_ID': -32100.0, + 'TKFRAME_-32101_UNITS': 'DEGREES', + 'INS-32101_FOV_FRAME': 'VG2_ISSNA', + 'INS-32101_CK_TIME_TOLERANCE': 2000.0, + 'INS-32101_SPK_TIME_BIAS': 0.0, + 'INS-32101_CK_TIME_BIAS': 0.0, + 'FRAME_-32101_NAME': 'VG2_ISSNA'}, 'InstrumentPointing': {'TimeDependentFrames': [-32100, 2, 1], 'ConstantFrames': [-32101, -32100], + 'ConstantRotation': (1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0), 'CkTableStartTime': -646346832.89712, 'CkTableEndTime': -646346832.89712, 'CkTableOriginalSize': 1, @@ -36,19 +57,19 @@ def isis_compare_dict(): 'CkTableEndTime': -646346832.89712, 'CkTableOriginalSize': 1, 'EphemerisTimes': [-646346832.89712], - 'Quaternions': [[0.029536586623089,-0.01009726603285,-0.22183796921534,0.97458378330636]]}, + 'Quaternions': [[-0.029536576144092695, 0.010097306192904288, 0.22183794661925513, -0.9745837883512549]]}, 'InstrumentPosition': {'SpkTableStartTime': -646346832.89712, 'SpkTableEndTime': -646346832.89712, 'SpkTableOriginalSize': 1, 'EphemerisTimes': [-646346832.89712], 'Positions': [[133425.48293894,184605.07752753,-3162.2190909154]], 'Velocities': [[-10.722770423744,2.0367821121285,-0.64314600586812]]}, - 'SunPosition': {'SpkTableStartTime': -646346832.8971245, - 'SpkTableEndTime': -646346832.8971245, - 'SpkTableOriginalSize': 1, - 'EphemerisTimes': [-646346832.8971245], - 'Positions': [[588004836.49532,-489060608.67696,-224000895.4511]], - 'Velocities': [[9.1115543713942,-4.4506204607189,-2.785930492615]]}} + 'SunPosition': {'SpkTableStartTime': -646346832.8971245, + 'SpkTableEndTime': -646346832.8971245, + 'SpkTableOriginalSize': 1, + 'EphemerisTimes': [-646346832.8971245], + 'Positions': [[588004836.49532,-489060608.67696,-224000895.4511]], + 'Velocities': [[9.1115543713942,-4.4506204607189,-2.785930492615]]}} @pytest.fixture(scope='module') def test_kernels(): @@ -66,5 +87,6 @@ def test_voyager_load(test_kernels, label_type, formatter, isis_compare_dict): usgscsm_isd_str = ale.loads(label_file, props={'kernels': test_kernels}, formatter=formatter) usgscsm_isd_obj = json.loads(usgscsm_isd_str) + print(usgscsm_isd_obj) assert compare_dicts(usgscsm_isd_obj, isis_compare_dict) == []