Skip to content
Snippets Groups Projects
Commit cb653b6a authored by Kelvin Rodriguez's avatar Kelvin Rodriguez Committed by Jesse Mapel
Browse files

fikid vars now included in naif_keywords. (#326)

* Fixes mex driver and adds fikid naif keywords into the naif keywords

* Update to the cmake list file to better interact with conda environments

* Changed calling value in test

* Updated instrument id test

* Test to see how the kernel list is coming out

* Reverted CMakeList file

* fikid now in kernel group

* unverbose

* reverted xfail

* IAKs now sorted to back of kernel list in image_2_data
parent fa805423
Branches master
No related tags found
No related merge requests found
...@@ -534,4 +534,9 @@ class NaifSpice(): ...@@ -534,4 +534,9 @@ class NaifSpice():
self._naif_keywords = {**self._naif_keywords, **util.query_kernel_pool(f"*{self.ikid}*"), **util.query_kernel_pool(f"*{self.target_id}*")} self._naif_keywords = {**self._naif_keywords, **util.query_kernel_pool(f"*{self.ikid}*"), **util.query_kernel_pool(f"*{self.target_id}*")}
try:
self._naif_keywords = {**self._naif_keywords, **util.query_kernel_pool(f"*{self.fikid}*")}
except AttributeError as error:
pass
return self._naif_keywords return self._naif_keywords
...@@ -506,8 +506,7 @@ class MexHrscIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, RadialD ...@@ -506,8 +506,7 @@ class MexHrscIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, RadialD
""" """
if(super().instrument_id != "HRSC"): if(super().instrument_id != "HRSC"):
raise Exception ("Instrument ID is wrong.") raise Exception ("Instrument ID is wrong.")
return self.label['IsisCube']['Archive']['DetectorId']
return super().instrument_id
@property @property
def sensor_model_version(self): def sensor_model_version(self):
...@@ -587,7 +586,7 @@ class MexHrscIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, RadialD ...@@ -587,7 +586,7 @@ class MexHrscIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, RadialD
Expects filter_number to be defined. This should be an integer containing Expects filter_number to be defined. This should be an integer containing
the filter number from the pds3 label. the filter number from the pds3 label.
Expects ikid to be defined. This should be the integer Naid ID code for Expects ikid to be defined. This should be the integer Naif ID code for
the instrument. the instrument.
Returns Returns
......
...@@ -12,6 +12,8 @@ target_link_libraries(runAleTests ...@@ -12,6 +12,8 @@ target_link_libraries(runAleTests
GSL::gslcblas GSL::gslcblas
Eigen3::Eigen Eigen3::Eigen
gtest gtest
Threads::Threads) Threads::Threads
nlohmann_json::nlohmann_json
)
gtest_discover_tests(runAleTests WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests/ctests) gtest_discover_tests(runAleTests WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests/ctests)
...@@ -77,6 +77,8 @@ image_2_data = {} ...@@ -77,6 +77,8 @@ image_2_data = {}
for d in dirs: for d in dirs:
tmp = os.path.join(data_root, d) tmp = os.path.join(data_root, d)
image_2_data[d] = [os.path.join(tmp, f) for f in os.listdir(tmp) if not f.startswith('.') and os.path.splitext(f)[1] != '.lbl'] image_2_data[d] = [os.path.join(tmp, f) for f in os.listdir(tmp) if not f.startswith('.') and os.path.splitext(f)[1] != '.lbl']
# force IAKs to the back of the list
image_2_data[d] = sorted(image_2_data[d], key=lambda x: "Addendum" in x)
def get_image_label(image, label_type='pds3'): def get_image_label(image, label_type='pds3'):
if not isinstance(image, str): if not isinstance(image, str):
......
...@@ -283,7 +283,69 @@ def usgscsm_compare_dict(): ...@@ -283,7 +283,69 @@ def usgscsm_compare_dict():
176.63, 176.63,
350.89198226, 350.89198226,
0.0 0.0
] ],
"INS-41218_ITRANSL": [
-7113.11359717265,
0.062856784318668,
142.857129028729
],
"INS-41218_ITRANSS": [
-0.778052433438109,
-142.857129028729,
0.062856784318668
],
"INS-41218_FOV_SHAPE": "RECTANGLE",
"INS-41218_PIXEL_SIZE": [
7.0,
7.0
],
"INS-41218_CK_REFERENCE_ID": 1.0,
"INS-41218_FOV_FRAME": "MEX_HRSC_HEAD",
"INS-41218_CCD_CENTER": [
2592.5,
0.5
],
"INS-41218_CK_FRAME_ID": -41001.0,
"INS-41218_F/RATIO": 5.6,
"INS-41218_PIXEL_SAMPLES": 5184.0,
"INS-41218_BORESIGHT_SAMPLE": 2592.5,
"INS-41218_FILTER_BANDWIDTH": 90.0,
"INS-41218_BORESIGHT_LINE": 0.0,
"INS-41218_PIXEL_LINES": 1.0,
"INS-41218_FOCAL_LENGTH": 174.82,
"INS-41218_FOV_ANGULAR_SIZE": [
0.2,
4e-05
],
"INS-41218_FILTER_BANDCENTER": 970.0,
"INS-41218_TRANSX": [
0.016461898406507,
-0.006999999322408,
3.079982431615e-06
],
"INS-41218_TRANSY": [
49.7917927568053,
3.079982431615e-06,
0.006999999322408
],
"INS-41218_FOV_BOUNDARY_CORNERS": [
18.1982,
49.9121,
175.0,
18.1982,
49.9051,
175.0,
-18.1693,
49.8901,
175.0,
-18.1693
],
"INS-41218_BORESIGHT": [
0.0151,
49.9039,
175.0
],
"INS-41218_IFOV": 4e-05
}, },
"InstrumentPointing": { "InstrumentPointing": {
"TimeDependentFrames": [ "TimeDependentFrames": [
...@@ -368,10 +430,10 @@ def usgscsm_compare_dict(): ...@@ -368,10 +430,10 @@ def usgscsm_compare_dict():
], ],
"Quaternions": [ "Quaternions": [
[ [
-0.6525755651363002, -0.6525755651363003,
-0.023151423913928198, -0.0231514239139282,
0.31744150842891783, 0.3174415084289179,
-0.6876336467074379 -0.6876336467074378
], ],
[ [
-0.6531746247480361, -0.6531746247480361,
...@@ -380,17 +442,17 @@ def usgscsm_compare_dict(): ...@@ -380,17 +442,17 @@ def usgscsm_compare_dict():
-0.6870646329712322 -0.6870646329712322
], ],
[ [
-0.6534739684048749, -0.6534739684048748,
-0.022736404778153124, -0.022736404778153148,
0.3174715036099805, 0.31747150360998055,
-0.6867799304803299 -0.68677993048033
] ]
], ],
"AngularVelocity": [ "AngularVelocity": [
[ [
3.162398161513711e-05, 3.1623981615137114e-05,
-2.880303177599155e-05, -2.8803031775991542e-05,
5.65207273177886e-05 5.6520727317788564e-05
], ],
[ [
3.162398161506756e-05, 3.162398161506756e-05,
...@@ -398,8 +460,8 @@ def usgscsm_compare_dict(): ...@@ -398,8 +460,8 @@ def usgscsm_compare_dict():
5.652072731743428e-05 5.652072731743428e-05
], ],
[ [
3.162398161503279e-05, 3.1623981615032794e-05,
-2.8803031777148904e-05, -2.8803031777148914e-05,
5.6520727317257115e-05 5.6520727317257115e-05
] ]
] ]
...@@ -415,36 +477,36 @@ def usgscsm_compare_dict(): ...@@ -415,36 +477,36 @@ def usgscsm_compare_dict():
], ],
"Positions": [ "Positions": [
[ [
3508.7678822054836, 3508.767882205483,
-1180.090578774873, -1180.0905787748716,
-404.6580659358623 -404.6580659358628
], ],
[ [
3509.6584138014186, 3509.6584138014186,
-1143.4324359500306, -1143.4324359500313,
-502.6029463204845 -502.6029463204848
], ],
[ [
3509.4431532823473, 3509.4431532823473,
-1124.8866548757126, -1124.886654875713,
-551.4851113671581 -551.4851113671591
] ]
], ],
"Velocities": [ "Velocities": [
[ [
0.0720400832434136, 0.07204008324341263,
1.478737567336345, 1.4787375673363454,
-3.9872650791431576 -3.987265079143158
], ],
[ [
0.0003930097221540194, 0.0003930097221548436,
1.502497160864039, 1.5024971608640412,
-3.978142968407851 -3.9781429684078495
], ],
[ [
-0.03540185319234352, -0.03540185319234399,
1.5140837760694028, 1.5140837760694033,
-3.972834676104136 -3.9728346761041364
] ]
] ]
}, },
...@@ -457,16 +519,16 @@ def usgscsm_compare_dict(): ...@@ -457,16 +519,16 @@ def usgscsm_compare_dict():
], ],
"Positions": [ "Positions": [
[ [
97397666.49661356, 97397666.49661352,
-201380879.84291452, -201380879.84291452,
-94392949.8261708 -94392949.82617083
] ]
], ],
"Velocities": [ "Velocities": [
[ [
21.260857263715938, 21.26085726371221,
7.173395648419857, 7.17339564842172,
2.73958955646446 2.739589556465391
] ]
] ]
} }
...@@ -478,6 +540,7 @@ def test_kernels(): ...@@ -478,6 +540,7 @@ def test_kernels():
kernels = get_image_kernels('h5270_0000_ir2') kernels = get_image_kernels('h5270_0000_ir2')
updated_kernels, binary_kernels = convert_kernels(kernels) updated_kernels, binary_kernels = convert_kernels(kernels)
yield updated_kernels yield updated_kernels
print(updated_kernels)
for kern in binary_kernels: for kern in binary_kernels:
os.remove(kern) os.remove(kern)
...@@ -632,7 +695,7 @@ class test_mex_isis3_naif(unittest.TestCase): ...@@ -632,7 +695,7 @@ class test_mex_isis3_naif(unittest.TestCase):
self.driver = MexHrscIsisLabelNaifSpiceDriver(label) self.driver = MexHrscIsisLabelNaifSpiceDriver(label)
def test_instrument_id(self): def test_instrument_id(self):
assert self.driver.instrument_id == 'HRSC' assert self.driver.instrument_id == 'MEX_HRSC_IR'
def test_ikid(self): def test_ikid(self):
with patch('ale.drivers.mex_drivers.spice.bods2c', return_value=12345) as bods2c: with patch('ale.drivers.mex_drivers.spice.bods2c', return_value=12345) as bods2c:
...@@ -642,7 +705,7 @@ class test_mex_isis3_naif(unittest.TestCase): ...@@ -642,7 +705,7 @@ class test_mex_isis3_naif(unittest.TestCase):
def test_fikid(self): def test_fikid(self):
with patch('ale.drivers.mex_drivers.spice.bods2c', return_value=12345) as bods2c: with patch('ale.drivers.mex_drivers.spice.bods2c', return_value=12345) as bods2c:
assert self.driver.fikid == 12345 assert self.driver.fikid == 12345
bods2c.assert_called_with('HRSC') bods2c.assert_called_with('MEX_HRSC_IR')
def test_ephemeris_start_time(self): def test_ephemeris_start_time(self):
with patch('ale.drivers.mex_drivers.read_table_data', return_value=12345) as read_table_data, \ with patch('ale.drivers.mex_drivers.read_table_data', return_value=12345) as read_table_data, \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment