Skip to content

Commit 80ac30a

Browse files
TST: Fix test_flight and environment interpolation due to new ISA bounds
1 parent 84aa320 commit 80ac30a

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

rocketpy/environment/environment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2555,7 +2555,9 @@ def pressure_function(h):
25552555
# Discretize this Function to speed up the trajectory simulation
25562556
min_height = geopotential_height_to_geometric_height(-2000, earth_radius)
25572557
max_height = geopotential_height_to_geometric_height(80000, earth_radius)
2558-
altitudes = np.linspace(min_height, max_height, 100)
2558+
altitudes_below = np.linspace(min_height, 0, 10, endpoint=False)
2559+
altitudes_above = np.linspace(0, max_height, 90)
2560+
altitudes = np.concatenate((altitudes_below, altitudes_above))
25592561
pressures = [pressure_function(h) for h in altitudes]
25602562

25612563
return np.column_stack([altitudes, pressures])

tests/integration/simulation/test_flight.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def test_freestream_speed_at_apogee(example_plain_env, calisto):
460460

461461
assert np.isclose(
462462
test_flight.stream_velocity_x(test_flight.apogee_time),
463-
0.4641492104717301,
463+
0.46416088113985227,
464464
atol=hard_atol,
465465
)
466466
assert np.isclose(
@@ -472,11 +472,11 @@ def test_freestream_speed_at_apogee(example_plain_env, calisto):
472472
)
473473
assert np.isclose(
474474
test_flight.free_stream_speed(test_flight.apogee_time),
475-
0.4641492104717798,
475+
0.46416088113985277,
476476
atol=hard_atol,
477477
)
478478
assert np.isclose(
479-
test_flight.apogee_freestream_speed, 0.4641492104717798, atol=hard_atol
479+
test_flight.apogee_freestream_speed, 0.46416088113985277, atol=hard_atol
480480
)
481481

482482

0 commit comments

Comments
 (0)