Orbital Object Toolkit. A modern typed replacement for satellite.js including SGP4 propagation, TLE parsing, Sun and Moon calculations, and more.
npm install ootk-core!Size


> An Orbital Object Toolkit in Your Web Browser
ootk-core is the core libraries of ootk for doing math related to orbital objects
written in TypeScript and built for JavaScript or TypeScript. ootk-core was developed to simplify the math and let
you focus on using the results. It is the culmination of years of fixes and improvements to
other libraries.
If you would like more functionality the expanded ootk library is available free under the AGPL license
here. The full library has features for doing initial orbit determination, maneuver
calculations, and more.
Most of the functionality was originally written for KeepTrack and then
later refactored into this library for others to use.
- ootk-core
- :blue\_book: Table of Contents
- :wrench: Installation
- Loading the Library
- :satellite: Usage
- Common Patterns
- Propagating a TLE
- Creating a Satellite
- Creating a Sensor
- More Examples
- Changelog
- :desktop\_computer: Building
- :gem: NPM Scripts
- :man\_teacher: Contributing
- :man\_scientist: Contributors
- :balance\_scale: License
Install the library with NPM:
``bash`
npm i ootk-core
`js`
import { Satellite } from 'ootk-core';
...
const satellite = new Satellite({
tle1: line1,
tle2: line2
});
- If you don't specify a date, the method will assume you want to use the current date/time.
- Many parameters are in shorthand - Ex: sensor.rng.(3.14 * -1) as Radians
- Changing a variable requires you to cast its units before using it as a parameters - Ex: satellite.toGeodetic()
- Methods starting with 'to' change the class - Ex: or satellite.toITRF()@variation optimized
- Methods that are optimized for loops are marked as @variation expanded
- Methods that are slower with expanded capabilities are marked as sensor.az
- Class parameters assume degrees and specify radians - Ex: is in degrees and sensor.azRad is in radians.
`js`
import { Satellite } from 'ootk-core';
...
const satellite = new Satellite({
tle1: line1,
tle2: line2
});
const state = satellite.eci();
console.log(state.position);
// {
// x: 1538.223335842895
// y: 5102.261204021967
// z: 4432.634965003577
// }
console.log(state.velocity);
// {
// x: -4.26262363267920
// y: 0.159169020320195
// z: 1.502351885030190
// }
`js
import { Satellite } from 'ootk-core';
const sat = new Satellite({ name: 'Test', tle1, tle2 });
console.log(sat.intlDes); // International Designator
console.log(sat.epochYear); // Epoch Year
console.log(sat.epochDay); // Epoch Day
console.log(sat.meanMoDev1); // Mean Motion Deviation 1
console.log(sat.meanMoDev2); // Mean Motion Deviation 2
console.log(sat.bstar); // Bstar (Drag Coefficient)
console.log(sat.inclination); // inclination in degrees
console.log(sat.rightAscension); // right ascension of the ascending node in degrees
console.log(sat.eccentricity); // eccentricity
console.log(sat.argOfPerigee); // argument of perigee in degrees
console.log(sat.meanAnomaly); // mean anomaly in degrees
console.log(sat.meanMotion); // mean motion in revolutions per day
console.log(sat.period); // period in seconds
console.log(sat.apogee); // apogee in kilometers
console.log(sat.perigee); // perigee in kilometers
sat.lla(); // Get the satellite's position in latitude, longitude, altitude at its current time
sat.eci(time); // Get the satellite's position in Earth-Centered Inertial coordinates at the given time
sat.rae(sensor, time); // Get position in range, aziimuth, elevation relative to a sensor object at the given time
`
`js
import { GroundPosition } from 'ootk-core';
const sensor = new GroundPosition({ name: 'Test', lat: lat, lon: lon, alt: alt });
sensor.rae(sat); // Get satellite position in range, aziimuth, elevation at the sensor's current time
sensor.rae(sat, time); // Get position in range, aziimuth, elevation relative to a satellite object at the given time
sensor.eci() // Get the sensor's position in ECI coordinates
`
More examples can be found in the examples folder of the code.
You can find a list of changes here.
1. Install Node.js and Node Package Manager;
2. Install all required packages with NPM by running the following command from repository's root directory:
`bash`
npm install
3. Run the following NPM script to build everything:
`bash`
npm run build
- build compiles TypeScript into ES6 Modules in dist directorylint
- lints source code located in src directory with ESLinttest
- runs jest to verify the final library remains functional
This repo follows Gitflow Workflow.
Before starting a work on new pull request, please, checkout your feature or
bugfix branch from develop branch:
`bash`
git checkout develop
git fetch origin
git merge origin/develop
git checkout -b my-feature
When you are done, make sure that your changes don't break the existing code by running:
`bash``
npm test
After you have pushed your branch you can create a pull request here.
If you need help, just open an issue and I'll happily walk you through the process.
This whole project is an example of standing on the shoulder's of giants. None of it would have been possible without
the previous work of the following:
- @ezze (Dmitriy Pushkov)
- @david-rc-dayton (David RC Dayton)
- @davidcalhoun (David Calhoun)
- @shashwatak (Shashwat Kandadai)
- @brandon-rhodes (Brandon Rhodes)
- @mourner (Volodymyr Agafonkin)
- @Hypnos (Robert Gester)
In order to maximize the usabiltiy of the core modules of ootk with other projects I support, I have placed this
repository under the MIT License. I strongly encourage you to conisder a GPL license for your own project
to keep your project free for everyone to use. Learn more here.