Skip to content

Commit

Permalink
Fixed orex tests
Browse files Browse the repository at this point in the history
  • Loading branch information
acpaquette committed Dec 22, 2023
1 parent 74563ce commit 3666959
Show file tree
Hide file tree
Showing 2 changed files with 327 additions and 2 deletions.
325 changes: 324 additions & 1 deletion tests/pytests/data/isds/osirisrex_isd.json
Original file line number Diff line number Diff line change
@@ -1 +1,324 @@
{"isis_camera_version": 1, "image_lines": 1024, "image_samples": 1024, "name_platform": "OSIRIS-REX", "name_sensor": "MapCam", "reference_height": {"maxheight": 1000, "minheight": -1000, "unit": "m"}, "name_model": "USGS_ASTRO_FRAME_SENSOR_MODEL", "center_ephemeris_time": 604882849.4327942, "radii": {"semimajor": 0.283065, "semiminor": 0.24972, "unit": "km"}, "body_rotation": {"time_dependent_frames": [10106, 1], "ck_table_start_time": 604882849.4327942, "ck_table_end_time": 604882849.4327942, "ck_table_original_size": 1, "ephemeris_times": [604882849.4327942], "quaternions": [[-0.24468662154888665, -0.8995476917306681, 0.3540944064834505, 0.07456244922312974]], "angular_velocities": [[1.5901075118354376e-05, 0.00020029780775859552, -0.0003531029098106748]], "reference_frame": 1}, "instrument_pointing": {"time_dependent_frames": [-64000, 1], "ck_table_start_time": 604882849.4327942, "ck_table_end_time": 604882849.4327942, "ck_table_original_size": 1, "ephemeris_times": [604882849.4327942], "quaternions": [[-0.49481036455664573, 0.4609332756246706, -0.3664592415687433, -0.6390702956780986]], "angular_velocities": [[5.395053026508693e-06, -5.108637996042997e-06, 2.277063782852625e-06]], "reference_frame": 1, "constant_frames": [-64000], "constant_rotation": [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]}, "naif_keywords": {"BODY2101955_RADII": [0.283065, 0.271215, 0.24972], "BODY_FRAME_CODE": 10106, "BODY_CODE": 2101955, "INS-64361_TOLERANCE": 1e-10, "INS-64361_ITRANSL": [0.0, 117.64705882353, 0.0], "INS-64361_ITRANSS": [0.0, 0.0, 117.64705882353], "FRAME_-64361_CLASS": 3.0, "INS-64361_FOCAL_LENGTH": 125.2, "FRAME_-64361_CENTER": -64.0, "INS-64361_WAVELENGTH_RANGE": [440.0, 890.0], "CK_-64361_SPK": -64.0, "INS-64361_OD_CENTER_PAN": [486.2, 450.3], "INS-64361_PIXEL_LINES": 1024.0, "INS-64361_OD_CENTER_B": [497.3, 456.8], "INS-64361_TRANSX": [0.0, 0.0, 0.0085], "INS-64361_TRANSY": [0.0, 0.0085, 0.0], "INS-64361_OD_CENTER_V": [494.3, 473.8], "INS-64361_OD_CENTER_W": [510.3, 461.2], "INS-64361_OD_CENTER_X": [504.5, 450.5], "INS-64361_F/NUMBER": 3.295, "INS-64361_LT_SURFACE_CORRECT": "FALSE", "INS-64361_FOV_ANGLE_UNITS": "DEGREES", "INS-64361_SWAP_OBSERVER_TARGET": "TRUE", "INS-64361_FOV_REF_ANGLE": 1.9849999999999999, "INS-64361_DEBUG_MODEL": "FALSE", "INS-64361_BORESIGHT": [0.0, 0.0, 1.0], "INS-64361_LIGHTTIME_CORRECTION": "LT+S", "INS-64361_FOV_CLASS_SPEC": "ANGLES", "INS-64361_FOV_REF_VECTOR": [1.0, 0.0, 0.0], "INS-64361_IFOV": 67.675, "INS-64361_FOV_CENTER_PIXEL": [511.5, 511.5], "INS-64361_DISTORTION_MODEL": "OPENCV", "INS-64361_FOV_SHAPE": "RECTANGLE", "INS-64361_FOV_CROSS_ANGLE": 1.9849999999999999, "INS-64361_PIXEL_SIZE": 8.5, "INS-64361_FL_UNCERTAINTY": 0.5, "INS-64361_FOV_FRAME": "ORX_OCAMS_MAPCAM", "INS-64361_OD_K_PAN": [2.21e-05, 0.000171, 5.96e-05, 0.0, 0.0], "FRAME_-64361_NAME": "ORX_OCAMS_MAPCAM", "INS-64361_OD_K_B": [5.06e-05, 0.00016299999999999998, 6e-05, 0.0, 0.0], "INS-64361_PIXEL_SAMPLES": 1024.0, "INS-64361_OD_K_V": [7.450000000000001e-05, 0.00022, 6.22e-05, 0.0, 0.0], "INS-64361_OD_K_W": [2.21e-05, 0.000132, 6.08e-05, 0.0, 0.0], "INS-64361_OD_K_X": [2.44e-05, -3.6099999999999997e-05, 8.869999999999999e-05, 0.0, 0.0], "INS-64361_CCD_CENTER": [511.5, 511.5], "FRAME_-64361_CLASS_ID": -64361.0, "CK_-64361_SCLK": -64.0, "INS-64361_SPOC_FITS_NAXIS1": [0.0, 1.0, 0.0], "INS-64361_SPOC_FITS_NAXIS2": [1.0, 0.0, 0.0], "BODY2101955_PM": [140.68835, 2011.145755336826, 1.815e-06], "BODY2101955_POLE_DEC": [-60.3586, 0.0, 0.0], "BODY2101955_POLE_RA": [85.46097, 0.0, 0.0], "BODY2101955_LONG_AXIS": 0.0, "OBJECT_2101955_FRAME": "IAU_BENNU"}, "detector_sample_summing": 1, "detector_line_summing": 1, "focal_length_model": {"focal_length": 125.2}, "detector_center": {"line": 511.5, "sample": 511.5}, "focal2pixel_lines": [0.0, 117.64705882353, 0.0], "focal2pixel_samples": [0.0, 0.0, 117.64705882353], "optical_distortion": {"radial": {"coefficients": [2.21e-05, 0.000171, 5.96e-05]}}, "starting_detector_line": 0, "starting_detector_sample": 0, "instrument_position": {"spk_table_start_time": 604882849.4327942, "spk_table_end_time": 604882849.4327942, "spk_table_original_size": 1, "ephemeris_times": [604882849.4327942], "positions": [[6.263896259086776, -0.17789034115912727, -2.0516825743917164]], "velocities": [[-1.6329228503551952e-05, 5.936927842752571e-06, -2.2327914272865625e-05]], "reference_frame": 1}, "sun_position": {"spk_table_start_time": 604882849.4327942, "spk_table_end_time": 604882849.4327942, "spk_table_original_size": 1, "ephemeris_times": [604882849.4327942], "positions": [[94633635.43566033, -98012563.34059505, -55786970.073704116]], "velocities": [[27.39074526770413, 14.215569043304772, 7.916498653173447]], "reference_frame": 1}}
{
"isis_camera_version": 1,
"image_lines": 1024,
"image_samples": 1024,
"name_platform": "OSIRIS-REX",
"name_sensor": "MapCam",
"reference_height": {
"maxheight": 1000,
"minheight": -1000,
"unit": "m"
},
"name_model": "USGS_ASTRO_FRAME_SENSOR_MODEL",
"center_ephemeris_time": 604882849.4327942,
"radii": {
"semimajor": 0.283065,
"semiminor": 0.24972,
"unit": "km"
},
"body_rotation": {
"time_dependent_frames": [
10106,
1
],
"ck_table_start_time": 604882849.4327942,
"ck_table_end_time": 604882849.4327942,
"ck_table_original_size": 1,
"ephemeris_times": [
604882849.4327942
],
"quaternions": [
[
-0.24468662154888665,
-0.8995476917306681,
0.3540944064834505,
0.07456244922312974
]
],
"angular_velocities": [
[
1.5901075118354376e-05,
0.00020029780775859552,
-0.0003531029098106748
]
],
"reference_frame": 1
},
"instrument_pointing": {
"time_dependent_frames": [
-64361,
-64000,
1
],
"ck_table_start_time": 604882849.4327942,
"ck_table_end_time": 604882849.4327942,
"ck_table_original_size": 1,
"ephemeris_times": [
604882849.4327942
],
"quaternions": [
[
0.4945916645160911,
-0.4620797005791134,
0.36450726891518725,
0.6395278622639601
]
],
"angular_velocities": [
[
5.395053026508693e-06,
-5.108637996042997e-06,
2.277063782852625e-06
]
],
"reference_frame": 1,
"constant_frames": [
-64361
],
"constant_rotation": [
1.0,
0.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0,
1.0
]
},
"naif_keywords": {
"BODY2101955_RADII": [
0.283065,
0.271215,
0.24972
],
"BODY_FRAME_CODE": 10106,
"BODY_CODE": 2101955,
"INS-64361_TOLERANCE": 1e-10,
"INS-64361_ITRANSL": [
0.0,
117.64705882353,
0.0
],
"INS-64361_ITRANSS": [
0.0,
0.0,
117.64705882353
],
"FRAME_-64361_CLASS": 3.0,
"INS-64361_FOCAL_LENGTH": 125.2,
"FRAME_-64361_CENTER": -64.0,
"INS-64361_WAVELENGTH_RANGE": [
440.0,
890.0
],
"CK_-64361_SPK": -64.0,
"INS-64361_OD_CENTER_PAN": [
486.2,
450.3
],
"INS-64361_PIXEL_LINES": 1024.0,
"INS-64361_OD_CENTER_B": [
497.3,
456.8
],
"INS-64361_TRANSX": [
0.0,
0.0,
0.0085
],
"INS-64361_TRANSY": [
0.0,
0.0085,
0.0
],
"INS-64361_OD_CENTER_V": [
494.3,
473.8
],
"INS-64361_OD_CENTER_W": [
510.3,
461.2
],
"INS-64361_OD_CENTER_X": [
504.5,
450.5
],
"INS-64361_F/NUMBER": 3.295,
"INS-64361_LT_SURFACE_CORRECT": "FALSE",
"INS-64361_FOV_ANGLE_UNITS": "DEGREES",
"INS-64361_SWAP_OBSERVER_TARGET": "TRUE",
"INS-64361_FOV_REF_ANGLE": 1.9849999999999999,
"INS-64361_DEBUG_MODEL": "FALSE",
"INS-64361_BORESIGHT": [
0.0,
0.0,
1.0
],
"INS-64361_LIGHTTIME_CORRECTION": "LT+S",
"INS-64361_FOV_CLASS_SPEC": "ANGLES",
"INS-64361_FOV_REF_VECTOR": [
1.0,
0.0,
0.0
],
"INS-64361_IFOV": 67.675,
"INS-64361_FOV_CENTER_PIXEL": [
511.5,
511.5
],
"INS-64361_DISTORTION_MODEL": "OPENCV",
"INS-64361_FOV_SHAPE": "RECTANGLE",
"INS-64361_FOV_CROSS_ANGLE": 1.9849999999999999,
"INS-64361_PIXEL_SIZE": 8.5,
"INS-64361_FL_UNCERTAINTY": 0.5,
"INS-64361_FOV_FRAME": "ORX_OCAMS_MAPCAM",
"INS-64361_OD_K_PAN": [
2.21e-05,
0.000171,
5.96e-05,
0.0,
0.0
],
"FRAME_-64361_NAME": "ORX_OCAMS_MAPCAM",
"INS-64361_OD_K_B": [
5.06e-05,
0.00016299999999999998,
6e-05,
0.0,
0.0
],
"INS-64361_PIXEL_SAMPLES": 1024.0,
"INS-64361_OD_K_V": [
7.450000000000001e-05,
0.00022,
6.22e-05,
0.0,
0.0
],
"INS-64361_OD_K_W": [
2.21e-05,
0.000132,
6.08e-05,
0.0,
0.0
],
"INS-64361_OD_K_X": [
2.44e-05,
-3.6099999999999997e-05,
8.869999999999999e-05,
0.0,
0.0
],
"INS-64361_CCD_CENTER": [
511.5,
511.5
],
"FRAME_-64361_CLASS_ID": -64361.0,
"CK_-64361_SCLK": -64.0,
"INS-64361_SPOC_FITS_NAXIS1": [
0.0,
1.0,
0.0
],
"INS-64361_SPOC_FITS_NAXIS2": [
1.0,
0.0,
0.0
],
"BODY2101955_PM": [
140.68835,
2011.145755336826,
1.815e-06
],
"BODY2101955_POLE_DEC": [
-60.3586,
0.0,
0.0
],
"BODY2101955_POLE_RA": [
85.46097,
0.0,
0.0
],
"BODY2101955_LONG_AXIS": 0.0,
"OBJECT_2101955_FRAME": "IAU_BENNU"
},
"detector_sample_summing": 1,
"detector_line_summing": 1,
"focal_length_model": {
"focal_length": 125.2
},
"detector_center": {
"line": 511.5,
"sample": 511.5
},
"focal2pixel_lines": [
0.0,
117.64705882353,
0.0
],
"focal2pixel_samples": [
0.0,
0.0,
117.64705882353
],
"optical_distortion": {
"radial": {
"coefficients": [
2.21e-05,
0.000171,
5.96e-05
]
}
},
"starting_detector_line": 0,
"starting_detector_sample": 0,
"instrument_position": {
"spk_table_start_time": 604882849.4327942,
"spk_table_end_time": 604882849.4327942,
"spk_table_original_size": 1,
"ephemeris_times": [
604882849.4327942
],
"positions": [
[
6.263896259086776,
-0.17789034115912727,
-2.0516825743917164
]
],
"velocities": [
[
-1.6329228503551952e-05,
5.936927842752571e-06,
-2.2327914272865625e-05
]
],
"reference_frame": 1
},
"sun_position": {
"spk_table_start_time": 604882849.4327942,
"spk_table_end_time": 604882849.4327942,
"spk_table_original_size": 1,
"ephemeris_times": [
604882849.4327942
],
"positions": [
[
94633635.43566033,
-98012563.34059505,
-55786970.073704116
]
],
"velocities": [
[
27.39074526770413,
14.215569043304772,
7.916498653173447
]
],
"reference_frame": 1
}
}
4 changes: 3 additions & 1 deletion tests/pytests/test_osirisrex_drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def test_exposure_duration(self):
np.testing.assert_almost_equal(self.driver.exposure_duration, 0.005285275)

def test_sensor_frame_id(self):
assert self.driver.sensor_frame_id == -64000
with patch('ale.drivers.osirisrex_drivers.spice.bods2c', return_value=-64361) as bods2c:
assert self.driver.sensor_frame_id == -64361
bods2c.assert_called_with('ORX_OCAMS_MAPCAM')

def test_detector_center_sample(self):
with patch('ale.drivers.osirisrex_drivers.spice.gdpool', return_value=np.array([12345, 100])) as gdpool, \
Expand Down

0 comments on commit 3666959

Please sign in to comment.