4.0.0 • Published 1 month ago

ootk v4.0.0

Weekly downloads
28
License
APGL-3.0
Repository
github
Last release
1 month ago

ootk

build Size Release Issues Coverage License

An Orbital Object Toolkit in Your Web Browser

ootk is a collection libraries for doing math related to orbital objects written in TypeScript. ootk was developed to simplify the math and let you focus on using the results.

Most of the functionality was originally written for KeepTrack and then later refactored into this library for others to use.

:blue_book: Table of Contents

:wrench: Installation

Install the library with NPM:

npm i ootk

Loading the Library

import { Sgp4, Satellite } from 'ootk';
...
const satrec = Sgp4.createSatrec(line1, line2, 'wgs72', 'i');

:satellite: Usage

Propagating a TLE

const satrec = Sgp4.createSatrec(line1, line2);
const state = Sgp4.propagate(satrec, time);
console.log(state.position); // [x, y, z]
console.log(state.velocity); // [vx, vy, vz]

Creating a Satellite

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.raan); // 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.propagate(time); // Propagate the satellite to the given time
sat.getLla(); // Get the satellite's position in latitude, longitude, altitude at its current time
sat.getEci(time); // Get the satellite's position in Earth-Centered Inertial coordinates at the given time without changing its state
sat.getRae(sensor, time); // Get position in range, aziimuth, elevation relative to a sensor object at the given time without changing its state

Creating a Sensor

const sensor = new Ootk.Sensor({ name: 'Test', lat: lat, lon: lon, alt: alt });
sensor.setTime(time); // Set the sensor's time to the given time
sensor.getRae(sat); // Get satellite position in range, aziimuth, elevation at the sensor's current time
sensor.getRae(sat, time); // Get position in range, aziimuth, elevation relative to a satellite object at the given time without changing its state

:desktop_computer: Building

  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:

    npm install
  3. Run the following NPM script to build everything:

    npm run build

:gem: NPM Scripts

  • build compiles TypeScript into ES6 Modules and combines them into a single file in the dist directory.
  • lint lints source code located in src directory with ESLint
  • lint:fix lints tests located in src directory with ESLint and attempts to auto-fix errors
  • lint:test lints tests located in test directory with ESLint
  • test runs jest to verify code remains functional
  • test:coverage generates lcov report to view code coverage

:man_teacher: Contributing

This repo follows Gitflow Workflow.

Before starting a work on new pull request, please, checkout your feature or bugfix branch from develop branch:

git checkout develop
git fetch origin
git merge origin/develop
git checkout -b my-feature

Make sure that your changes don't break the existing code by running:

npm test

Check that your code follows the rules established in eslint.rc:

npm run lint

:man_scientist: Contributors

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:

:balance_scale: License

I have placed the code under the AGPL License in order to ensure that good ideas can be shared and that the code is open for everyone to use. Learn more here.

4.0.0

1 month ago

4.0.0-17

1 month ago

4.0.0-14

1 month ago

4.0.0-15

1 month ago

4.0.0-16

1 month ago

4.0.0-13

1 month ago

4.0.0-10

2 months ago

4.0.0-11

2 months ago

4.0.0-12

2 months ago

4.0.0-9

3 months ago

4.0.0-8

3 months ago

4.0.0-7

3 months ago

4.0.0-5

4 months ago

4.0.0-6

4 months ago

4.0.0-3

4 months ago

4.0.0-4

4 months ago

4.0.0-2

4 months ago

4.0.0-1

4 months ago

4.0.0-0

4 months ago

3.0.0

8 months ago

2.0.1

12 months ago

2.0.0

12 months ago

1.6.4

2 years ago

1.8.1

2 years ago

1.6.3

2 years ago

1.8.0

2 years ago

1.6.2

2 years ago

1.7.0

2 years ago

1.6.1

2 years ago

1.2.0

2 years ago

1.5.4

2 years ago

1.5.3

2 years ago

1.0.8

2 years ago

1.5.2

2 years ago

1.0.7

2 years ago

1.6.0

2 years ago

1.5.1

2 years ago

1.0.6

2 years ago

1.5.0

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.0-alpha1

3 years ago

1.0.0-alpha2

3 years ago

1.0.0-alpha3

3 years ago

0.5.0

3 years ago