Skip to content

Commit edaa3d1

Browse files
authored
Merge pull request #17 from moeyensj/gauss
Initial Orbit Determination
2 parents 119ad1a + 68d1f0b commit edaa3d1

37 files changed

Lines changed: 1728 additions & 371 deletions

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
numpy
22
scipy
33
astropy
4+
astroquery
45
scikit-learn
56
matplotlib
67
seaborn
@@ -10,6 +11,8 @@ plotly
1011
pyyaml
1112
openorb
1213
ipykernel
14+
numba
15+
spiceypy
1316
pytest
1417
pytest-cov
1518
coveralls

requirements_travis.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
numpy
22
scipy
33
astropy
4+
astroquery
45
scikit-learn
56
matplotlib
67
seaborn
@@ -9,6 +10,8 @@ fortranformat
910
plotly
1011
pyyaml
1112
openorb
13+
numba
14+
spiceypy
1215
pytest
1316
pytest-cov<2.6.0
1417
coveralls

thor/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from .config import *
2+
from .constants import *
23
from .data_processing import *
4+
from .utils import *
35
from .io import *
46
from .orbits import *
57
from .coordinates import *

thor/constants.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import numpy as np
2+
from astropy import units as u
3+
from astropy.constants import codata2014 as c
4+
5+
AU_TO_KM = 6.684587122268446e-09
6+
7+
class Constants:
8+
9+
# Speed of light: AU per day (173.14463267424034)
10+
C = c.c.to(u.au / u.d).value
11+
12+
# Gravitational constant: AU**3 / M_sun / d**2 (0.00029591220819207784)
13+
G = c.G.to(u.AU**3 / u.M_sun / u.d**2).value
14+
15+
# Solar Mass: M_sun (1.0)
16+
M_SUN = 1.0
17+
18+
# Earth Mass: M_sun (3.0034893488507934e-06)
19+
M_EARTH = u.M_earth.to(u.M_sun)
20+
21+
# Earth Equatorial Radius (6378.1363 km (DE431/DE430))
22+
R_EARTH = (6378.1363 * u.km).to(u.AU)
23+
24+
# Mean Obliquity at J2000: radians (0.40909280422232897)
25+
OBLIQUITY = (84381.448 * u.arcsecond).to(u.radian).value
26+
27+
# Transformation matrix from Equatorial J2000 to Ecliptic J2000
28+
TRANSFORM_EQ2EC = np.array([
29+
[1, 0, 0],
30+
[0, np.cos(OBLIQUITY), np.sin(OBLIQUITY)],
31+
[0, -np.sin(OBLIQUITY), np.cos(OBLIQUITY)
32+
]])
33+
34+
# Transformation matrix from Ecliptic J2000 to Equatorial J2000
35+
TRANSFORM_EC2EQ = TRANSFORM_EQ2EC.T

thor/coordinates/coordinate_transforms.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import numpy as np
22

3-
OBLIQUITY = np.radians(23.43928)
4-
TRANSFORM_EQ2EC = np.matrix([[1, 0, 0],
5-
[0, np.cos(OBLIQUITY), np.sin(OBLIQUITY)],
6-
[0, -np.sin(OBLIQUITY), np.cos(OBLIQUITY)]])
7-
TRANSFORM_EC2EQ = np.matrix([[1, 0, 0],
8-
[0, np.cos(OBLIQUITY), -np.sin(OBLIQUITY)],
9-
[0, np.sin(OBLIQUITY), np.cos(OBLIQUITY)]])
3+
from ..constants import Constants as c
104

5+
TRANSFORM_EQ2EC = c.TRANSFORM_EQ2EC
6+
TRANSFORM_EC2EQ = c.TRANSFORM_EC2EQ
117

128
__all__ = ["equatorialToEclipticCartesian",
139
"eclipticToEquatorialCartesian",

thor/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from .config import Config
1212
from .cell import Cell
1313
from .particle import TestParticle
14-
from .orbits import propagateOrbits
14+
from .orbits.propagate import propagateOrbits
1515
from .data_processing import findExposureTimes
1616
from .data_processing import grabLinkedDetections
1717
from .plotting import plotOrbitsFindable

thor/observatories/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .codes import *

thor/observatories/codes.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import os
2+
3+
from ..utils import _downloadFile
4+
5+
__all__ = [
6+
"getMPCObsCodeFile",
7+
]
8+
9+
def getMPCObsCodeFile():
10+
"""
11+
Downloads the MPC Observatory Codes file. Checks if a newer version of the file exists online, if so,
12+
replaces the previously downloaded file if available.
13+
14+
Parameters
15+
----------
16+
None
17+
18+
Returns
19+
-------
20+
None
21+
"""
22+
obscodes = os.path.join(os.path.dirname(__file__), "data/ObsCodes.html")
23+
url = 'https://www.minorplanetcenter.net/iau/lists/ObsCodes.html'
24+
_downloadFile(obscodes, url, update=True)
25+
return
26+

thor/observatories/data/__init__.py

Whitespace-only changes.

thor/observatories/tests/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)