Skip to content

Commit

Permalink
update pyoorb class names
Browse files Browse the repository at this point in the history
  • Loading branch information
akoumjian committed May 24, 2024
1 parent e2b0700 commit bed1961
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,13 @@ You will need to install either adam_core[pyoorb] or adam_core[assist], or anoth

#### Propagation
To propagate orbits with PYOORB (here we grab some orbits from Horizons first):

```python
import numpy as np
from astropy import units as u

from adam_core.orbits.query import query_horizons
from adam_core.propagator import PYOORB
from adam_core.propagator import PYOORBPropagator
from adam_core.time import Timestamp

# Get orbits to propagate
Expand All @@ -170,7 +171,7 @@ object_ids = ["Duende", "Eros", "Ceres"]
orbits = query_horizons(object_ids, initial_time)

# Make sure PYOORB is ready
propagator = PYOORB()
propagator = PYOORBPropagator()

# Define propagation times
times = initial_time.from_mjd(initial_time.mjd() + np.arange(0, 100))
Expand All @@ -186,14 +187,21 @@ propagated_orbits = propagator.propagate_orbits(
```

#### Ephemeris Generation
The propagator class can also be used to generate ephemerides for a set of orbits and observers.
Ephemeris generation requires a propagator that implements the EphemerisMixin interface. This is currently only implemented by the PYOORB propagator. The ephemeris generator will automatically map the propagated covariance matrices to the sky-plane.

You will need to install adam-pyoorb in order to use the ephemeris generator.

```sh
pip install adam-core[pyoorb]
```


```python
import numpy as np
from astropy import units as u

from adam_core.orbits.query import query_horizons
from adam_core.propagator import PYOORB
from adam_core.propagator import PYOORBPropagator
from adam_core.observers import Observers
from adam_core.time import Timestamp

Expand All @@ -203,7 +211,7 @@ object_ids = ["Duende", "Eros", "Ceres"]
orbits = query_horizons(object_ids, initial_time)

# Make sure PYOORB is ready
propagator = PYOORB()
propagator = PYOORBPropagator()

# Define a set of observers and observation times
times = Timestamp.from_mjd(initial_time.mjd() + np.arange(0, 100))
Expand Down Expand Up @@ -278,7 +286,7 @@ import numpy as np
from astropy import units as u

from adam_core.orbits.query import query_sbdb
from adam_core.propagator import PYOORB
from adam_core.propagator import PYOORBPropagator
from adam_core.observers import Observers
from adam_core.dynamics import generate_ephemeris_2body
from adam_core.time import Timestamp
Expand All @@ -288,7 +296,7 @@ object_ids = ["Duende", "Eros", "Ceres"]
orbits = query_sbdb(object_ids)

# Make sure PYOORB is ready
propagator = PYOORB()
propagator = PYOORBPropagator()

# Define a set of observers and observation times
times = Timestamp.from_mjd(np.arange(59000, 60000), scale="tdb")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from adam_core.propagator.adam_pyoorb import PYOORB
from adam_core.propagator.adam_pyoorb import PYOORBPropagator

from ..differential_correction import fit_least_squares

Expand All @@ -15,7 +15,7 @@ def test_fit_least_squares_pure_iod_orbit(pure_iod_orbit):
# process using least squares

orbit, orbit_members, observations = pure_iod_orbit
propagator = PYOORB()
propagator = PYOORBPropagator()

fitted_orbit, fitted_orbit_members = fit_least_squares(
orbit, observations, propagator
Expand Down
6 changes: 3 additions & 3 deletions src/adam_core/orbit_determination/tests/test_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
import quivr as qv

from adam_core.propagator.adam_pyoorb import PYOORB
from adam_core.propagator.adam_pyoorb import PYOORBPropagator

from ..evaluate import evaluate_orbits

Expand All @@ -17,7 +17,7 @@ def test_evaluate_orbits(pure_iod_orbit):
# Test that evaluate_orbit correctly calculates residuals and other
# parameters for an input orbit
orbit, orbit_members, observations = pure_iod_orbit
propagator = PYOORB()
propagator = PYOORBPropagator()

# Concatenate the orbit three times to test we can handle multiple orbits
orbits = qv.concatenate([orbit, orbit, orbit])
Expand Down Expand Up @@ -64,7 +64,7 @@ def test_evaluate_orbits_outliers(pure_iod_orbit):
# Test that evaluate_orbit correctly calculates residuals and other
# parameters for an input orbit with outliers defined
orbit, orbit_members, observations = pure_iod_orbit
propagator = PYOORB()
propagator = PYOORBPropagator()

# Lets remove the last two observations
outliers = observations.id.tolist()[-2:]
Expand Down
1 change: 0 additions & 1 deletion src/adam_core/propagator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
"EphemerisMixin",
"OrbitType",
"EphemerisType",
"PYOORB",
]

0 comments on commit bed1961

Please sign in to comment.