Copyright (c) 2024 Massachusetts Institute of Technology
SPDX-License-Identifier: MIT
Constants and Celestial Positions#
astroforge makes some commonly used physical constants easy to access, and it also provides a simple lookup for the sun and moon positions given a time in Modified Julian Day (MJD) format.
Constants#
[1]:
from astroforge.constants import *
print(f"The radius of Earth is {R_earth} km.")
print(f"The gravitational parameter of Earth is {GM} km**3 / s**2.")
print(f"The oblateness of the Earth (J2 perturbation) is {J2}")
print(f"The rotation rate of the Earth is {Omega} radians per second.")
print("")
print(f"The orbital radius of the geostationary belt is {Rgeo} km.")
print(f"The orbital velocity of a geostationary satellite is {Vgeo} km/s.")
print(f"The primary acceleration for a geostationary satellite is {Ageo} km/s**2.")
print("")
print(f"The speed of light is {c} km/s.")
The radius of Earth is 6378.137 km.
The gravitational parameter of Earth is 398600.4418 km**3 / s**2.
The oblateness of the Earth (J2 perturbation) is 0.0010826266751992014
The rotation rate of the Earth is 7.292115147019296e-05 radians per second.
The orbital radius of the geostationary belt is 42164.17236443124 km.
The orbital velocity of a geostationary satellite is 3.0746599996020167 km/s.
The primary acceleration for a geostationary satellite is 0.0002242077475503223 km/s**2.
The speed of light is 299792.458 km/s.
You can also find the gravitational parameters (in km3/s2) for other bodies in the solar system, including the combined Earth/moon system ("emb"):
[2]:
ss_GM
[2]:
{'mercury': 22032,
'venus': 324859,
'emb': 403503.23550216266,
'mars': 42828.375214,
'jupiter': 126712764.8,
'saturn': 37940585.2,
'uranus': 5793939,
'neptune': 6836529,
'moon': 4902.7779,
'sun': 132712440018.0}
Sun and Moon Positions#
Given a time in MJD format, astroforge can calculate low-fidelity positions for the sun and moon in both GCRS and Mean Equator Mean Equinox of Date (MEMED) coordinates (see Satellite Orbits by Montenbruck & Gill, pg. 70).
[3]:
MJD = 60197.5
from astroforge.common import R_moon, R_moon_MEMED, R_sun, R_sun_MEMED
r_moon_gcrs = R_moon(MJD)
r_moon_memed = R_moon_MEMED(MJD)
r_sun_gcrs = R_sun(MJD)
r_sun_memed = R_sun_MEMED(MJD)
print(f"Approximate Moon Coordinates at MJD {MJD}:")
print(f" GCRS: {r_moon_gcrs}")
print(f" MEMED: {r_moon_memed}")
print("")
print(f"Approximate Sun Coordinates at MJD {MJD}:")
print(f" GCRS: {r_sun_gcrs}")
print(f" MEMED: {r_sun_memed}")
Approximate Moon Coordinates at MJD 60197.5:
GCRS: [-184896.36188553 313416.42230858 175505.02631163]
MEMED: [-186957.66784405 312430.99946501 175077.79322196]
Approximate Sun Coordinates at MJD 60197.5:
GCRS: [-1.46913445e+08 3.06032318e+07 1.32681248e+07]
MEMED: [-1.47103679e+08 2.98240788e+07 1.29303206e+07]
These utilities are especially useful for determining whether a satellite is too close to the sun or moon to be observed with an optical sensor.