Giter Site home page Giter Site logo

opensky_data's Introduction

Python interface to the OpenSky Network Impala shell

Xavier Olive, 2018
MIT license

Requirements

git clone git+https://github.com/xoolive/opensky_data
cd opensky_data
pip install -r requirements

Usage

A basic script is given as an example call to the API.

Edit the settings.cfg file with your credentials for the Impala shell.

usage: opensky_data.py [-h] [-u UNTIL] [-o OUTPUT_FILE] [-c CALLSIGN]
                       [-b BOUNDS] [-s SETTINGS]
                       date

Get data from OpenSky records

positional arguments:
  date            start date for trajectories

optional arguments:
  -h, --help      show this help message and exit
  -u UNTIL        end date for trajectories (default: date + 1 day)
  -o OUTPUT_FILE  output file for trajectories (default: output.csv)
  -c CALLSIGN     callsign for one flight
  -b BOUNDS       bounding box for trajectories (location name)
  -s SETTINGS     setting file with login information

Get flight DLH66N on November 23rd 2017 (OpenSky Workshop day!):

python opensky_data.py 2017-11-23 -c DLH66N -o DLH66N.csv

Get all trajectories over (the bounding box of) Switzerland between 6am and 7am (UTC) on January 1st:

python opensky_data.py 2018-01-01T06:00 -u 2018-01-01T07:00 -b Switzerland

See an example of the API usage in notebook.ipynb.

Under the hood

Each request is split hour by hour (see indexing issues on Impala page) and put in cache in the default temporary directory of your OS. After each iteration, a pandas dataframe is created from a modified version of the cached data (robust to network issues...): all dataframes are then concatenated and exported based on the extension of the output file.

Contribution

For now, only the trajectory history use case has been addressed. Feel free to contributed with a pull request if you see any contribution that can be useful to the community.

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.