Skip to content

Commit

Permalink
Upgrade adam_core
Browse files Browse the repository at this point in the history
  • Loading branch information
moeyensj committed May 23, 2024
1 parent ff9257b commit 5f4e1f4
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 16 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/conda-build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ jobs:
sed -e '2d' ObsCodes.html | grep -v "<" > OBSCODE.dat
rm -f ObsCodes.html
cp OBSCODE.dat $CONDA_PREFIX/share/openorb/OBSCODE.dat
- name: Install adam_core and quivr
run: |
pip install adam-core@git+https://github.com/B612-Asteroid-Institute/adam_core@main
pip install quivr@git+https://github.com/moeyensj/quivr@concatenate-empty-attributes
- name: Build and install
run: pip install . --no-deps
- name: Lint
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ setup_requires =
wheel
setuptools_scm >= 6.0
install_requires =
adam-core @ git+https://github.com/B612-Asteroid-Institute/adam_core@c8f5aae352308ccd97c512c8d8e0a2e17c86ee18#egg=adam_core
adam-core @ git+https://github.com/B612-Asteroid-Institute/adam_core@ak/remove-pyoorb#egg=adam_core
adam-pyoorb @ git+https://github.com/B612-Asteroid-Institute/adam-pyoorb@main#egg=adam_core
astropy >= 5.3.1
astroquery
difi
Expand Down
2 changes: 1 addition & 1 deletion thor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import quivr as qv
import ray
from adam_core.propagator import PYOORB
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.ray_cluster import initialize_use_ray

from .checkpointing import create_checkpoint_data, load_initial_checkpoint_values
Expand Down
4 changes: 2 additions & 2 deletions thor/orbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
)
from adam_core.observers import Observers
from adam_core.orbits import Ephemeris, Orbits
from adam_core.propagator import PYOORB, Propagator
from adam_core.propagator import Propagator
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.ray_cluster import initialize_use_ray
from adam_core.time import Timestamp

Expand Down Expand Up @@ -231,7 +232,6 @@ def generate_ephemeris(
observers,
max_processes=max_processes,
chunk_size=1,
parallel_backend="ray",
)

def generate_ephemeris_from_observations(
Expand Down
3 changes: 2 additions & 1 deletion thor/orbit_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
from adam_core.coordinates import KeplerianCoordinates
from adam_core.observers import Observers
from adam_core.orbits import Ephemeris, Orbits
from adam_core.propagator import PYOORB, Propagator
from adam_core.propagator import Propagator
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.propagator.utils import _iterate_chunks
from adam_core.ray_cluster import initialize_use_ray
from adam_core.time import Timestamp
Expand Down
3 changes: 2 additions & 1 deletion thor/orbits/attribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import ray
from adam_core.coordinates.residuals import Residuals
from adam_core.orbits import Orbits
from adam_core.propagator import PYOORB, Propagator
from adam_core.propagator import Propagator
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.propagator.utils import _iterate_chunk_indices, _iterate_chunks
from adam_core.ray_cluster import initialize_use_ray
from sklearn.neighbors import BallTree
Expand Down
3 changes: 2 additions & 1 deletion thor/orbits/iod.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import ray
from adam_core.coordinates.residuals import Residuals
from adam_core.orbit_determination import OrbitDeterminationObservations
from adam_core.propagator import PYOORB, Propagator
from adam_core.propagator import Propagator
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.propagator.utils import _iterate_chunk_indices, _iterate_chunks
from adam_core.ray_cluster import initialize_use_ray

Expand Down
3 changes: 2 additions & 1 deletion thor/orbits/od.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from adam_core.coordinates.residuals import Residuals
from adam_core.orbit_determination import OrbitDeterminationObservations
from adam_core.orbits import Orbits
from adam_core.propagator import PYOORB, Propagator, _iterate_chunks
from adam_core.propagator import Propagator, _iterate_chunks
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.propagator.utils import _iterate_chunk_indices
from adam_core.ray_cluster import initialize_use_ray
from scipy.linalg import solve
Expand Down
9 changes: 6 additions & 3 deletions thor/orbits/state_transition.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import numpy as np
from adam_core import dynamics
from adam_core.constants import Constants as c
from adam_core.dynamics.lagrange import (
apply_lagrange_coefficients,
calc_lagrange_coefficients,
)

__all__ = ["calcMMatrix", "calcStateTransitionMatrix"]

Expand Down Expand Up @@ -152,11 +155,11 @@ def calcStateTransitionMatrix(
# Here alpha is defined as 1 / a where a is the semi-major axis of the orbit
alpha = -(v0_mag**2) / mu + 2 / r0_mag

lagrange_coeffs, stumpff_coeffs, chi = dynamics.calc_lagrange_coefficients(
lagrange_coeffs, stumpff_coeffs, chi = calc_lagrange_coefficients(
r0, v0, dt, mu=mu, max_iter=max_iter, tol=tol
)
f, g, f_dot, g_dot = lagrange_coeffs
r1, v1 = dynamics.apply_lagrange_coefficients(r0, v0, *lagrange_coeffs)
r1, v1 = apply_lagrange_coefficients(r0, v0, *lagrange_coeffs)
M = calcMMatrix(r0, r1, lagrange_coeffs, stumpff_coeffs, chi, alpha, mu=mu)

# Construct the 3 x 2 state matrices with the position vector
Expand Down
3 changes: 2 additions & 1 deletion thor/range_and_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
OriginCodes,
transform_coordinates,
)
from adam_core.propagator import PYOORB, Propagator
from adam_core.propagator import Propagator
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.ray_cluster import initialize_use_ray

from .observations.observations import Observations
Expand Down

0 comments on commit 5f4e1f4

Please sign in to comment.