Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 26, 2025. It is now read-only.
/ootk-corePublic archive

🛰️Orbital Object Toolkit Core. A modern typed replacement for satellite.js including SGP4 propagation, TLE parsing, Sun and Moon calculations, and more.

License

NotificationsYou must be signed in to change notification settings

thkruz/ootk-core

Repository files navigation

SizeIssuesLicense

⚠️ ARCHIVE NOTICE⚠️

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.

📘 Table of Contents

🔧 Installation

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.

Loading the Library

import{Satellite}from'ootk-core';...constsatellite=newSatellite({tle1:line1,tle2:line2});

📡 Usage

Common Patterns

  • 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
  • Class parameters assume degrees and specify radians - Ex:sensor.az is indegrees andsensor.azRad is inradians.

Propagating a TLE

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// }

Creating a Satellite

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

Creating a Sensor

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

More examples can be found in theexamples folder of the code.

Changelog

You can find alist of changes here.

🖥️ Building

  1. InstallNode.js andNode 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

💎 NPM Scripts

  • build compiles TypeScript into ES6 Modules indist directory
  • lint lints source code located insrc directory withESLint
  • test runs jest to verify the final library remains functional

👨‍🏫 Contributing

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:

npmtest

After 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.

👨‍🔬 Contributors

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:

⚖️ License

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

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp