Skip to content

Commit

Permalink
Remove transforms from barycentric equatorial to heliocentric eclipti…
Browse files Browse the repository at this point in the history
…c in detect_impacts
  • Loading branch information
moeyensj committed Jan 27, 2025
1 parent 0c24950 commit 3248dae
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions src/adam_assist/propagator.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,18 +433,8 @@ def _detect_impacts(
)

assert isinstance(time_step_results, OrbitType)
time_step_results = time_step_results.set_column(
"coordinates",
transform_coordinates(
time_step_results.coordinates,
origin_out=OriginCodes.SUN,
frame_out="ecliptic",
),
)

# Get the Earth's position at the current time
# earth_geo = get_perturber_state(OriginCodes.EARTH, results.coordinates.time[0], origin=OriginCodes.SUN)
# diff = time_step_results.coordinates.values - earth_geo.coordinates.values
earth_geo = ephem.get_particle("Earth", sim.t)
earth_geo = CartesianCoordinates.from_kwargs(
x=[earth_geo.x],
Expand All @@ -459,11 +449,12 @@ def _detect_impacts(
),
frame="equatorial",
)
earth_geo = transform_coordinates(
earth_geo,
origin_out=OriginCodes.SUN,
frame_out="ecliptic",
)

# Compute the geocentric state vector using the Earth's state vector
# and the results from the simulation.
# Note: ASSIST already computes the geocentric state vector, and so
# we can just subtract the Earth's state vector from the simulation rather than
# using our adam_core's transform_coordinates.
diff = time_step_results.coordinates.values - earth_geo.values

# Calculate the distance in KM
Expand Down Expand Up @@ -543,7 +534,7 @@ def _detect_impacts(
origin=Origin.from_kwargs(
code=[],
),
frame="ecliptic",
frame="equatorial",
),
variant_id=[],
)
Expand Down

0 comments on commit 3248dae

Please sign in to comment.