Coder Social home page Coder Social logo

stac-iitmandi / satellite-visualization Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 3.87 MB

A cross-platform application to calculate & view the trajectory and live position of any earth-orbiting satellite in 3D

License: MIT License

Python 93.01% GLSL 6.99%
python space-physics 3d simulation orbital-mechanics

satellite-visualization's Introduction

satellite-visualization

A cross-platform application to calculate & view the trajectory and live position of any earth-orbiting satellite in 3D.

This is developed upon a sample solution to the Atlas astro-hackathon conducted by STAC during the annual intra-college technical fest of IIT Mandi, Utkarsh, in Dec 2021 (one of the myriad possibilities, there wasn't any specific correct/expected solution).

Running the program

You can run this code on your system with an installation of Python 3.7 or newer :

  1. Clone this repository locally and cd into its folder.

     git clone https://github.com/STAC-IITMandi/satellite-visualization.git && cd satellite-visualization
    
  2. It is strongly recommended to install Kivy (one of the dependencies) in a virtual environment.
    Run python -m venv ./.venv to create a new one in a subfolder called .venv (will remain untracked due to .gitignore).

  3. Activate the venv and then install the dependencies, as listed below. All of them are installable from PyPI (pip install -r requirements.txt).

  4. Run python app.py

  5. The contents of the data/ folder will very likely be outdated. If the displayed TLE epoch in the app window is more than a week old, (or the satellite position incorrect), you can update the values as decribed in the Implementation section below. Then restart the app.

Dependencies

numpy>=1.17.0
kivy>=2.0.0
astropy>=4.3.0
jplephem>=2.15
sgp4>=2.20

Links : numpy, kivy, astropy, jplephem, sgp4

  • The [base] module of kivy is sufficient (extras/media/gstreamer and other libraries for audio or video playback are not needed)
  • jplephem is not used directly in the app, but required by astropy for part of its functionality.
  • In case you want to create an executable file from this code, following the directions for kivy apps on your target OS is sufficient. Note : there have been some issues with specific versions of astropy in the frozen/compiled form (using pyinstaller).

Other Sources -

Earth Textures - NASA Visible Earth Library

TLE Data - Celestrak NORAD database

Implementation

The app propagates the satellite's trajectory by itself, using the sgp4 library, based on the Two-Line Element Set (TLE) format as source for the orbital parameters. Theoretically, any earth-orbiting small body's orbit can be calculated, given its valid TLE.

To perform the complex transformations between the results of SGP4 propagation (position in a cartesian inertial frame of reference), and Earth-based coordinates such as Latitude/Longitude or Altitude/Azimuth, astropy is used.

Currently, the TLE sets are in static text files, which are not updated by the app. Due to gradually increasing errors, the app's predictions will become noticeably inaccurate within a few days. They must be refreshed separately, on the timescale of days (which is how often updated TLEs are usually made publicly available). This is an example to automate fetching new data from their website every alternate day :

# crontab
# m h D M W command
0 0 */2 * * curl http://celestrak.com/NORAD/elements/visual.txt > ./data/celestrak-TLEs-100brightest.txt

Finally, the GUI framework used is Kivy, which was advantageous here due to its versatility (code written in Python, can be compiled into an executable for multiple Operating Systems, even mobile & touch devices). However the 3D/OpenGL capabilities of Kivy appear not to be very well documented online and so some parts of the code seem to somehow just work magically.

Contributing

Contributions are welcome ! If you're interested in helping build this project, please do take a look at the issues to see if any improvements are in progress... Guidelines are described here. We appreciate your enthusiasm and effort, no matter whether the change is simple or complex !

satellite-visualization's People

Contributors

gd-codes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kei-seo

satellite-visualization's Issues

To Do

A list of features that are incomplete / partially implemented, for anyone interested

  • Alt/Az coordinates based on location is implemented in Satellite.get_direction_in_sky, but inaccessible through GUI
  • Satellite.get_next_visible_from method is incorrect.
  • After solving it, the Next Visible from feature should also be made accessible from GUI
  • Automatic refreshing of TLE data from APIs periodically
  • Zoom is performed only through mouse scroll input, but pinch gestures on touch devices aren't processed.
  • Shading based on light as if coming from the Sun (Day/Night halves on the Earth), instead of light at the observer/camera.
  • Also use Sun position to determine whether the satellite is currently sunlit or in Earth's shadow. When satellites like ISS are sunlit & passing over a region on the ground at night/twilight, they are visible.
  • and anything else !...

Fluency problem

Hello, I am a foreign user. I have successfully run your program, but the program is slow and does not run smoothly. What is the specific reason? The change I made was to read local de432s files instead of downloading de432s files over the Internet. Change: ac. Solar_system_ephemeris. Set (' file:///C:/Users/your_username/Downloads/de432s.bsp)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.