Skip to content

Commit

Permalink
Update README with latest API changes and additions
Browse files Browse the repository at this point in the history
  • Loading branch information
moeyensj committed Jul 11, 2023
1 parent 89acb9b commit 12e6df8
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ from adam_core.coordinates import Origin
from adam_core.orbits import Orbits

keplerian_elements = KeplerianCoordinates.from_kwargs(
times=Times.from_astropy(
time=Times.from_astropy(
Time([59000.0], scale="tdb", format="mjd")
),
a=[1.0],
Expand All @@ -30,8 +30,8 @@ keplerian_elements = KeplerianCoordinates.from_kwargs(
frame="ecliptic"
)
orbits = Orbits.from_kwargs(
orbit_ids=["1"],
object_ids=["Test Orbit"],
orbit_id=["1"],
object_id=["Test Orbit"],
coordinates=keplerian_elements.to_cartesian(),
)
```
Expand All @@ -49,7 +49,7 @@ from adam_core.coordinates import Origin
from adam_core.orbits import Orbits

keplerian_elements = KeplerianCoordinates.from_kwargs(
times=Times.from_astropy(
time=Times.from_astropy(
Time([59000.0, 60000.0], scale="tdb", format="mjd")
),
a=[1.0, 3.0],
Expand All @@ -62,8 +62,8 @@ keplerian_elements = KeplerianCoordinates.from_kwargs(
frame="ecliptic"
)
orbits = Orbits.from_kwargs(
orbit_ids=["1", "2"],
object_ids=["Test Orbit 1", "Test Orbit 2"],
orbit_id=["1", "2"],
object_id=["Test Orbit 1", "Test Orbit 2"],
coordinates=keplerian_elements.to_cartesian(),
)
```
Expand All @@ -87,7 +87,7 @@ from adam_core.coordinates import CoordinateCovariances
from adam_core.orbits import Orbits

keplerian_elements = KeplerianCoordinates.from_kwargs(
times=Times.from_astropy(
time=Times.from_astropy(
Time([59000.0], scale="tdb", format="mjd")
),
a=[1.0],
Expand All @@ -96,16 +96,16 @@ keplerian_elements = KeplerianCoordinates.from_kwargs(
raan=[50.0],
ap=[20.0],
M=[30.0],
covariances=CoordinateCovariances.from_sigmas(
covariance=CoordinateCovariances.from_sigmas(
np.array([[0.002, 0.001, 0.01, 0.01, 0.1, 0.1]])
),
origin=Origin.from_kwargs(code=["SUN"]),
frame="ecliptic"
)

orbits = Orbits.from_kwargs(
orbit_ids=["1"],
object_ids=["Test Orbit with Uncertainties"],
orbit_id=["1"],
object_id=["Test Orbit with Uncertainties"],
coordinates=keplerian_elements.to_cartesian(),
)
orbits.to_dataframe(sigmas=True)
Expand Down Expand Up @@ -179,6 +179,7 @@ propagated_orbits = propagator.propagate_orbits(

### Low-level APIs

#### State Vectors from Development Ephemeris files
Getting the heliocentric ecliptic state vector of a DE440 body at a given set of times (in this case the barycenter of the Jovian system):
```python
import numpy as np
Expand All @@ -195,6 +196,29 @@ states = get_perturber_state(
)
```

#### 2-body Propagation
`adam_core` also has 2-body propagation functionality. To propagate any orbit with 2-body dynamics:
```python
import numpy as np
from astropy.time import Time
from astropy import units as u
from adam_core.orbits.query import query_sbdb
from adam_core.dynamics.propagation import propagate_2body

# Get orbit to propagate
object_ids = ["Duende", "Eros", "Ceres"]
orbits = query_sbdb(object_ids)

# Define propagation times
times = Time(np.arange(59000, 60000), scale="tdb", format="mjd")

# Propagate orbits with 2-body dynamics
propagated_orbits = propagate_2body(
orbits,
times
)
```

## Package Structure

```bash
Expand Down

0 comments on commit 12e6df8

Please sign in to comment.