Git Product home page Git Product logo

node-tle's Introduction

Two-line element set (TLE)

npm npm license npm downloads build status

Two-line element set (TLE) data format parser

A two-line element set (TLE) is a data format used to convey sets of orbital elements that describe the orbits of Earth-orbiting satellites. A computer program called a model can use the TLE to compute the position of a satellite at a particular time. The TLE is a format specified by NORAD and used by NORAD and NASA. The TLE can be used directly by the SGP4 model (or one of the SGP8, SDP4, SDP8 models). Orbital elements are determined for many thousands of space objects by NORAD and are freely distributed on the Internet in the form of TLEs. A TLE consists of a title line followed by two lines of formatted text.

โ€” From Wikipedia

Install via npm

$ npm install --save tle

Format

More, detailed information is available at NASA Human Space Flight:

Some data to play around with can be found at Celestrak and in Celestrak's Master Index.

Usage

var TLE = require( 'tle' )

Parsing a single set

var set = 'ISS (ZARYA)\n' +
  '1 25544U 98067A   08264.51782528 -.00002182  00000-0 -11606-4 0  2927\n' +
  '2 25544  51.6416 247.4627 0006703 130.5360 325.0288 15.72125391563537'
var tle = TLE.parse( set )
TLE {
  name: 'ISS (ZARYA)',
  number: 25544,
  class: 'U',
  id: '98067A',
  date: Date<'2008-09-20T12:25:40.104Z'>,
  fdmm: -0.00002182,
  sdmm: 0,
  drag: -0.000011606,
  ephemeris: 0,
  esn: 292,
  inclination: 51.6416,
  ascension: 247.4627,
  eccentricity: 0.0006703,
  perigee: 130.536,
  anomaly: 325.0288,
  motion: 15.72125391,
  revolution: 56353,
}

Parsing a stream

var parser = new TLE.Parser( options ) // OR
var parser = TLE.createParser( options )
fs.createReadStream( FILEPATH )
  .pipe( new TLE.Parser() )
  .on( 'data', function( tle ) {
    // ...
  })

Creating a TLE instance from existing data

// From a JSON string
var tle = TLE.fromJSON( '{"name":"ISS (ZARYA)","number":25544,"class":"U","id":"98067A","date":"2008-09-20T12:25:40.104Z","fdmm":-0.00002182,"sdmm":0,"drag":-0.000011606,"ephemeris":0,"esn":292,"inclination":51.6416,"ascension":247.4627,"eccentricity":0.0006703,"perigee":130.536,"anomaly":325.0288,"motion":15.72125391,"revolution":56353}' )
// From an object
var tle = TLE.fromJSON({
  name: 'FENGYUN 1C DEB',
  class: 'U',
  id: '29740',
})

Speed

It can read, stream & parse ~2500 TLEs from the file system in about 100ms.

node example/fs-stream.js
Parser: 2517 TLEs, 108ms, 23306 op/s
Parser: 23 op/ms

Examples

See examples folder for runnable examples:

node examples/fs-stream.js
node examples/http-stream.js

node-tle's People

Contributors

flash716 avatar jhermsmeier avatar joeymink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-tle's Issues

Drag value is incorrect

I think you need to add a '0.' prefix to the drag term before calling 'parseFloat'.

According to the docs: (67960-4 = 0.000067960)

I'd be happy to create a PR.

Motion and Revolution are incorrect

Is this project still maintained?

I believe there is an error with the parsing for the motion and revolution properties. Per the docs and wikipedia motion is 11 columns long from columns 53-63 (1-indexed) and revolution is 5 columns long from columns 64-68 (1-indexed).

Given the ISS example of

'ISS (ZARYA)\n' +
  '1 25544U 98067A   08264.51782528 -.00002182  00000-0 -11606-4 0  2927\n' +
  '2 25544  51.6416 247.4627 0006703 130.5360 325.0288 15.72125391563537'

motion should be 15.72125391 but instead is 15.721253915
revolution should be 56353 but instead is 6353

If needed I can fork and submit a pull request for this.

Thanks.

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.