- Notifications
You must be signed in to change notification settings - Fork5
🛰️Orbital Object Toolkit Core. A modern typed replacement for satellite.js including SGP4 propagation, TLE parsing, Sun and Moon calculations, and more.
License
thkruz/ootk-core
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This repository has been archived and is now read-only.
This library was originally split from the mainootk project to support a specific project that is no longer being worked on. Maintaining two separate libraries has created a substantial amount of work, making it difficult to properly support both libraries alongside my own projects. Going forward, all functionality is being consolidated back into the mainootk library under the AGPL license.
What this means for you:
- You can continue using this version under the MIT license
- No updates or support will be provided for this repository
- Known issues have already been fixed in the main ootk library
- For maximum functionality and ongoing support, transition toootk
This consolidation will allow me to support one library properly instead of two libraries poorly.
An Orbital Object Toolkit in Your Web Browser
ootk-core is the core libraries ofootk for doing math related to orbital objectswritten in TypeScript and built for JavaScript or TypeScript.ootk-core was developed to simplify the math and letyou focus on using the results. It is the culmination of years of fixes and improvements toother libraries.
If you would like more functionality the expandedootk library is available free under the AGPL licensehere. The full library has features for doing initial orbit determination, maneuvercalculations, and more.
Most of the functionality was originally written forKeepTrack and thenlater refactored into this library for others to use.
Install the library withNPM:
npm i ootk-core
Make sure you are using ESM modules in your package.json by setting the type to module:
{"type":"module"}Without that line in package.json you may get anError [ERR_REQUIRE_ESM]: require() of ES Module error.
import{Satellite}from'ootk-core';...constsatellite=newSatellite({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. - Changing a variable requires you to cast its units before using it as a parameters - Ex:
(3.14 * -1) as Radians - Methods starting with 'to' change the class - Ex:
satellite.toGeodetic()orsatellite.toITRF()- Methods that are optimized for loops are marked as
@variation optimized - Methods that are slower with expanded capabilities are marked as
@variation expanded
- Methods that are optimized for loops are marked as
- Class parameters assume degrees and specify radians - Ex:
sensor.azis indegreesandsensor.azRadis inradians.
import{Satellite}from'ootk-core';...constsatellite=newSatellite({tle1:line1,tle2:line2});conststate=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// }
import{Satellite}from'ootk-core';constsat=newSatellite({name:'Test', tle1, tle2});console.log(sat.intlDes);// International Designatorconsole.log(sat.epochYear);// Epoch Yearconsole.log(sat.epochDay);// Epoch Dayconsole.log(sat.meanMoDev1);// Mean Motion Deviation 1console.log(sat.meanMoDev2);// Mean Motion Deviation 2console.log(sat.bstar);// Bstar (Drag Coefficient)console.log(sat.inclination);// inclination in degreesconsole.log(sat.rightAscension);// right ascension of the ascending node in degreesconsole.log(sat.eccentricity);// eccentricityconsole.log(sat.argOfPerigee);// argument of perigee in degreesconsole.log(sat.meanAnomaly);// mean anomaly in degreesconsole.log(sat.meanMotion);// mean motion in revolutions per dayconsole.log(sat.period);// period in secondsconsole.log(sat.apogee);// apogee in kilometersconsole.log(sat.perigee);// perigee in kilometerssat.lla();// Get the satellite's position in latitude, longitude, altitude at its current timesat.eci(time);// Get the satellite's position in Earth-Centered Inertial coordinates at the given timesat.rae(sensor,time);// Get position in range, aziimuth, elevation relative to a sensor object at the given time
import{GroundPosition}from'ootk-core';constsensor=newGroundPosition({name:'Test',lat:lat,lon:lon,alt:alt});sensor.rae(sat);// Get satellite position in range, aziimuth, elevation at the sensor's current timesensor.rae(sat,time);// Get position in range, aziimuth, elevation relative to a satellite object at the given timesensor.eci()// Get the sensor's position in ECI coordinates
More examples can be found in theexamples folder of the code.
You can find alist of changes here.
InstallNode.js andNode Package Manager;
Install all required packages with NPM by running the following command from repository's root directory:
npm install
Run the following NPM script to build everything:
npm run build
buildcompiles TypeScript into ES6 Modules indistdirectorylintlints source code located insrcdirectory withESLinttestruns jest to verify the final library remains functional
This repo followsGitflow Workflow.
Before starting a work on newpull request, please, checkout your feature orbugfix branch fromdevelop branch:
git checkout developgit fetch origingit merge origin/developgit checkout -b my-feature
When you are done, make sure that your changes don't break the existing code by running:
npmtestAfter you have pushed your branch you cancreate 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 withoutthe 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 thisrepository under theMIT License. I strongly encourage you to conisder a GPL license for your own projectto keep your project free for everyone to use.Learn more here.
About
🛰️Orbital Object Toolkit Core. A modern typed replacement for satellite.js including SGP4 propagation, TLE parsing, Sun and Moon calculations, and more.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.