Skip to content

Commit

Permalink
Delete unused code and remove private stuff from public APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
spenczar committed Oct 18, 2023
1 parent be5d606 commit 7eb7220
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 775 deletions.
15 changes: 1 addition & 14 deletions adam_core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"KM_P_AU",
"S_P_DAY",
"Constants",
"DE43X",
"DE44X",
]

Expand Down Expand Up @@ -35,18 +34,6 @@ def __init__(self, C=None, MU=None, R_Earth=None, Obliquity=None):
return


DE43X_CONSTANTS = {
# Speed of Light : au / d (299792.458 km / s -- DE430/DE431)
"C": 299792.458 / KM_P_AU * S_P_DAY,
# Standard Gravitational Parameter -- Sun : au**3 / d**2 (0.295912208285591100E-3 -- DE431/DE430)
"MU": 0.295912208285591100e-3,
# Earth Equatorial Radius: au (6378.1363 km -- DE431/DE430)
"R_Earth": 6378.1363 / KM_P_AU,
# Mean Obliquity at J2000: radians (84381.448 arcseconds -- DE431/DE430)
"Obliquity": 84381.448 * np.pi / (180.0 * 3600.0),
}
Constants = DE43X = _Constants(**DE43X_CONSTANTS)

DE44X_CONSTANTS = {
# Speed of Light : au / d (299792.458 km / s -- DE430/DE431)
"C": 299792.458 / KM_P_AU * S_P_DAY,
Expand All @@ -57,4 +44,4 @@ def __init__(self, C=None, MU=None, R_Earth=None, Obliquity=None):
# Mean Obliquity at J2000: radians (84381.448 arcseconds -- DE431/DE430)
"Obliquity": 84381.448 * np.pi / (180.0 * 3600.0),
}
DE44X = _Constants(**DE44X_CONSTANTS)
DE44X = Constants = _Constants(**DE44X_CONSTANTS)
52 changes: 10 additions & 42 deletions adam_core/coordinates/__init__.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,11 @@
# flake8: noqa: F401
from .cartesian import CARTESIAN_COLS, CARTESIAN_UNITS, CartesianCoordinates
from .cometary import COMETARY_COLS, COMETARY_UNITS, CometaryCoordinates
from .conversions import convert_coordinates
from .covariances import (
CoordinateCovariances,
covariances_from_df,
covariances_to_df,
covariances_to_table,
sample_covariance_random,
sample_covariance_sigma_points,
sigmas_from_df,
sigmas_to_df,
transform_covariances_jacobian,
transform_covariances_sampling,
weighted_covariance,
weighted_mean,
)
from .jacobian import calc_jacobian
from .keplerian import KEPLERIAN_COLS, KEPLERIAN_UNITS, KeplerianCoordinates
from .origin import Origin, OriginCodes, OriginGravitationalParameters
from .residuals import Residuals
from .spherical import SPHERICAL_COLS, SPHERICAL_UNITS, SphericalCoordinates
from .times import Times
from .transform import (
_cartesian_to_cometary,
_cartesian_to_keplerian,
_cartesian_to_keplerian6,
_cartesian_to_spherical,
_cometary_to_cartesian,
_keplerian_to_cartesian_a,
_keplerian_to_cartesian_p,
_keplerian_to_cartesian_q,
_spherical_to_cartesian,
cartesian_to_cometary,
cartesian_to_keplerian,
cartesian_to_spherical,
cometary_to_cartesian,
keplerian_to_cartesian,
spherical_to_cartesian,
transform_coordinates,
)
from .variants import create_coordinate_variants
from .cartesian import CartesianCoordinates
from .cometary import CometaryCoordinates
from .covariances import CoordinateCovariances
from .keplerian import KeplerianCoordinates
from .origin import Origin, OriginCodes
from .spherical import SphericalCoordinates
from .transform import transform_coordinates

# TODO: move this to an 'experimental' module
# from .residuals import Residuals
6 changes: 1 addition & 5 deletions adam_core/coordinates/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import numpy as np
import quivr as qv
from astropy import units as u

from ..time import Timestamp
from .covariances import CoordinateCovariances
Expand All @@ -14,16 +13,13 @@
from .keplerian import KeplerianCoordinates
from .spherical import SphericalCoordinates

__all__ = ["CartesianCoordinates", "CARTESIAN_COLS", "CARTESIAN_UNITS"]
__all__ = ["CartesianCoordinates"]

CARTESIAN_COLS = {}
CARTESIAN_UNITS = {}
for i in ["x", "y", "z"]:
CARTESIAN_COLS[i] = i
CARTESIAN_UNITS[i] = u.au
for i in ["vx", "vy", "vz"]:
CARTESIAN_COLS[i] = i
CARTESIAN_UNITS[i] = u.au / u.d

COVARIANCE_ROTATION_TOLERANCE = 1e-25
logger = logging.getLogger(__name__)
Expand Down
9 changes: 0 additions & 9 deletions adam_core/coordinates/cometary.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import numpy as np
import quivr as qv
from astropy import units as u

from ..time import Timestamp
from .cartesian import CartesianCoordinates
Expand All @@ -17,19 +16,11 @@
__all__ = [
"CometaryCoordinates",
"COMETARY_COLS",
"COMETARY_UNITS",
]

COMETARY_COLS = {}
COMETARY_UNITS = {}
for i in ["q", "e", "i", "raan", "ap", "tp"]:
COMETARY_COLS[i] = i
COMETARY_UNITS["q"] = u.au
COMETARY_UNITS["e"] = u.dimensionless_unscaled
COMETARY_UNITS["i"] = u.deg
COMETARY_UNITS["raan"] = u.deg
COMETARY_UNITS["ap"] = u.deg
COMETARY_UNITS["tp"] = u.d


class CometaryCoordinates(qv.Table):
Expand Down
176 changes: 0 additions & 176 deletions adam_core/coordinates/conversions.py

This file was deleted.

Loading

0 comments on commit 7eb7220

Please sign in to comment.