Skip to content

Commit 46ac076

Browse files
schaubhReeceHumphreys
authored andcommitted
removed deprecated use of astro constants
Astro constants should be imported from Basilisk.architecture.astroConstants. The duplicated values in src/utilities/astroFunctions.py have been deprecated for a year and are now removed.
1 parent e032a1b commit 46ac076

2 files changed

Lines changed: 0 additions & 141 deletions

File tree

src/architecture/utilities/tests/test_legacyAstroConstants.py

Lines changed: 0 additions & 85 deletions
This file was deleted.

src/utilities/astroFunctions.py

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import matplotlib.pyplot as plt
2121
import numpy as np
2222
from numpy import linalg as la
23-
from Basilisk.utilities import deprecated
2423
from Basilisk.architecture import astroConstants
2524

2625
# Reference solar flux at Earth [W/m^2]
@@ -683,61 +682,6 @@ def Tisserand_ESU():
683682
plt.show()
684683

685684

686-
# ------------------------------------------------------------------------------------------------------------------- #
687-
# DEPRECATED CONSTANTS
688-
#
689-
690-
def __getattr__(name):
691-
""" Special `__getattr__` to handle deprecation warning """
692-
AU = 1.49597870691e8 # [km]
693-
astroConstants = {
694-
# Useful conversions
695-
'R2D': 180.0 / np.pi, # [deg]
696-
'D2R': np.pi / 180.0, # [rad]
697-
'AU': AU,
698-
'SEC2DAY': 1.0 / (3600*24),
699-
'DAY2SEC': 1.0 * 3600 * 24,
700-
'PI': np.pi,
701-
702-
# Gravitational parameters [km^3 / s^2]
703-
'mu_S': 1.32712440018e11,
704-
'mu_E': 3.986004415e5,
705-
'mu_M': 4.28283100e4,
706-
'mu_V': 3.24858599e5,
707-
'mu_J': 1.26686534e8,
708-
'mu_Saturn': 3.79395000e7,
709-
'mu_U': 5.79396566e6,
710-
'mu_N': 6.83509920e6,
711-
'mu_Moon': 4902.799,
712-
713-
# Planets' Radius [km]
714-
'S_radius': 695508,
715-
'J_radius': 71492,
716-
'V_radius': 6051.8,
717-
'E_radius': 6378.1363,
718-
'M_radius': 3396.19,
719-
'Saturn_radius': 60268,
720-
'U_radius': 25559,
721-
'N_radius': 24764,
722-
'Moon_radius': 1738.1,
723-
724-
# Planetary Heliocentric orbits [km]
725-
'a_E': 1.0 * AU,
726-
'a_M': 1.52367934 * AU,
727-
'a_Mercury': 0.387 * AU,
728-
'a_V': 0.723 * AU,
729-
'a_J': 5.203 * AU,
730-
'a_Saturn': 9.537 * AU,
731-
'a_U': 19.191 * AU,
732-
'a_N': 30.069 * AU,
733-
'a_P': 39.482 * AU,
734-
}
735-
if name in astroConstants:
736-
deprecated.deprecationWarn(
737-
name, '2025/08/31', 'Astro constants should be used from Basilisk.architecture.astroConstants')
738-
return astroConstants[name]
739-
740-
741685
def main():
742686
Mars_RV(JulianDate([2018, 10, 16]))
743687

0 commit comments

Comments
 (0)