Skip to content

Commit

Permalink
jit t_p cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
s-m-e committed Feb 23, 2024
1 parent 576a55c commit 2b5752c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/hapsira/twobody/states.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
mean_motion_vf,
period_vf,
)
from hapsira.twobody.elements import t_p
from hapsira.core.propagation.farnocchia import delta_t_from_nu_vf, FARNOCCHIA_DELTA


u_km3s2 = u.km**3 / u.s**2
Expand Down Expand Up @@ -85,11 +85,16 @@ def r_a(self):
@cached_property
def t_p(self):
"""Elapsed time since latest perifocal passage."""
return t_p(
self.to_classical().nu,
self.to_classical().ecc,
self.attractor.k,
self.r_p,
self_classical = self.to_classical()
return (
delta_t_from_nu_vf(
self_classical.nu.to_value(u.rad),
self_classical.ecc.value,
self.attractor.k.to_value(u_km3s2),
self.r_p.to_value(u.km),
FARNOCCHIA_DELTA,
)
* u.s
)

def to_tuple(self):
Expand Down

0 comments on commit 2b5752c

Please sign in to comment.