Eso da para una charla entera :) Como resumen, visualicemos este experimento mental ideado por Newton:
from IPython.display import YouTubeVideo
YouTubeVideo("iEQuE5N3rwQ", width=800, height=600)
%matplotlib inline
from astropy import units as u
from astropy.time import Time
from poliastro.bodies import Earth
from poliastro.twobody import Orbit
from poliastro.plotting import plot, OrbitPlotter
r = [-6045, -3490, 2500] * u.km
v = [-3.457, 6.618, 2.533] * u.km / u.s
ss = Orbit.from_vectors(Earth, r, v, Time.now())
ss
7283 x 10293 km x 153.2 deg orbit around Earth (♁)
plot(ss);
También conocidos como NEOs, del inglés Near Earth Objetcs.
Son cometas y asteroides a los que las fuerzas gravitatorias del Sistema Solar han atraído a las cercanías de la Tierra.
Existen más de 16000.
Como parte del proyecto SOCIS, se ha añadido en la versión 0.7 de poliastro un paquete NEOS. Está dividido en dos módulos:
from poliastro.neos import neows, dastcom5
El módulo se basa en este Servicio Web de la NASA.
eros = neows.orbit_from_name('Eros')
ganymed = neows.orbit_from_name('1036') # Ganymed IAU number
amor = neows.orbit_from_name('2001221') # Amor SPK-ID
frame = OrbitPlotter()
frame.plot(ganymed, label='Ganymed')
frame.plot(eros, label='Eros')
frame.plot(amor, label='Amor')
[<matplotlib.lines.Line2D at 0x18e6922c7b8>, <matplotlib.lines.Line2D at 0x18e6922c9b0>]
Trabaja con la base de datos DASTCOM5, mantenida por la NASA y el JPL. Contiene datos sobre cometas y asteroides.
La base de datos viene en un zip de unos ~230 MB que se puede descargar a mano y descomprimir en ~/.poliastro
, o, más fácil, se puede usar una función de poliastro:
dastcom5.download_dastcom5()
atira = dastcom5.orbit_from_name('atira')[0] # NEO
wikipedia = dastcom5.orbit_from_name('wikipedia')[0] # Asteroid, but not NEO.
tomhanks = dastcom5.orbit_from_name('tomhanks')[0]
jamesbond = dastcom5.orbit_from_name('9007')[0]
frame = OrbitPlotter()
frame.plot(atira, label='Atira (NEO)')
frame.plot(wikipedia, label='Wikipedia (asteroid)')
frame.plot(tomhanks, label='Tomhanks')
frame.plot(jamesbond, label='James Bond (9007)')
[<matplotlib.lines.Line2D at 0x18e69824470>, <matplotlib.lines.Line2D at 0x18e69824e48>]
halleys = dastcom5.orbit_from_name('1P')
frame = OrbitPlotter()
frame.plot(halleys[0], label='Halley')
frame.plot(halleys[5], label='Halley')
frame.plot(halleys[10], label='Halley')
frame.plot(halleys[20], label='Halley')
frame.plot(halleys[-1], label='Halley')
WARNING: ErfaWarning: ERFA function "epv00" yielded 1 of "warning: date outsidethe range 1900-2100 AD" [astropy._erfa.core]
[<matplotlib.lines.Line2D at 0x18e6922b9e8>, <matplotlib.lines.Line2D at 0x18e6922ba90>]
ast_db = dastcom5.asteroid_db()
comet_db = dastcom5.comet_db()
ast_db.dtype.names[:20] # They are more than 100, but that would be too much lines in this notebook :P
('NO', 'NOBS', 'OBSFRST', 'OBSLAST', 'EPOCH', 'CALEPO', 'MA', 'W', 'OM', 'IN', 'EC', 'A', 'QR', 'TP', 'TPCAL', 'TPFRAC', 'SOLDAT', 'SRC1', 'SRC2', 'SRC3')
aphelion_condition = 2 * ast_db['A'] - ast_db['QR'] < 0.983
axis_condition = ast_db['A'] < 1.3
atiras = ast_db[aphelion_condition & axis_condition]
earth = Orbit.from_body_ephem(Earth)
frame = OrbitPlotter()
frame.plot(earth, label='Earth')
for i in range(len(atiras)):
record = atiras['NO'][i]
label = atiras['ASTNAM'][i].decode().strip() # DASTCOM5 strings are binary
ss = dastcom5.orbit_from_record(record)
frame.plot(ss, label=label)
db = dastcom5.entire_db()
db[db.NAME == 'Churyumov-Gerasimenko']
NUMBER | NOBS | OBSFRST | OBSLAST | EPOCH | CALEPOCH | MA | W | OM | IN | EC | A | QR | TP | TPCAL | TPFRAC | SOLDAT | DESIG | IREF | NAME | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
738007 | 900667 | 1154 | 0 | 0 | 2440480.5 | 19690916.0 | 0.746918 | 11.246300 | 51.011000 | 7.149400 | 0.633017 | 3.501429 | 1.284965 | 2.440476e+06 | 1.969091e+07 | 0.534800 | 0.000000e+00 | 67P | SAO/1969 | Churyumov-Gerasimenko |
738008 | 900668 | 1154 | 0 | 0 | 2442880.5 | 19760412.0 | 0.713185 | 11.358700 | 51.028400 | 7.128900 | 0.630558 | 3.514828 | 1.298525 | 2.442876e+06 | 1.976041e+07 | 0.731800 | 0.000000e+00 | 67P | SAO/1976 | Churyumov-Gerasimenko |
738009 | 900669 | 1154 | 0 | 0 | 2445280.5 | 19821107.0 | 359.239635 | 11.366700 | 51.015300 | 7.117000 | 0.629152 | 3.522047 | 1.306144 | 2.445286e+06 | 1.982111e+07 | 0.599300 | 0.000000e+00 | 67P | SAO/1982 | Churyumov-Gerasimenko |
738010 | 900670 | 1154 | 0 | 0 | 2447680.5 | 19890603.0 | 357.698070 | 11.424500 | 51.011500 | 7.118300 | 0.630254 | 3.515073 | 1.299684 | 2.447696e+06 | 1.989062e+07 | 0.891800 | 0.000000e+00 | 67P | SAO/1989 | Churyumov-Gerasimenko |
738011 | 900671 | 1154 | 0 | 0 | 2450080.5 | 19951229.0 | 357.060788 | 11.386100 | 51.007000 | 7.113500 | 0.630193 | 3.515434 | 1.300032 | 2.450100e+06 | 1.996012e+07 | 0.156000 | 0.000000e+00 | 67P | SAO/1996 | Churyumov-Gerasimenko |
738012 | 900672 | 1154 | 0 | 0 | 2452520.5 | 20020903.0 | 2.354453 | 11.451400 | 50.969300 | 7.120500 | 0.631529 | 3.507299 | 1.292338 | 2.452505e+06 | 2.002082e+07 | 0.809200 | 0.000000e+00 | 67P | SAO/2002 | Churyumov-Gerasimenko |
738013 | 900673 | 6325 | 19950703 | 20170427 | 2455491.5 | 20101022.0 | 91.768086 | 12.694464 | 50.180046 | 7.043681 | 0.640582 | 3.464738 | 1.245288 | 2.454891e+06 | 2.009023e+07 | 0.027525 | 2.457882e+06 | 67P | K154/1 | Churyumov-Gerasimenko |