1
0
Fork 0

Update python libraries

* Move from orbit project to satellitetle
* Move from pyephem 3.7.6.0 to ephem 3.7.7.0

Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
merge-requests/761/head
Alfredos-Panagiotis Damkalis 2019-09-15 21:53:58 +03:00
parent f80a49ed48
commit 43f8c53dcf
6 changed files with 48 additions and 56 deletions

View File

@ -1,5 +1,5 @@
from optparse import make_option
from orbit import satellite
from satellite_tle import fetch_tle_from_celestrak
from django.core.management.base import BaseCommand, CommandError
@ -28,8 +28,8 @@ class Command(BaseCommand):
raise CommandError('Satellite with Identifier {} does not exist'.format(item))
try:
sat = satellite(item)
except IndexError:
tle = fetch_tle_from_celestrak(item)
except LookupError:
raise CommandError('Satellite with Identifier {} does not exist'.format(item))
try:
@ -37,8 +37,7 @@ class Command(BaseCommand):
except Satellite.DoesNotExist:
obj = Satellite(norad_cat_id=item)
obj.name = sat.name()
tle = sat.tle()
obj.name = tle[0]
obj.tle0 = tle[0]
obj.tle1 = tle[1]
obj.tle2 = tle[2]

View File

@ -179,8 +179,8 @@ def create_station_windows(scheduled_obs, overlapped, pass_params, observer, sat
return station_windows
def next_pass(observer, satellite, issue105=False):
tr, azr, tt, altt, ts, azs = observer.next_pass(satellite)
def next_pass(observer, satellite):
tr, azr, tt, altt, ts, azs = observer.next_pass(satellite, True)
# Convert output of pyephems.next_pass into processible values
pass_start = make_aware(ephem.Date(tr).datetime(), utc)
pass_end = make_aware(ephem.Date(ts).datetime(), utc)
@ -189,18 +189,6 @@ def next_pass(observer, satellite, issue105=False):
pass_azs = float(format(math.degrees(azs), '.0f'))
pass_altitude = float(format(math.degrees(altt), '.0f'))
if ephem.Date(tr).datetime() > ephem.Date(ts).datetime():
# set time before rise time (bug in pyephem)
# https://github.com/brandon-rhodes/pyephem/issues/105
# move observer time after the current pass end
time_start_new = pass_end + timedelta(minutes=1)
observer.date = time_start_new.strftime("%Y-%m-%d %H:%M:%S.%f")
if issue105:
raise ValueError('Recursion of next_pass() due to\
https://github.com/brandon-rhodes/pyephem/issues/105')
else:
return next_pass(observer, satellite, True)
return {'rise_time': pass_start,
'set_time': pass_end,
'tca_time': pass_tca,

View File

@ -5,7 +5,7 @@ from requests.exceptions import ReadTimeout, HTTPError
import urllib2
from internetarchive import upload
from orbit import satellite
from satellite_tle import fetch_tle_from_celestrak
from django.conf import settings
from django.contrib.sites.models import Site
@ -40,13 +40,11 @@ def update_all_tle():
try:
# Fetch latest satellite TLE
sat = satellite(norad_id)
except IndexError:
tle = fetch_tle_from_celestrak(norad_id)
except LookupError:
print '{} - {}: TLE not found [error]'.format(obj.name, norad_id)
continue
tle = sat.tle()
if obj.tle and obj.tle[0].tle1 == tle[1]:
# Stored TLE is already the latest available for this satellite
print '{} - {}: TLE already exists [defer]'.format(obj.name, norad_id)

View File

@ -7,24 +7,24 @@
apipkg==1.5
atomicwrites==1.3.0
attrs==19.1.0
coverage==4.5.2
execnet==1.5.0
coverage==4.5.4
execnet==1.7.1
factory-boy==2.11.1
Faker==0.8.18
funcsigs==1.0.2
ipaddress==1.0.22
mock==2.0.0
more-itertools==5.0.0
pathlib2==2.3.3
pbr==5.1.3
pluggy==0.9.0
pur==5.2.1
packaging==19.1
pbr==5.4.3
pluggy==0.13.0
pur==5.2.2
py==1.8.0
pytest==4.3.0
pyparsing==2.4.2
pytest==4.6.5
pytest-cov==2.6.1
pytest-django==3.4.8
pytest-forked==0.2
pytest-xdist==1.25.0
python-dateutil==2.8.0
scandir==1.9.0
text-unidecode==1.2
wcwidth==0.1.7

View File

@ -3,21 +3,22 @@
# Please edit 'setup.cfg' to add top-level dependencies and use
# './contrib/refresh-requirements.sh to regenerate this file
amqp==2.4.2
amqp==2.5.1
args==0.1.0
backports.csv==1.0.6
backports.csv==1.0.7
billiard==3.5.0.5
celery==4.1.1
certifi==2018.11.29
certifi==2019.9.11
chardet==3.0.4
Click==7.0
clint==0.5.1
configparser==4.0.2
contextlib2==0.5.5
dj-database-url==0.5.0
Django==1.11.20
Django==1.11.24
django-allauth==0.35.0
django-appconf==1.0.3
django-autoslug==1.9.4
django-autoslug==1.9.6
django-avatar==4.1.0
django-braces==1.12.0
django-compressor==2.2
@ -31,41 +32,46 @@ djangorestframework==3.7.7
dnspython==1.16.0
docopt==0.6.2
enum34==1.1.6
eventlet==0.24.1
ephem==3.7.7.0
eventlet==0.25.1
greenlet==0.4.15
gunicorn==19.9.0
idna==2.8
importlib-metadata==0.23
internetarchive==1.7.7
jsonpatch==1.23
jsonpatch==1.24
jsonpointer==2.0
kombu==4.4.0
lxml==4.3.2
kombu==4.6.4
lxml==4.4.1
Markdown==2.6.11
monotonic==1.5
more-itertools==5.0.0
mysqlclient==1.3.14
oauthlib==3.0.1
orbit@git+https://gitlab.com/librespacefoundation/orbit.git@db463c2d261365485c157f2c86233aaf44e577a2
oauthlib==3.1.0
pathlib2==2.3.4
Pillow==5.0.0
pyephem==3.7.6.0
PyJWT==1.7.1
python-decouple==3.1
python-dotenv==0.6.5
python-openid==2.2.5
pytz==2018.9
pytz==2019.2
rcssmin==1.0.6
redis==3.2.0
requests==2.21.0
requests-cache==0.4.13
redis==3.3.8
requests==2.22.0
requests-oauthlib==1.2.0
rjsmin==1.0.12
schema==0.7.0
sentry-sdk==0.7.5
satellitetle==0.7.0
scandir==1.10.0
schema==0.7.1
sentry-sdk==0.7.14
sgp4==1.4
shortuuid==0.5.0
six==1.12.0
social-auth-app-django==1.2.0
social-auth-core==3.1.0
social-auth-core==3.2.0
unicode-slugify==0.1.3
Unidecode==1.0.23
Unidecode==1.1.1
Unipath==1.1
urllib3==1.24.1
vine==1.2.0
urllib3==1.25.3
vine==1.3.0
zipp==0.6.0

View File

@ -60,7 +60,8 @@ install_requires =
Markdown~=2.6.0
django-filter~=1.1.0
# Astronomy
orbit@git+https://gitlab.com/librespacefoundation/orbit.git@db463c2d261365485c157f2c86233aaf44e577a2
ephem~=3.7.7.0
satellitetle~=0.7.0
[options.extras_require]
dev =