Skip to content

Commit 4c45aa3

Browse files
committed
Bug fixed in pull request - updated frame definitions in trajectory class.
1 parent dfb2dcc commit 4c45aa3

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

eosimutils/trajectory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def convert_frame(positions: np.ndarray, velocities: np.ndarray, times: np.ndarr
3838

3939
if from_frame.to_string() == "ITRF":
4040
from_string = "J2000"
41-
elif from_frame.to_string() == "GCRF":
41+
elif from_frame.to_string() == "ICRF_EC":
4242
from_string = "ITRF93"
4343
else:
4444
raise NotImplementedError(
@@ -47,7 +47,7 @@ def convert_frame(positions: np.ndarray, velocities: np.ndarray, times: np.ndarr
4747

4848
if to_frame.to_string() == "ITRF":
4949
to_string = "J2000"
50-
elif to_frame.to_string() == "GCRF":
50+
elif to_frame.to_string() == "ICRF_EC":
5151
to_string = "ITRF93"
5252
else:
5353
raise NotImplementedError(f"Conversion from {from_frame} to {to_frame} is not implemented.")

examples/trajectory_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
position1[missing_start:missing_end, :] = np.nan
3636
velocity1[missing_start:missing_end, :] = np.nan
3737

38-
traj1 = Trajectory(abs_dates, [position1, velocity1], ReferenceFrame.GCRF)
38+
traj1 = Trajectory(abs_dates, [position1, velocity1], ReferenceFrame.ICRF_EC)
3939
traj1_itrf = traj1.to_frame(ReferenceFrame.ITRF) # Convert to ITRF frame.
4040

4141
# Orbit 2: Nearly identical orbit with a small increase in radius.
@@ -50,7 +50,7 @@
5050

5151
position2 = np.column_stack((x2, y2, z2))
5252
velocity2 = np.column_stack((vx2, vy2, vz2))
53-
traj2 = Trajectory(abs_dates, [position2, velocity2], ReferenceFrame.GCRF)
53+
traj2 = Trajectory(abs_dates, [position2, velocity2], ReferenceFrame.ICRF_EC)
5454

5555
# Compute the difference between the two trajectories
5656
traj_diff = traj1 - traj2

tests/test_trajectory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def setUp(self):
1414
self.time = AbsoluteDates(np.array([0, 1, 2]))
1515
self.positions = np.array([[0, 0, 0], [1, 1, 1], [2, 2, 2]])
1616
self.velocities = np.array([[0, 0, 0], [1, 1, 1], [2, 2, 2]])
17-
self.frame = ReferenceFrame("GCRF")
17+
self.frame = ReferenceFrame("ICRF_EC")
1818
self.trajectory = Trajectory(self.time, [self.positions, self.velocities], self.frame)
1919

2020
def test_resample(self):

0 commit comments

Comments
 (0)