Skip to content

Commit

Permalink
it passes
Browse files Browse the repository at this point in the history
  • Loading branch information
akoumjian committed May 10, 2024
1 parent 6b93706 commit f8241c7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions adam_core/dynamics/tests/test_impacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ def _detect_impacts(self, orbits: Orbits, num_days: float) -> Orbits:

# Pick random orbit to impact
impacted = orbits[0]
print(impacted.coordinates.x)
print(impacted)
impact = EarthImpacts.from_kwargs(
orbit_id=impacted.orbit_id,
object_id=impacted.object_id,
variant_id=impacted.variant_id,
coordinates=CartesianCoordinates.from_kwargs(
x=impacted.coordinates.x,
y=impacted.coordinates.y,
Expand All @@ -40,7 +42,7 @@ def _detect_impacts(self, orbits: Orbits, num_days: float) -> Orbits:
origin=impacted.coordinates.origin,
frame=impacted.coordinates.frame,
),
distance=0.0,
distance=[0.0],
)

return orbits, impact
Expand All @@ -64,23 +66,21 @@ def test_calculate_impacts():
origin=Origin.from_kwargs(code=["SUN"] * 3),
frame="ecliptic",
covariance=CoordinateCovariances.from_sigmas(
np.array(
[
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
]
)
np.array([
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
])
),
),
)

prop = MockImpactPropagator()
variants, impacts = calculate_impacts(orbits, 10, prop, 1.0, 1000, 1)
variants, impacts = calculate_impacts(orbits, 10, prop, num_samples=1000, processes=1, seed=42)
assert pc.all(
pc.equal(
variants.coordinates.time.mjd(),
orbits[0].coordinates.time.add_days(10).mjd().as_py(),
variants.coordinates.time.mjd().to_pylist(),
orbits[0].coordinates.time.add_days(10).mjd().to_pylist()[0],
)
)

Expand Down

0 comments on commit f8241c7

Please sign in to comment.