Skip to content

Commit

Permalink
Set default frame to 'unspecified' (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
moeyensj authored Oct 12, 2023
1 parent c56b660 commit 2b6fcd5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion adam_core/coordinates/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CartesianCoordinates(qv.Table):
time = Timestamp.as_column(nullable=True)
covariance = CoordinateCovariances.as_column(nullable=True)
origin = Origin.as_column()
frame = qv.StringAttribute()
frame = qv.StringAttribute(default="unspecified")

@property
def values(self) -> np.ndarray:
Expand Down
2 changes: 1 addition & 1 deletion adam_core/coordinates/cometary.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CometaryCoordinates(qv.Table):
time = Timestamp.as_column(nullable=True)
covariance = CoordinateCovariances.as_column(nullable=True)
origin = Origin.as_column()
frame = qv.StringAttribute()
frame = qv.StringAttribute(default="unspecified")

@property
def values(self) -> np.ndarray:
Expand Down
2 changes: 1 addition & 1 deletion adam_core/coordinates/keplerian.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class KeplerianCoordinates(qv.Table):
time = Timestamp.as_column(nullable=True)
covariance = CoordinateCovariances.as_column(nullable=True)
origin = Origin.as_column()
frame = qv.StringAttribute()
frame = qv.StringAttribute(default="unspecified")

@property
def values(self) -> np.ndarray:
Expand Down
2 changes: 1 addition & 1 deletion adam_core/coordinates/spherical.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class SphericalCoordinates(qv.Table):
time = Timestamp.as_column(nullable=True)
covariance = CoordinateCovariances.as_column(nullable=True)
origin = Origin.as_column()
frame = qv.StringAttribute()
frame = qv.StringAttribute(default="unspecified")

@property
def values(self) -> np.ndarray:
Expand Down
11 changes: 11 additions & 0 deletions adam_core/dynamics/tests/test_ephemeris.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
import pyarrow.compute as pc
import pytest
import quivr as qv
from astropy import units as u
Expand Down Expand Up @@ -126,3 +127,13 @@ def test_generate_ephemeris_2body(object_id, propagated_orbits, ephemeris):

# Assert that the range is less than the tolerance
np.testing.assert_array_less(range_diff, range_tolerance)

# Ephemeris 2-body does not propagate the covariance or provide the
# aberrated state so the aberrated coordinates should be empty
assert ephemeris_orbit_2body.aberrated_coordinates.frame == "unspecified"
assert pc.all(pc.is_null(ephemeris_orbit_2body.aberrated_coordinates.x)).as_py()
assert pc.all(pc.is_null(ephemeris_orbit_2body.aberrated_coordinates.y)).as_py()
assert pc.all(pc.is_null(ephemeris_orbit_2body.aberrated_coordinates.z)).as_py()
assert pc.all(pc.is_null(ephemeris_orbit_2body.aberrated_coordinates.vx)).as_py()
assert pc.all(pc.is_null(ephemeris_orbit_2body.aberrated_coordinates.vy)).as_py()
assert pc.all(pc.is_null(ephemeris_orbit_2body.aberrated_coordinates.vz)).as_py()

0 comments on commit 2b6fcd5

Please sign in to comment.