Skip to content

Commit

Permalink
Use IAU definition of au
Browse files Browse the repository at this point in the history
  • Loading branch information
moeyensj committed May 23, 2024
1 parent ce26b42 commit 83889bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/adam_core/propagator/adam_assist.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import quivr as qv
import rebound
import urllib3
from adam_core.constants import KM_P_AU
from adam_core.coordinates import CartesianCoordinates, Origin, transform_coordinates
from adam_core.coordinates.origin import OriginCodes
from adam_core.dynamics.impacts import EarthImpacts, ImpactMixin
Expand Down Expand Up @@ -444,7 +445,8 @@ def _detect_impacts(
diff = time_step_results.coordinates.values - earth_geo.values

# Calculate the distance in KM
normalized_distance = np.linalg.norm(diff[:, :3], axis=1) * 149597870.691
# We use the IAU definition of the astronomical unit (149_597_870.7 km)
normalized_distance = np.linalg.norm(diff[:, :3], axis=1) * KM_P_AU

# Calculate which particles are within an Earth radius
within_radius = normalized_distance < EARTH_RADIUS_KM
Expand Down

0 comments on commit 83889bd

Please sign in to comment.