Пример #1
0
def test_line_scan_sensor_position(test_line_scan_driver):
    isd = usgscsm_formatter.to_usgscsm(test_line_scan_driver)
    sensor_position_obj = isd['sensor_position']
    expected_positions = np.vstack(
        (np.linspace(0, 3, 156), np.linspace(1, 4,
                                             156), np.linspace(2, 5, 156))).T
    expected_velocities = np.vstack(
        (np.linspace(0.03, 0.03,
                     156), np.linspace(0.03, 0.03,
                                       156), np.linspace(0.03, 0.03, 156))).T
    np.testing.assert_almost_equal(sensor_position_obj['positions'],
                                   expected_positions)
    np.testing.assert_almost_equal(sensor_position_obj['velocities'],
                                   expected_velocities)
    assert sensor_position_obj['unit'] == 'm'
Пример #2
0
def test_reference_height(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    reference_height = isd['reference_height']
    assert reference_height['maxheight'] == 1000
    assert reference_height['minheight'] == -1000
    assert reference_height['unit'] == 'm'
Пример #3
0
def test_radii(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    radii_obj = isd['radii']
    assert radii_obj['semimajor'] == 1100
    assert radii_obj['semiminor'] == 1000
    assert radii_obj['unit'] == 'km'
Пример #4
0
def test_sensor_orientation(test_frame_driver):
    isd = json.loads(usgscsm_formatter.to_usgscsm(test_frame_driver))
    sensor_orientation_obj = isd['sensor_orientation']
    assert sensor_orientation_obj['quaternions'] ==  [[0, 0, 0, -1], [0, 0, 0, -1]]
Пример #5
0
def test_rotation_times(test_line_scan_driver):
    isd = usgscsm_formatter.to_usgscsm(test_line_scan_driver)
    assert isd['t0_quaternion'] == -50
    assert isd['dt_quaternion'] == 100.0 / 155.0
Пример #6
0
def test_framer_sun_position(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    sun_position_obj = isd['sun_position']
    assert sun_position_obj['positions'] == [[0, 1, 2]]
    assert sun_position_obj['velocities'] == [[0, -1, -2]]
    assert sun_position_obj['unit'] == 'm'
Пример #7
0
def test_line_scan_rate(test_line_scan_driver):
    isd = usgscsm_formatter.to_usgscsm(test_line_scan_driver)
    assert isd['line_scan_rate'] == [[0.5, -50, 0.01]]
Пример #8
0
def test_frame_center_ephemeris_time(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    assert isd['center_ephemeris_time'] == 850
Пример #9
0
def test_summing(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    assert isd['detector_sample_summing'] == 2
    assert isd['detector_line_summing'] == 4
Пример #10
0
def test_name_platform(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    assert isd['name_platform'] == 'Test Platform'
Пример #11
0
def test_name_sensor(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    assert isd['name_sensor'] == 'Test Frame Sensor'
Пример #12
0
def test_line_scan_name_model(test_line_scan_driver):
    isd = usgscsm_formatter.to_usgscsm(test_line_scan_driver)
    assert isd['name_model'] == 'USGS_ASTRO_LINE_SCANNER_SENSOR_MODEL'
Пример #13
0
def test_frame_name_model(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    assert isd['name_model'] == 'USGS_ASTRO_FRAME_SENSOR_MODEL'
Пример #14
0
def test_rotation_times(test_line_scan_driver):
    isd = json.loads(usgscsm_formatter.to_usgscsm(test_line_scan_driver))
    assert isd['t0_quaternion'] == -850
    assert isd['dt_quaternion'] == 1
Пример #15
0
def test_sensor_orientation(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    sensor_orientation_obj = isd['sensor_orientation']

    assert sensor_orientation_obj['quaternions'].tolist() == [[0, 0, 0, -1],
                                                              [0, 0, 0, -1]]
Пример #16
0
def test_focal_to_pixel(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    assert isd['focal2pixel_lines'] == [0.1, 0.2, 0.3]
    assert isd['focal2pixel_samples'] == [0.3, 0.2, 0.1]
Пример #17
0
def test_detector_start(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    assert isd['starting_detector_line'] == 0
    assert isd['starting_detector_sample'] == 8
Пример #18
0
def test_focal_length(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    focal_model = isd['focal_length_model']
    assert focal_model['focal_length'] == 500
Пример #19
0
def test_starting_ephemeris_time(test_line_scan_driver):
    isd = usgscsm_formatter.to_usgscsm(test_line_scan_driver)
    assert isd['starting_ephemeris_time'] == 800
Пример #20
0
def test_image_size(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    assert isd['image_lines'] == 512
    assert isd['image_samples'] == 1024
Пример #21
0
def test_position_times(test_line_scan_driver):
    isd = usgscsm_formatter.to_usgscsm(test_line_scan_driver)
    assert isd['t0_ephemeris'] == -50
    assert isd['dt_ephemeris'] == 100.0 / 155.0
Пример #22
0
def test_detector_center(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    detector_center = isd['detector_center']
    assert detector_center['line'] == 256
    assert detector_center['sample'] == 512
Пример #23
0
def test_interpolation_method(test_line_scan_driver):
    isd = usgscsm_formatter.to_usgscsm(test_line_scan_driver)
    assert isd['interpolation_method'] == 'lagrange'
Пример #24
0
def test_distortion(test_frame_driver):
    isd = usgscsm_formatter.to_usgscsm(test_frame_driver)
    optical_distortion = isd['optical_distortion']
    assert optical_distortion['radial']['coefficients'] == [0.0, 1.0, 0.1]
Пример #25
0
def test_line_scan_sun_position(test_line_scan_driver):
    isd = usgscsm_formatter.to_usgscsm(test_line_scan_driver)
    sun_position_obj = isd['sun_position']
    assert sun_position_obj['positions'] == [[0, 1, 2], [3, 4, 5]]
    assert sun_position_obj['velocities'] == [[0, -1, -2], [-3, -4, -5]]
    assert sun_position_obj['unit'] == 'm'
Пример #26
0
def test_framer_sensor_position(test_frame_driver):
    isd = json.loads(usgscsm_formatter.to_usgscsm(test_frame_driver))
    sensor_position_obj = isd['sensor_position']
    assert sensor_position_obj['positions'] == [[0, 1, 2]]
    assert sensor_position_obj['velocities'] == [[0, -1, -2]]
    assert sensor_position_obj['unit'] == 'm'