Skip to content

Commit

Permalink
first public release
Browse files Browse the repository at this point in the history
  • Loading branch information
gilgamezh committed Nov 10, 2017
0 parents commit 9ef987a
Show file tree
Hide file tree
Showing 26 changed files with 2,997 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
*.py[cod]
local_settings.py

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
__pycache__

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
nosetests.xml

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject
media
celerybeat-schedule
static

#rope
.ropeproject


# hypothesis
.hypothesis
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Satellogic SA

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
82 changes: 82 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Orbit Predictor
===============

Orbit Predictor is a Python library to propagate orbits of Earth-orbiting objects (satellites, ISS,
Santa Claus, etc) using `TLE (Two-Line Elements set) <https://en.wikipedia.org/wiki/Two-line_element_set>`_

Al the hard work is done by The Brandon Rhodes implementation of
`SGP4 <https://github.com/brandon-rhodes/python-sgp4>`_.

We can say *Orbit predictor* is kind of a "wrapper" for the python implementation of SGP4

To install it
-------------

You can install orbit-predictor from pypi::

pip install orbit-predictor # WIP

Use example
-----------

When will be the ISS over Argentina?

::

In [1]: from orbit_predictor.sources import EtcTLESource

In [2]: from orbit_predictor.locations import ARG

In [3]: source = EtcTLESource(filename="examples/iss.tle")

In [4]: predictor = source.get_predictor("ISS")

In [5]: predictor.get_next_pass(ARG)
Out[5]: <PredictedPass ISS over ARG on 2017-11-10 22:48:10.607212>

In [6]: predicted_pass = _

In [7]: position = predictor.get_position(predicted_pass.aos)

In [8]: ARG.is_visible(position) # Can I see the ISS from this location?
Out[8]: True

In [9]: import datetime

In [10]: position_delta = predictor.get_position(predicted_pass.los + datetime.timedelta(minutes=20))

In [11]: ARG.is_visible(position_delta)
Out[11]: False

In [12]: tomorrow = datetime.datetime.utcnow() + datetime.timedelta(days=1)

In [13]: predictor.get_next_pass(ARG, tomorrow, max_elevation_gt=20)
Out[13]: <PredictedPass ISS over ARG on 2017-11-11 23:31:36.878827>


`WSTLESource` needs the tle.satellogic.com service to be working. We are doing changes to have it public available.


Currently you have available these sources
------------------------------------------

- Memorytlesource: in memory storage.
- EtcTLESource: a uniq TLE is stored in `/etc/latest_tle`
- WSTLESource: It source is using the `TLE API. <http://tle.satellogics.com/api/tle/>`_


About HighAccuracyTLEPredictor
------------------------------

The default 'predictor' code is tunned to low CPU usage. (IE: a Satellite computer). The
error estimation is ~20 seconds. If you need more than that you can use the *HighAccuracyTLEPredictor*
passing `precise=True` to `get_predictor()`.


How to contribute
-----------------

- Write pep8 complaint code.
- Wrap the code on 100 collumns.
- Always use a branch for each feature and Merge Proposals.
- Always run the tests before to push. (test implies pep8 validation)
3 changes: 3 additions & 0 deletions examples/iss.tle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ISS
1 25544U 98067A 17314.40254821 .00006490 00000-0 10525-3 0 9997
2 25544 51.6429 29.4166 0004559 104.3372 354.3186 15.54111847 84492
Empty file added orbit_predictor/__init__.py
Empty file.
Loading

0 comments on commit 9ef987a

Please sign in to comment.