Skip to content
Snippets Groups Projects
Commit 12f32719 authored by Jean-Baptiste Bayle's avatar Jean-Baptiste Bayle
Browse files

Add unit test for initial telemetry size

parent b0b0cd52
No related branches found
No related tags found
1 merge request!152Resolve "Error when using an non zero initial_telemetry_size"
Pipeline #225757 passed
......@@ -3,6 +3,7 @@
# pylint: disable=missing-module-docstring
import pytest
import h5py
from lisainstrument import Instrument
......@@ -74,3 +75,27 @@ def test_locking():
Instrument(size=100, lock='N7-12')
with pytest.raises(ValueError):
Instrument(size=100, lock='N1-67')
def test_initial_telemetry_size():
"""Test that simulations can run with a nonzero initial telemetry size."""
orbit_paths = [
'tests/keplerian-orbits-1-0-2.h5',
'tests/esa-orbits-1-0-2.h5',
'tests/keplerian-orbits-2-0.h5',
'tests/esa-trailing-orbits-2-0.h5',
]
for orbit_path in orbit_paths:
# Read orbit file t0 and leave room for initial telemetry
with h5py.File(orbit_path, 'r') as orbitf:
t0 = orbitf.attrs['t0'] + 1E6
instru = Instrument(
initial_telemetry_size=10,
telemetry_downsampling=100,
orbits=orbit_path,
size=100,
t0=t0)
instru.simulate()
instru.write(mode='w')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment