ootk
Version:
Orbital Object Toolkit including Multiple Propagators, Initial Orbit Determination, and Maneuver Calculations.
227 lines (226 loc) • 11.1 kB
TypeScript
/**
* @author @thkruz Theodore Kruczek
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
* with satellites and other orbital objects.
* @license AGPL-3.0-or-later
* @copyright (c) 2025 Kruczek Labs LLC
*
* Many of the classes are based off of the work of @david-rc-dayton and his
* Pious Squid library (https://github.com/david-rc-dayton/pious_squid) which
* is licensed under the MIT license.
*
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
* terms of the GNU Affero General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
*/
import type { ClassicalElements } from '../coordinate/index.js';
import { Geodetic } from '../coordinate/Geodetic.js';
import { ITRF } from '../coordinate/ITRF.js';
import { J2000 } from '../coordinate/J2000.js';
import { RIC } from '../coordinate/RIC.js';
import { Tle } from '../coordinate/Tle.js';
import { OptionsParams } from '../interfaces/OptionsParams.js';
import { SatelliteParams } from '../interfaces/SatelliteParams.js';
import { RAE } from '../observation/RAE.js';
import { Degrees, EcfVec3, GreenwichMeanSiderealTime, Kilometers, LlaVec3, Minutes, PosVel, RaeVec3, SatelliteRecord, TleLine1, TleLine2 } from '../types/types.js';
import { BaseObject } from './BaseObject.js';
import { GroundObject } from './GroundObject.js';
/**
* Represents a satellite object with orbital information and methods for
* calculating its position and other properties.
*/
export declare class Satellite extends BaseObject {
apogee: Kilometers;
argOfPerigee: Degrees;
bstar: number;
eccentricity: number;
epochDay: number;
epochYear: number;
inclination: Degrees;
intlDes: string;
meanAnomaly: Degrees;
meanMoDev1: number;
meanMoDev2: number;
meanMotion: number;
options: OptionsParams;
perigee: Kilometers;
period: Minutes;
rightAscension: Degrees;
satrec: SatelliteRecord;
/** The satellite catalog number as listed in the TLE. */
sccNum: string;
/** The 5 digit alpha-numeric satellite catalog number. */
sccNum5: string;
/** The 6 digit numeric satellite catalog number. */
sccNum6: string;
tle1: TleLine1;
tle2: TleLine2;
/** The semi-major axis of the satellite's orbit. */
semiMajorAxis: Kilometers;
/** The semi-minor axis of the satellite's orbit. */
semiMinorAxis: Kilometers;
constructor(info: SatelliteParams, options?: OptionsParams);
private parseTleAndUpdateOrbit_;
private parseOmmAndUpdateOrbit_;
/**
* Checks if the object is a satellite.
* @returns True if the object is a satellite, false otherwise.
*/
isSatellite(): boolean;
/**
* Returns whether the satellite is static or not.
* @returns True if the satellite is static, false otherwise.
*/
isStatic(): boolean;
/**
* Checks if the given SatelliteRecord object is valid by checking if its properties are all numbers.
* @param satrec - The SatelliteRecord object to check.
* @returns True if the SatelliteRecord object is valid, false otherwise.
*/
static isValidSatrec(satrec: SatelliteRecord): boolean;
ageOfElset(nowInput?: Date, outputUnits?: 'days' | 'hours' | 'minutes' | 'seconds'): number;
editTle(tle1: TleLine1, tle2: TleLine2, sccNum?: string): void;
/**
* Calculates the azimuth angle of the satellite relative to the given sensor at the specified date. If no date is
* provided, the current time of the satellite is used.
* @variation optimized
* @param observer - The observer's position on the ground.
* @param date - The date at which to calculate the azimuth angle. Optional, defaults to the current date.
* @returns The azimuth angle of the satellite relative to the given sensor at the specified date.
*/
az(observer: GroundObject, date?: Date): Degrees | null;
/**
* Calculates the RAE (Range, Azimuth, Elevation) values for a given sensor and date. If no date is provided, the
* current time is used.
* @variation expanded
* @param observer - The observer's position on the ground.
* @param date - The date at which to calculate the RAE values. Optional, defaults to the current date.
* @returns The RAE values for the given sensor and date.
*/
toRae(observer: GroundObject, date?: Date): RAE | null;
/**
* Calculates ECF position at a given time.
* @variation optimized
* @param date - The date at which to calculate the ECF position. Optional, defaults to the current date.
* @returns The ECF position at the specified date.
*/
ecf(date?: Date): EcfVec3<Kilometers> | null;
/**
* Calculates ECI position at a given time.
* @variation optimized
* @param date - The date at which to calculate the ECI position. Optional, defaults to the current date.
* @param j - Julian date. Optional, defaults to null.
* @param gmst - Greenwich Mean Sidereal Time. Optional, defaults to null.
* @returns The ECI position at the specified date.
*/
eci(date?: Date, j?: number, gmst?: GreenwichMeanSiderealTime): PosVel | null;
/**
* Calculates the J2000 coordinates for a given date. If no date is provided, the current time is used.
* @variation expanded
* @param date - The date for which to calculate the J2000 coordinates, defaults to the current date.
* @returns The J2000 coordinates for the specified date.
* @throws Error if propagation fails.
*/
toJ2000(date?: Date): J2000;
/**
* Returns the elevation angle of the satellite as seen by the given sensor at the specified time.
* @variation optimized
* @param observer - The observer's position on the ground.
* @param date - The date at which to calculate the elevation angle. Optional, defaults to the current date.
* @returns The elevation angle of the satellite as seen by the given sensor at the specified time.
*/
el(observer: GroundObject, date?: Date): Degrees | null;
/**
* Calculates LLA position at a given time.
* @variation optimized
* @param date - The date at which to calculate the LLA position. Optional, defaults to the current date.
* @param j - Julian date. Optional, defaults to null.
* @param gmst - Greenwich Mean Sidereal Time. Optional, defaults to null.
* @returns The LLA position at the specified date.
*/
lla(date?: Date, j?: number, gmst?: GreenwichMeanSiderealTime): LlaVec3<Degrees, Kilometers> | null;
/**
* Converts the satellite's position to geodetic coordinates.
* @variation expanded
* @param date The date for which to calculate the geodetic coordinates. Defaults to the current date.
* @returns The geodetic coordinates of the satellite.
*/
toGeodetic(date?: Date): Geodetic;
/**
* Converts the satellite's position to the International Terrestrial Reference Frame (ITRF) at the specified date.
* If no date is provided, the current date is used.
* @variation expanded
* @param date The date for which to convert the position. Defaults to the current date.
* @returns The satellite's position in the ITRF at the specified date.
*/
toITRF(date?: Date): ITRF;
/**
* Converts the current satellite's position to the Reference-Inertial-Celestial (RIC) frame
* relative to the specified reference satellite at the given date.
* @variation expanded
* @param reference The reference satellite.
* @param date The date for which to calculate the RIC frame. Defaults to the current date.
* @returns The RIC frame representing the current satellite's position relative to the reference satellite.
*/
toRIC(reference: Satellite, date?: Date): RIC;
/**
* Converts the satellite object to a TLE (Two-Line Element) object.
* @returns The TLE object representing the satellite.
*/
toTle(): Tle;
/**
* Converts the satellite's position to classical orbital elements.
* @param date The date for which to calculate the classical elements. Defaults to the current date.
* @returns The classical orbital elements of the satellite.
*/
toClassicalElements(date?: Date): ClassicalElements;
/**
* Calculates the RAE (Range, Azimuth, Elevation) vector for a given sensor and time.
* @variation optimized
* @param observer - The observer's position on the ground.
* @param date - The date at which to calculate the RAE vector. Optional, defaults to the current date.
* @param j - Julian date. Optional, defaults to null.
* @param gmst - Greenwich Mean Sidereal Time. Optional, defaults to null.
* @returns The RAE vector for the given sensor and time.
*/
rae(observer: GroundObject, date?: Date, j?: number, gmst?: GreenwichMeanSiderealTime): RaeVec3<Kilometers, Degrees> | null;
/**
* Returns the range of the satellite from the given sensor at the specified time.
* @variation optimized
* @param observer - The observer's position on the ground.
* @param date - The date at which to calculate the range. Optional, defaults to the current date.
* @returns The range of the satellite from the given sensor at the specified time.
*/
rng(observer: GroundObject, date?: Date): Kilometers | null;
/**
* Applies the Doppler effect to the given frequency based on the observer's position and the date.
* @param freq - The frequency to apply the Doppler effect to.
* @param observer - The observer's position on the ground.
* @param date - The date at which to calculate the Doppler effect. Optional, defaults to the current date.
* @returns The frequency after applying the Doppler effect.
*/
applyDoppler(freq: number, observer: GroundObject, date?: Date): number | null;
/**
* Calculates the Doppler factor for the satellite.
* @param observer The observer's ground position.
* @param date The optional date for which to calculate the Doppler factor. If not provided, the current date is used.
* @returns The calculated Doppler factor.
*/
dopplerFactor(observer: GroundObject, date?: Date): number | null;
/**
* Calculates the time variables for a given date relative to the TLE epoch.
* @param date Date to calculate
* @param satrec Satellite orbital information
* @param j Julian date
* @param gmst Greenwich Mean Sidereal Time
* @returns Time variables
*/
private static calculateTimeVariables;
}