ootk 5.1.0 → 6.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/PROMPT.md +13 -0
- package/.claude/hooks/post-tool-use.ts +33 -0
- package/.claude/hooks/user-prompt-submit.ts +138 -0
- package/.claude/settings.local.json +13 -0
- package/.claude/skill-rules.json +11 -0
- package/.claude/skills/ootk-dev/SKILL.md +16 -0
- package/ADVANCED_FEATURES_GUIDE.md +1025 -0
- package/CHANGELOG.md +42 -3
- package/README.md +77 -45
- package/dist/body/Celestial.d.ts +2 -2
- package/dist/body/Celestial.js +2 -2
- package/dist/body/Celestial.js.map +1 -1
- package/dist/body/Earth.d.ts +4 -4
- package/dist/body/Earth.js +2 -2
- package/dist/body/Earth.js.map +1 -1
- package/dist/body/Moon.d.ts +3 -3
- package/dist/body/Moon.js +7 -7
- package/dist/body/Moon.js.map +1 -1
- package/dist/body/NutationAngles.d.ts +2 -2
- package/dist/body/NutationAngles.js +1 -1
- package/dist/body/PrecessionAngles.d.ts +2 -2
- package/dist/body/PrecessionAngles.js +1 -1
- package/dist/body/Sun.d.ts +2 -2
- package/dist/body/Sun.js +3 -3
- package/dist/body/Sun.js.map +1 -1
- package/dist/body/index.d.ts +5 -5
- package/dist/body/index.js +5 -5
- package/dist/body/index.js.map +1 -1
- package/dist/conjunction/ConjunctionAssessment.d.ts +156 -0
- package/dist/conjunction/ConjunctionAssessment.js +281 -0
- package/dist/conjunction/ConjunctionAssessment.js.map +1 -0
- package/dist/conjunction/ConjunctionEvent.d.ts +104 -0
- package/dist/conjunction/ConjunctionEvent.js +156 -0
- package/dist/conjunction/ConjunctionEvent.js.map +1 -0
- package/dist/conjunction/ProbabilityOfCollision.d.ts +102 -0
- package/dist/conjunction/ProbabilityOfCollision.js +240 -0
- package/dist/conjunction/ProbabilityOfCollision.js.map +1 -0
- package/dist/conjunction/index.d.ts +19 -0
- package/dist/conjunction/index.js +20 -0
- package/dist/conjunction/index.js.map +1 -0
- package/dist/coordinate/ClassicalElements.d.ts +7 -7
- package/dist/coordinate/ClassicalElements.js +7 -7
- package/dist/coordinate/ClassicalElements.js.map +1 -1
- package/dist/coordinate/EquinoctialElements.d.ts +5 -5
- package/dist/coordinate/EquinoctialElements.js +4 -4
- package/dist/coordinate/EquinoctialElements.js.map +1 -1
- package/dist/coordinate/FormatTle.d.ts +2 -2
- package/dist/coordinate/FormatTle.js +2 -2
- package/dist/coordinate/FormatTle.js.map +1 -1
- package/dist/coordinate/Geodetic.d.ts +4 -4
- package/dist/coordinate/Geodetic.js +7 -7
- package/dist/coordinate/Geodetic.js.map +1 -1
- package/dist/coordinate/Hill.d.ts +4 -4
- package/dist/coordinate/Hill.js +3 -3
- package/dist/coordinate/Hill.js.map +1 -1
- package/dist/coordinate/ITRF.d.ts +5 -5
- package/dist/coordinate/ITRF.js +6 -5
- package/dist/coordinate/ITRF.js.map +1 -1
- package/dist/coordinate/J2000.d.ts +5 -5
- package/dist/coordinate/J2000.js +5 -5
- package/dist/coordinate/J2000.js.map +1 -1
- package/dist/coordinate/RIC.d.ts +4 -4
- package/dist/coordinate/RIC.js +3 -3
- package/dist/coordinate/RIC.js.map +1 -1
- package/dist/coordinate/RelativeState.d.ts +5 -5
- package/dist/coordinate/RelativeState.js +2 -2
- package/dist/coordinate/RelativeState.js.map +1 -1
- package/dist/coordinate/StateVector.d.ts +2 -2
- package/dist/coordinate/StateVector.js +2 -2
- package/dist/coordinate/StateVector.js.map +1 -1
- package/dist/coordinate/TEME.d.ts +4 -4
- package/dist/coordinate/TEME.js +4 -4
- package/dist/coordinate/TEME.js.map +1 -1
- package/dist/coordinate/Tle.d.ts +5 -5
- package/dist/coordinate/Tle.js +9 -9
- package/dist/coordinate/Tle.js.map +1 -1
- package/dist/coordinate/index.d.ts +12 -12
- package/dist/coordinate/index.js +12 -12
- package/dist/coordinate/index.js.map +1 -1
- package/dist/coordinate/tle-format-data.d.ts +1 -1
- package/dist/coordinate/tle-format-data.js +1 -1
- package/dist/covariance/CovarianceSample.d.ts +5 -5
- package/dist/covariance/CovarianceSample.js +5 -5
- package/dist/covariance/CovarianceSample.js.map +1 -1
- package/dist/covariance/StateCovariance.d.ts +2 -2
- package/dist/covariance/StateCovariance.js +2 -2
- package/dist/covariance/StateCovariance.js.map +1 -1
- package/dist/covariance/index.d.ts +2 -2
- package/dist/covariance/index.js +2 -2
- package/dist/covariance/index.js.map +1 -1
- package/dist/data/DataHandler.d.ts +4 -4
- package/dist/data/DataHandler.js +5 -5
- package/dist/data/DataHandler.js.map +1 -1
- package/dist/data/values/Egm96Data.d.ts +1 -1
- package/dist/data/values/Egm96Data.js +3 -3
- package/dist/data/values/Egm96Data.js.map +1 -1
- package/dist/data/values/HpAtmosphereData.d.ts +2 -2
- package/dist/data/values/HpAtmosphereData.js +3 -3
- package/dist/data/values/HpAtmosphereData.js.map +1 -1
- package/dist/data/values/HpAtmosphereResult.d.ts +2 -2
- package/dist/data/values/HpAtmosphereResult.js +1 -1
- package/dist/data/values/Iau1980Data.d.ts +1 -1
- package/dist/data/values/Iau1980Data.js +2 -2
- package/dist/data/values/Iau1980Data.js.map +1 -1
- package/dist/data/values/LeapSecond.d.ts +1 -1
- package/dist/data/values/LeapSecond.js +1 -1
- package/dist/data/values/LeapSecondData.d.ts +2 -2
- package/dist/data/values/LeapSecondData.js +2 -2
- package/dist/data/values/LeapSecondData.js.map +1 -1
- package/dist/data/values/egm96.d.ts +2 -2
- package/dist/data/values/egm96.js +1 -1
- package/dist/data/values/hpAtmosphere.d.ts +2 -2
- package/dist/data/values/hpAtmosphere.js +1 -1
- package/dist/data/values/iau1980.d.ts +2 -2
- package/dist/data/values/iau1980.js +1 -1
- package/dist/enums/AngularDiameterMethod.d.ts +1 -1
- package/dist/enums/AngularDiameterMethod.js +1 -1
- package/dist/enums/AngularDistanceMethod.d.ts +1 -1
- package/dist/enums/AngularDistanceMethod.js +1 -1
- package/dist/enums/OrbitRegime.d.ts +1 -1
- package/dist/enums/OrbitRegime.js +1 -1
- package/dist/enums/PassType.d.ts +1 -1
- package/dist/enums/PassType.js +1 -1
- package/dist/enums/Sgp4OpsMode.d.ts +1 -1
- package/dist/enums/Sgp4OpsMode.js +1 -1
- package/dist/enums/index.d.ts +7 -7
- package/dist/enums/index.js +7 -7
- package/dist/enums/index.js.map +1 -1
- package/dist/fetch/horizons-constants.d.ts +43 -0
- package/dist/fetch/horizons-constants.js +50 -0
- package/dist/fetch/horizons-constants.js.map +1 -0
- package/dist/fetch/horizons-interfaces.d.ts +37 -0
- package/dist/fetch/horizons-interfaces.js +2 -0
- package/dist/fetch/horizons-interfaces.js.map +1 -0
- package/dist/fetch/horizons.d.ts +86 -0
- package/dist/fetch/horizons.js +237 -0
- package/dist/fetch/horizons.js.map +1 -0
- package/dist/force/AtmosphericDrag.d.ts +3 -3
- package/dist/force/AtmosphericDrag.js +2 -2
- package/dist/force/AtmosphericDrag.js.map +1 -1
- package/dist/force/EarthGravity.d.ts +3 -3
- package/dist/force/EarthGravity.js +2 -2
- package/dist/force/EarthGravity.js.map +1 -1
- package/dist/force/Force.d.ts +3 -3
- package/dist/force/Force.js +1 -10
- package/dist/force/Force.js.map +1 -1
- package/dist/force/ForceModel.d.ts +3 -3
- package/dist/force/ForceModel.js +7 -7
- package/dist/force/ForceModel.js.map +1 -1
- package/dist/force/Gravity.d.ts +3 -3
- package/dist/force/Gravity.js +2 -2
- package/dist/force/Gravity.js.map +1 -1
- package/dist/force/SolarRadiationPressure.d.ts +3 -3
- package/dist/force/SolarRadiationPressure.js +4 -4
- package/dist/force/SolarRadiationPressure.js.map +1 -1
- package/dist/force/ThirdBodyGravity.d.ts +3 -3
- package/dist/force/ThirdBodyGravity.js +2 -2
- package/dist/force/ThirdBodyGravity.js.map +1 -1
- package/dist/force/Thrust.d.ts +3 -3
- package/dist/force/Thrust.js +2 -2
- package/dist/force/Thrust.js.map +1 -1
- package/dist/force/index.d.ts +1 -1
- package/dist/force/index.js +1 -1
- package/dist/force/index.js.map +1 -1
- package/dist/interfaces/BaseObjectParams.d.ts +2 -2
- package/dist/interfaces/BaseObjectParams.js +1 -1
- package/dist/interfaces/ClassicalElementsParams.d.ts +2 -2
- package/dist/interfaces/ClassicalElementsParams.js +1 -1
- package/dist/interfaces/EquinoctialElementsParams.d.ts +2 -2
- package/dist/interfaces/EquinoctialElementsParams.js +1 -1
- package/dist/interfaces/GroundPositionParams.d.ts +2 -2
- package/dist/interfaces/GroundPositionParams.js +1 -1
- package/dist/interfaces/RfSensorParams.d.ts +2 -2
- package/dist/interfaces/SatelliteParams.d.ts +2 -2
- package/dist/interfaces/SensorParams.d.ts +2 -2
- package/dist/interfaces/StarObjectParams.d.ts +1 -1
- package/dist/interfaces/TimeVariables.d.ts +1 -1
- package/dist/interfaces/index.d.ts +9 -9
- package/dist/interpolator/ChebyshevCoefficients.d.ts +2 -2
- package/dist/interpolator/ChebyshevCoefficients.js +2 -2
- package/dist/interpolator/ChebyshevCoefficients.js.map +1 -1
- package/dist/interpolator/ChebyshevInterpolator.d.ts +4 -4
- package/dist/interpolator/ChebyshevInterpolator.js +3 -3
- package/dist/interpolator/ChebyshevInterpolator.js.map +1 -1
- package/dist/interpolator/CubicSpline.d.ts +2 -2
- package/dist/interpolator/CubicSpline.js +1 -1
- package/dist/interpolator/CubicSplineInterpolator.d.ts +4 -4
- package/dist/interpolator/CubicSplineInterpolator.js +4 -4
- package/dist/interpolator/CubicSplineInterpolator.js.map +1 -1
- package/dist/interpolator/FieldInterpolator.d.ts +3 -3
- package/dist/interpolator/FieldInterpolator.js +2 -12
- package/dist/interpolator/FieldInterpolator.js.map +1 -1
- package/dist/interpolator/Interpolator.d.ts +2 -2
- package/dist/interpolator/Interpolator.js +2 -2
- package/dist/interpolator/Interpolator.js.map +1 -1
- package/dist/interpolator/LagrangeInterpolator.d.ts +3 -3
- package/dist/interpolator/LagrangeInterpolator.js +3 -3
- package/dist/interpolator/LagrangeInterpolator.js.map +1 -1
- package/dist/interpolator/StateInterpolator.d.ts +4 -4
- package/dist/interpolator/StateInterpolator.js +2 -10
- package/dist/interpolator/StateInterpolator.js.map +1 -1
- package/dist/interpolator/VerletBlendInterpolator.d.ts +5 -5
- package/dist/interpolator/VerletBlendInterpolator.js +5 -5
- package/dist/interpolator/VerletBlendInterpolator.js.map +1 -1
- package/dist/main.d.ts +20 -20
- package/dist/main.js +21 -20
- package/dist/main.js.map +1 -1
- package/dist/maneuver/TwoBurnOrbitTransfer.d.ts +3 -3
- package/dist/maneuver/TwoBurnOrbitTransfer.js +3 -3
- package/dist/maneuver/TwoBurnOrbitTransfer.js.map +1 -1
- package/dist/maneuver/Waypoint.d.ts +5 -5
- package/dist/maneuver/Waypoint.js +7 -7
- package/dist/maneuver/Waypoint.js.map +1 -1
- package/dist/objects/BaseObject.d.ts +3 -3
- package/dist/objects/BaseObject.js +2 -2
- package/dist/objects/BaseObject.js.map +1 -1
- package/dist/objects/DetailedSatellite.d.ts +4 -4
- package/dist/objects/DetailedSatellite.js +4 -4
- package/dist/objects/DetailedSatellite.js.map +1 -1
- package/dist/objects/DetailedSensor.d.ts +5 -5
- package/dist/objects/DetailedSensor.js +2 -2
- package/dist/objects/DetailedSensor.js.map +1 -1
- package/dist/objects/GroundObject.d.ts +4 -4
- package/dist/objects/GroundObject.js +3 -3
- package/dist/objects/GroundObject.js.map +1 -1
- package/dist/objects/LandObject.d.ts +3 -3
- package/dist/objects/LandObject.js +2 -2
- package/dist/objects/LandObject.js.map +1 -1
- package/dist/objects/Marker.d.ts +2 -2
- package/dist/objects/Marker.js +2 -2
- package/dist/objects/Marker.js.map +1 -1
- package/dist/objects/RfSensor.d.ts +2 -2
- package/dist/objects/RfSensor.js +2 -2
- package/dist/objects/RfSensor.js.map +1 -1
- package/dist/objects/Satellite.d.ts +12 -12
- package/dist/objects/Satellite.js +14 -14
- package/dist/objects/Satellite.js.map +1 -1
- package/dist/objects/Sensor.d.ts +6 -6
- package/dist/objects/Sensor.js +5 -5
- package/dist/objects/Sensor.js.map +1 -1
- package/dist/objects/Star.d.ts +3 -3
- package/dist/objects/Star.js +3 -3
- package/dist/objects/Star.js.map +1 -1
- package/dist/objects/index.d.ts +10 -10
- package/dist/objects/index.js +10 -10
- package/dist/objects/index.js.map +1 -1
- package/dist/observation/Observation.d.ts +11 -11
- package/dist/observation/Observation.js +1 -52
- package/dist/observation/Observation.js.map +1 -1
- package/dist/observation/ObservationOptical.d.ts +6 -6
- package/dist/observation/ObservationOptical.js +4 -4
- package/dist/observation/ObservationOptical.js.map +1 -1
- package/dist/observation/ObservationRadar.d.ts +6 -6
- package/dist/observation/ObservationRadar.js +4 -4
- package/dist/observation/ObservationRadar.js.map +1 -1
- package/dist/observation/ObservationUtils.d.ts +2 -2
- package/dist/observation/ObservationUtils.js +2 -2
- package/dist/observation/ObservationUtils.js.map +1 -1
- package/dist/observation/PropagatorPairs.d.ts +2 -2
- package/dist/observation/PropagatorPairs.js +1 -1
- package/dist/observation/RAE.d.ts +6 -6
- package/dist/observation/RAE.js +6 -6
- package/dist/observation/RAE.js.map +1 -1
- package/dist/observation/RadecGeocentric.d.ts +6 -6
- package/dist/observation/RadecGeocentric.js +5 -5
- package/dist/observation/RadecGeocentric.js.map +1 -1
- package/dist/observation/RadecTopocentric.d.ts +6 -6
- package/dist/observation/RadecTopocentric.js +9 -7
- package/dist/observation/RadecTopocentric.js.map +1 -1
- package/dist/observation/index.d.ts +5 -5
- package/dist/observation/index.js +5 -5
- package/dist/observation/index.js.map +1 -1
- package/dist/operations/BoxMuller.d.ts +2 -2
- package/dist/operations/BoxMuller.js +2 -2
- package/dist/operations/BoxMuller.js.map +1 -1
- package/dist/operations/EulerAngles.d.ts +2 -2
- package/dist/operations/EulerAngles.js +2 -2
- package/dist/operations/EulerAngles.js.map +1 -1
- package/dist/operations/Matrix.d.ts +2 -2
- package/dist/operations/Matrix.js +2 -2
- package/dist/operations/Matrix.js.map +1 -1
- package/dist/operations/Quaternion.d.ts +2 -2
- package/dist/operations/Quaternion.js +2 -2
- package/dist/operations/Quaternion.js.map +1 -1
- package/dist/operations/Random.d.ts +1 -1
- package/dist/operations/Random.js +1 -1
- package/dist/operations/RandomGaussianSource.d.ts +2 -2
- package/dist/operations/RandomGaussianSource.js +3 -3
- package/dist/operations/RandomGaussianSource.js.map +1 -1
- package/dist/operations/Vector.d.ts +2 -2
- package/dist/operations/Vector.js +2 -2
- package/dist/operations/Vector.js.map +1 -1
- package/dist/operations/Vector3D.d.ts +5 -4
- package/dist/operations/Vector3D.js +5 -4
- package/dist/operations/Vector3D.js.map +1 -1
- package/dist/operations/index.d.ts +4 -4
- package/dist/operations/index.js +4 -4
- package/dist/operations/index.js.map +1 -1
- package/dist/operations/operations.d.ts +5 -5
- package/dist/operations/operations.js +5 -5
- package/dist/operations/operations.js.map +1 -1
- package/dist/optimize/ChebyshevCompressor.d.ts +3 -3
- package/dist/optimize/ChebyshevCompressor.js +4 -4
- package/dist/optimize/ChebyshevCompressor.js.map +1 -1
- package/dist/optimize/DownhillSimplex.d.ts +2 -2
- package/dist/optimize/DownhillSimplex.js +2 -2
- package/dist/optimize/DownhillSimplex.js.map +1 -1
- package/dist/optimize/GoldenSection.d.ts +2 -2
- package/dist/optimize/GoldenSection.js +1 -1
- package/dist/optimize/PolynomialRegression.d.ts +2 -2
- package/dist/optimize/PolynomialRegression.js +4 -4
- package/dist/optimize/PolynomialRegression.js.map +1 -1
- package/dist/optimize/PolynomicalRegressionResult.d.ts +1 -1
- package/dist/optimize/PolynomicalRegressionResult.js +1 -1
- package/dist/optimize/SimpleLinearRegression.d.ts +1 -1
- package/dist/optimize/SimpleLinearRegression.js +1 -1
- package/dist/optimize/SimplexEntry.d.ts +1 -1
- package/dist/optimize/SimplexEntry.js +2 -2
- package/dist/optimize/SimplexEntry.js.map +1 -1
- package/dist/orbit_determination/BatchLeastSquaresOD.d.ts +5 -5
- package/dist/orbit_determination/BatchLeastSquaresOD.js +8 -8
- package/dist/orbit_determination/BatchLeastSquaresOD.js.map +1 -1
- package/dist/orbit_determination/BatchLeastSquaresResult.d.ts +3 -3
- package/dist/orbit_determination/BatchLeastSquaresResult.js +1 -1
- package/dist/orbit_determination/GaussIOD.d.ts +98 -0
- package/dist/orbit_determination/GaussIOD.js +291 -0
- package/dist/orbit_determination/GaussIOD.js.map +1 -0
- package/dist/orbit_determination/GibbsIOD.d.ts +2 -2
- package/dist/orbit_determination/GibbsIOD.js +4 -4
- package/dist/orbit_determination/GibbsIOD.js.map +1 -1
- package/dist/orbit_determination/GoodingIOD.d.ts +58 -8
- package/dist/orbit_determination/GoodingIOD.js +225 -35
- package/dist/orbit_determination/GoodingIOD.js.map +1 -1
- package/dist/orbit_determination/HerrickGibbsIOD.d.ts +2 -2
- package/dist/orbit_determination/HerrickGibbsIOD.js +2 -2
- package/dist/orbit_determination/HerrickGibbsIOD.js.map +1 -1
- package/dist/orbit_determination/LambertIOD.d.ts +2 -2
- package/dist/orbit_determination/LambertIOD.js +2 -2
- package/dist/orbit_determination/LambertIOD.js.map +1 -1
- package/dist/orbit_determination/ModifiedGoodingIOD.d.ts +3 -3
- package/dist/orbit_determination/ModifiedGoodingIOD.js +8 -8
- package/dist/orbit_determination/ModifiedGoodingIOD.js.map +1 -1
- package/dist/orbit_determination/index.d.ts +7 -7
- package/dist/orbit_determination/index.js +7 -7
- package/dist/orbit_determination/index.js.map +1 -1
- package/dist/propagator/DormandPrince54Propagator.d.ts +2 -2
- package/dist/propagator/DormandPrince54Propagator.js +2 -2
- package/dist/propagator/DormandPrince54Propagator.js.map +1 -1
- package/dist/propagator/KeplerPropagator.d.ts +6 -6
- package/dist/propagator/KeplerPropagator.js +6 -7
- package/dist/propagator/KeplerPropagator.js.map +1 -1
- package/dist/propagator/Propagator.d.ts +5 -5
- package/dist/propagator/Propagator.js +5 -5
- package/dist/propagator/Propagator.js.map +1 -1
- package/dist/propagator/RkCheckpoint.d.ts +2 -2
- package/dist/propagator/RkCheckpoint.js +1 -1
- package/dist/propagator/RkResult.d.ts +2 -2
- package/dist/propagator/RkResult.js +1 -1
- package/dist/propagator/RungeKutta4Propagator.d.ts +6 -6
- package/dist/propagator/RungeKutta4Propagator.js +5 -5
- package/dist/propagator/RungeKutta4Propagator.js.map +1 -1
- package/dist/propagator/RungeKutta89Propagator.d.ts +2 -2
- package/dist/propagator/RungeKutta89Propagator.js +2 -2
- package/dist/propagator/RungeKutta89Propagator.js.map +1 -1
- package/dist/propagator/RungeKuttaAdaptive.d.ts +6 -6
- package/dist/propagator/RungeKuttaAdaptive.js +52 -9
- package/dist/propagator/RungeKuttaAdaptive.js.map +1 -1
- package/dist/propagator/Sgp4Propagator.d.ts +7 -7
- package/dist/propagator/Sgp4Propagator.js +4 -4
- package/dist/propagator/Sgp4Propagator.js.map +1 -1
- package/dist/propagator/index.d.ts +3 -3
- package/dist/propagator/index.js +3 -3
- package/dist/propagator/index.js.map +1 -1
- package/dist/sgp4/index.d.ts +2 -2
- package/dist/sgp4/index.js +2 -2
- package/dist/sgp4/index.js.map +1 -1
- package/dist/sgp4/sgp4.d.ts +3 -3
- package/dist/sgp4/sgp4.js +11 -5
- package/dist/sgp4/sgp4.js.map +1 -1
- package/dist/smoothing/ExponentialSmoothing.d.ts +2 -2
- package/dist/smoothing/ExponentialSmoothing.js +1 -1
- package/dist/time/Epoch.d.ts +2 -2
- package/dist/time/Epoch.js +2 -2
- package/dist/time/Epoch.js.map +1 -1
- package/dist/time/EpochGPS.d.ts +3 -3
- package/dist/time/EpochGPS.js +3 -3
- package/dist/time/EpochGPS.js.map +1 -1
- package/dist/time/EpochTAI.d.ts +2 -2
- package/dist/time/EpochTAI.js +2 -2
- package/dist/time/EpochTAI.js.map +1 -1
- package/dist/time/EpochTDB.d.ts +2 -2
- package/dist/time/EpochTDB.js +2 -2
- package/dist/time/EpochTDB.js.map +1 -1
- package/dist/time/EpochTT.d.ts +2 -2
- package/dist/time/EpochTT.js +2 -2
- package/dist/time/EpochTT.js.map +1 -1
- package/dist/time/EpochUTC.d.ts +7 -7
- package/dist/time/EpochUTC.js +9 -9
- package/dist/time/EpochUTC.js.map +1 -1
- package/dist/time/EpochWindow.d.ts +2 -2
- package/dist/time/EpochWindow.js +1 -1
- package/dist/time/TimeStamped.d.ts +2 -2
- package/dist/time/TimeStamped.js +1 -1
- package/dist/time/index.d.ts +8 -8
- package/dist/time/index.js +8 -8
- package/dist/time/index.js.map +1 -1
- package/dist/transforms/TransformCache.d.ts +1 -1
- package/dist/transforms/TransformCache.js +1 -1
- package/dist/transforms/conversions.d.ts +2 -2
- package/dist/transforms/conversions.js +2 -2
- package/dist/transforms/conversions.js.map +1 -1
- package/dist/transforms/index.d.ts +2 -2
- package/dist/transforms/index.js +2 -2
- package/dist/transforms/index.js.map +1 -1
- package/dist/transforms/transforms.d.ts +1 -1
- package/dist/transforms/transforms.js +1 -1
- package/dist/transforms/transforms.js.map +1 -1
- package/dist/types/types.d.ts +8 -3
- package/dist/types/types.js +6 -1
- package/dist/types/types.js.map +1 -1
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.js +1 -1
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/create-covariance-from-tle.d.ts +1 -1
- package/dist/utils/create-covariance-from-tle.js +1 -1
- package/dist/utils/create-covariance-from-tle.js.map +1 -1
- package/dist/utils/functions.d.ts +4 -4
- package/dist/utils/functions.js +9 -4
- package/dist/utils/functions.js.map +1 -1
- package/dist/utils/index.d.ts +5 -5
- package/dist/utils/index.js +5 -5
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/jacobian.d.ts +2 -2
- package/dist/utils/jacobian.js +1 -1
- package/dist/utils/jacobian.js.map +1 -1
- package/dist/utils/linearDistance.d.ts +1 -1
- package/docs/README.md +132 -0
- package/docs/getting-started.md +792 -0
- package/docs/lambert-satellite-integration-guide.md +766 -0
- package/docs/user-guide.md +1935 -0
- package/jest.config.mjs +28 -0
- package/package.json +3 -4
- package/src/body/Celestial.ts +2 -2
- package/src/body/Earth.ts +4 -4
- package/src/body/Moon.ts +7 -7
- package/src/body/NutationAngles.ts +2 -2
- package/src/body/PrecessionAngles.ts +2 -2
- package/src/body/Sun.ts +4 -4
- package/src/body/index.ts +6 -5
- package/src/conjunction/ConjunctionAssessment.ts +417 -0
- package/src/conjunction/ConjunctionEvent.ts +149 -0
- package/src/conjunction/ProbabilityOfCollision.ts +300 -0
- package/src/conjunction/index.ts +24 -0
- package/src/coordinate/ClassicalElements.ts +16 -11
- package/src/coordinate/EquinoctialElements.ts +7 -7
- package/src/coordinate/FormatTle.ts +2 -2
- package/src/coordinate/Geodetic.ts +8 -8
- package/src/coordinate/Hill.ts +4 -4
- package/src/coordinate/ITRF.ts +6 -6
- package/src/coordinate/J2000.ts +7 -7
- package/src/coordinate/RIC.ts +4 -4
- package/src/coordinate/RelativeState.ts +5 -5
- package/src/coordinate/StateVector.ts +8 -3
- package/src/coordinate/TEME.ts +6 -6
- package/src/coordinate/Tle.ts +9 -9
- package/src/coordinate/index.ts +13 -12
- package/src/coordinate/tle-format-data.ts +1 -1
- package/src/covariance/CovarianceSample.ts +13 -13
- package/src/covariance/StateCovariance.ts +2 -2
- package/src/covariance/index.ts +3 -2
- package/src/data/DataHandler.ts +6 -6
- package/src/data/values/Egm96Data.ts +3 -3
- package/src/data/values/HpAtmosphereData.ts +3 -3
- package/src/data/values/HpAtmosphereResult.ts +2 -2
- package/src/data/values/Iau1980Data.ts +2 -2
- package/src/data/values/LeapSecond.ts +1 -1
- package/src/data/values/LeapSecondData.ts +2 -2
- package/src/data/values/egm96.ts +2 -2
- package/src/data/values/hpAtmosphere.ts +2 -2
- package/src/data/values/iau1980.ts +2 -2
- package/src/enums/AngularDiameterMethod.ts +1 -1
- package/src/enums/AngularDistanceMethod.ts +1 -1
- package/src/enums/OrbitRegime.ts +1 -1
- package/src/enums/PassType.ts +1 -1
- package/src/enums/Sgp4OpsMode.ts +1 -1
- package/src/enums/index.ts +8 -7
- package/src/fetch/horizons-constants.ts +53 -0
- package/src/fetch/horizons-interfaces.ts +38 -0
- package/src/fetch/horizons.ts +300 -0
- package/src/force/AtmosphericDrag.ts +3 -3
- package/src/force/EarthGravity.ts +3 -3
- package/src/force/Force.ts +3 -5
- package/src/force/ForceModel.ts +9 -9
- package/src/force/Gravity.ts +3 -3
- package/src/force/SolarRadiationPressure.ts +4 -4
- package/src/force/ThirdBodyGravity.ts +3 -3
- package/src/force/Thrust.ts +3 -3
- package/src/force/index.ts +2 -1
- package/src/interfaces/BaseObjectParams.ts +2 -2
- package/src/interfaces/ClassicalElementsParams.ts +2 -2
- package/src/interfaces/EquinoctialElementsParams.ts +2 -2
- package/src/interfaces/GroundPositionParams.ts +2 -2
- package/src/interfaces/RfSensorParams.ts +2 -2
- package/src/interfaces/SatelliteParams.ts +2 -2
- package/src/interfaces/SensorParams.ts +3 -3
- package/src/interfaces/StarObjectParams.ts +1 -1
- package/src/interfaces/TimeVariables.ts +1 -1
- package/src/interfaces/index.ts +10 -9
- package/src/interpolator/ChebyshevCoefficients.ts +2 -2
- package/src/interpolator/ChebyshevInterpolator.ts +4 -4
- package/src/interpolator/CubicSpline.ts +2 -2
- package/src/interpolator/CubicSplineInterpolator.ts +4 -4
- package/src/interpolator/FieldInterpolator.ts +3 -5
- package/src/interpolator/Interpolator.ts +2 -2
- package/src/interpolator/LagrangeInterpolator.ts +3 -3
- package/src/interpolator/StateInterpolator.ts +4 -6
- package/src/interpolator/VerletBlendInterpolator.ts +5 -5
- package/src/main.ts +41 -20
- package/src/maneuver/TwoBurnOrbitTransfer.ts +3 -3
- package/src/maneuver/Waypoint.ts +8 -8
- package/src/objects/BaseObject.ts +3 -3
- package/src/objects/DetailedSatellite.ts +9 -9
- package/src/objects/DetailedSensor.ts +5 -5
- package/src/objects/GroundObject.ts +9 -9
- package/src/objects/LandObject.ts +3 -3
- package/src/objects/Marker.ts +2 -2
- package/src/objects/RfSensor.ts +2 -2
- package/src/objects/Satellite.ts +21 -21
- package/src/objects/Sensor.ts +7 -7
- package/src/objects/Star.ts +3 -3
- package/src/objects/index.ts +11 -10
- package/src/observation/Observation.ts +11 -23
- package/src/observation/ObservationOptical.ts +7 -7
- package/src/observation/ObservationRadar.ts +7 -7
- package/src/observation/ObservationUtils.ts +2 -2
- package/src/observation/PropagatorPairs.ts +2 -2
- package/src/observation/RAE.ts +9 -9
- package/src/observation/RadecGeocentric.ts +9 -9
- package/src/observation/RadecTopocentric.ts +13 -10
- package/src/observation/index.ts +6 -5
- package/src/operations/BoxMuller.ts +2 -2
- package/src/operations/EulerAngles.ts +2 -2
- package/src/operations/Matrix.ts +2 -2
- package/src/operations/Quaternion.ts +2 -2
- package/src/operations/Random.ts +1 -1
- package/src/operations/RandomGaussianSource.ts +3 -3
- package/src/operations/Vector.ts +2 -2
- package/src/operations/Vector3D.ts +6 -4
- package/src/operations/index.ts +5 -4
- package/src/operations/operations.ts +6 -5
- package/src/optimize/ChebyshevCompressor.ts +5 -5
- package/src/optimize/DownhillSimplex.ts +2 -2
- package/src/optimize/GoldenSection.ts +2 -2
- package/src/optimize/PolynomialRegression.ts +4 -4
- package/src/optimize/PolynomicalRegressionResult.ts +1 -1
- package/src/optimize/SimpleLinearRegression.ts +1 -1
- package/src/optimize/SimplexEntry.ts +2 -2
- package/src/orbit_determination/BatchLeastSquaresOD.ts +10 -10
- package/src/orbit_determination/BatchLeastSquaresResult.ts +3 -3
- package/src/orbit_determination/GaussIOD.ts +393 -0
- package/src/orbit_determination/GibbsIOD.ts +4 -4
- package/src/orbit_determination/GoodingIOD.ts +458 -160
- package/src/orbit_determination/HerrickGibbsIOD.ts +2 -2
- package/src/orbit_determination/LambertIOD.ts +2 -2
- package/src/orbit_determination/ModifiedGoodingIOD.ts +33 -22
- package/src/orbit_determination/index.ts +8 -7
- package/src/propagator/DormandPrince54Propagator.ts +2 -2
- package/src/propagator/KeplerPropagator.ts +7 -8
- package/src/propagator/Propagator.ts +6 -6
- package/src/propagator/RkCheckpoint.ts +2 -2
- package/src/propagator/RkResult.ts +2 -2
- package/src/propagator/RungeKutta4Propagator.ts +6 -6
- package/src/propagator/RungeKutta89Propagator.ts +2 -2
- package/src/propagator/RungeKuttaAdaptive.ts +62 -12
- package/src/propagator/Sgp4Propagator.ts +7 -7
- package/src/propagator/index.ts +4 -3
- package/src/sgp4/index.ts +3 -2
- package/src/sgp4/sgp4.ts +6 -6
- package/src/smoothing/ExponentialSmoothing.ts +2 -2
- package/src/time/Epoch.ts +3 -3
- package/src/time/EpochGPS.ts +5 -5
- package/src/time/EpochTAI.ts +2 -2
- package/src/time/EpochTDB.ts +2 -2
- package/src/time/EpochTT.ts +2 -2
- package/src/time/EpochUTC.ts +10 -10
- package/src/time/EpochWindow.ts +2 -2
- package/src/time/TimeStamped.ts +2 -2
- package/src/time/index.ts +9 -8
- package/src/transforms/TransformCache.ts +1 -1
- package/src/transforms/conversions.ts +2 -2
- package/src/transforms/index.ts +3 -2
- package/src/transforms/transforms.ts +4 -4
- package/src/types/types.ts +8 -3
- package/src/utils/constants.ts +2 -2
- package/src/utils/create-covariance-from-tle.ts +1 -1
- package/src/utils/functions.ts +10 -5
- package/src/utils/index.ts +6 -5
- package/src/utils/jacobian.ts +2 -2
- package/src/utils/linearDistance.ts +1 -1
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NASA Horizons API Client
|
|
3
|
+
*
|
|
4
|
+
* Provides an easy-to-use interface for fetching ephemeris data from NASA's JPL Horizons system.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const horizons = new HorizonsAPI();
|
|
9
|
+
* const data = await horizons.getObjectPosition('Makemake', {
|
|
10
|
+
* startDate: '2025-10-21',
|
|
11
|
+
* stopDate: '2025-11-20',
|
|
12
|
+
* stepSize: '1 day'
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { CELESTIAL_OBJECTS, OBSERVER_CENTERS } from "./horizons-constants";
|
|
18
|
+
import { HorizonsOptions, HorizonsResponse } from "./horizons-interfaces";
|
|
19
|
+
|
|
20
|
+
interface HorizonsUrlSearch {
|
|
21
|
+
format: string;
|
|
22
|
+
MAKE_EPHEM: string;
|
|
23
|
+
COMMAND: string;
|
|
24
|
+
EPHEM_TYPE: string;
|
|
25
|
+
CENTER: string;
|
|
26
|
+
START_TIME: string;
|
|
27
|
+
STOP_TIME: string;
|
|
28
|
+
STEP_SIZE: string;
|
|
29
|
+
VEC_TABLE: string;
|
|
30
|
+
REF_SYSTEM: string;
|
|
31
|
+
REF_PLANE: string;
|
|
32
|
+
VEC_CORR: string;
|
|
33
|
+
CAL_TYPE: string;
|
|
34
|
+
OUT_UNITS: string;
|
|
35
|
+
VEC_LABELS: string;
|
|
36
|
+
VEC_DELTA_T: string;
|
|
37
|
+
CSV_FORMAT: string;
|
|
38
|
+
OBJ_DATA: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class HorizonsAPI {
|
|
42
|
+
private readonly baseUrl = 'https://ssd.jpl.nasa.gov/api/horizons.api';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get position and velocity vectors for a celestial object
|
|
46
|
+
*
|
|
47
|
+
* @param objectName - Name or ID of the celestial object (e.g., 'Makemake', 'Mars', '699')
|
|
48
|
+
* @param options - Query options including date range and parameters
|
|
49
|
+
* @returns Promise resolving to parsed Horizons data
|
|
50
|
+
*/
|
|
51
|
+
async getObjectPosition(
|
|
52
|
+
objectName: CELESTIAL_OBJECTS,
|
|
53
|
+
options: HorizonsOptions
|
|
54
|
+
): Promise<HorizonsResponse> {
|
|
55
|
+
const objectId = this.resolveObjectId(objectName);
|
|
56
|
+
const url = this.buildUrl(objectId, options);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* TODO: This will fail due to CORS
|
|
60
|
+
*/
|
|
61
|
+
const response = await fetch(url);
|
|
62
|
+
if (!response.ok) {
|
|
63
|
+
throw new Error(`Horizons API request failed: ${response.status} ${response.statusText}`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const rawData = await response.text();
|
|
67
|
+
|
|
68
|
+
// Check for API errors in the response
|
|
69
|
+
if (rawData.includes('ERROR') || rawData.includes('No matches found')) {
|
|
70
|
+
throw new Error(`Horizons API error: Invalid object identifier or parameters`);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const vectors = this.parseVectorData(rawData, options.includeVelocity !== false);
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
raw: rawData,
|
|
77
|
+
vectors,
|
|
78
|
+
objectId,
|
|
79
|
+
objectName: this.getObjectName(objectId),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Get position vectors for multiple objects at once
|
|
85
|
+
*
|
|
86
|
+
* @param objectNames - Array of object names or IDs
|
|
87
|
+
* @param options - Query options (same for all objects)
|
|
88
|
+
* @returns Promise resolving to array of Horizons responses
|
|
89
|
+
*/
|
|
90
|
+
async getMultipleObjects(
|
|
91
|
+
objectNames: CELESTIAL_OBJECTS[],
|
|
92
|
+
options: HorizonsOptions
|
|
93
|
+
): Promise<HorizonsResponse[]> {
|
|
94
|
+
const promises = objectNames.map(name => this.getObjectPosition(name, options));
|
|
95
|
+
return Promise.all(promises);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Get current position of an object (right now)
|
|
100
|
+
*
|
|
101
|
+
* @param objectName - Name or ID of the celestial object
|
|
102
|
+
* @param center - Observer center (default: geocentric)
|
|
103
|
+
* @returns Promise resolving to current position data
|
|
104
|
+
*/
|
|
105
|
+
async getCurrentPosition(
|
|
106
|
+
objectName: CELESTIAL_OBJECTS,
|
|
107
|
+
center: string = OBSERVER_CENTERS.Geocentric
|
|
108
|
+
): Promise<[number, [number, number, number], [number, number, number]?]> {
|
|
109
|
+
const now = new Date();
|
|
110
|
+
const tomorrow = new Date(now);
|
|
111
|
+
tomorrow.setDate(tomorrow.getDate() + 1);
|
|
112
|
+
|
|
113
|
+
const response = await this.getObjectPosition(objectName, {
|
|
114
|
+
startDate: this.formatDate(now),
|
|
115
|
+
stopDate: this.formatDate(tomorrow),
|
|
116
|
+
stepSize: '1 day',
|
|
117
|
+
center,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
return response.vectors[0];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Build the full API URL with all parameters
|
|
125
|
+
*/
|
|
126
|
+
buildUrl(objectId: string, options: HorizonsOptions): string {
|
|
127
|
+
const params = this.generateApiString({
|
|
128
|
+
format: 'text',
|
|
129
|
+
MAKE_EPHEM: 'YES',
|
|
130
|
+
COMMAND: `'${objectId}'`,
|
|
131
|
+
EPHEM_TYPE: "'VECTORS'",
|
|
132
|
+
CENTER: `'${options.center ?? OBSERVER_CENTERS.Geocentric}'`,
|
|
133
|
+
START_TIME: `'${options.startDate}'`,
|
|
134
|
+
STOP_TIME: `'${options.stopDate}'`,
|
|
135
|
+
STEP_SIZE: `'${options.stepSize ?? '1 day'}'`,
|
|
136
|
+
VEC_TABLE: options.includeVelocity !== false ? "'3'" : "'2'",
|
|
137
|
+
REF_SYSTEM: `'${options.refSystem ?? 'ICRF'}'`,
|
|
138
|
+
REF_PLANE: `'${options.refPlane ?? 'FRAME'}'`,
|
|
139
|
+
VEC_CORR: `'${options.vecCorr ?? 'NONE'}'`,
|
|
140
|
+
CAL_TYPE: "'M'",
|
|
141
|
+
OUT_UNITS: `'${options.outUnits ?? 'KM-S'}'`,
|
|
142
|
+
VEC_LABELS: "'NO'",
|
|
143
|
+
VEC_DELTA_T: "'NO'",
|
|
144
|
+
CSV_FORMAT: "'NO'",
|
|
145
|
+
OBJ_DATA: "'NO'",
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
return `${this.baseUrl}?${params}`;
|
|
149
|
+
}
|
|
150
|
+
generateApiString(input: HorizonsUrlSearch): string {
|
|
151
|
+
// Create a string without using URLSearchParams
|
|
152
|
+
return Object.entries(input)
|
|
153
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
|
|
154
|
+
.join('&');
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Resolve object name to Horizons ID
|
|
159
|
+
*/
|
|
160
|
+
private resolveObjectId(nameOrId: string): CELESTIAL_OBJECTS | string {
|
|
161
|
+
// Check if it's already a numeric ID
|
|
162
|
+
if (/^\d+$/.test(nameOrId)) {
|
|
163
|
+
return nameOrId;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Look up in the CELESTIAL_OBJECTS map (case-insensitive)
|
|
167
|
+
const normalizedName = nameOrId.charAt(0).toUpperCase() + nameOrId.slice(1).toLowerCase();
|
|
168
|
+
const objectId = CELESTIAL_OBJECTS[normalizedName as keyof typeof CELESTIAL_OBJECTS];
|
|
169
|
+
|
|
170
|
+
if (objectId) {
|
|
171
|
+
return objectId;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// If not found, return the name as-is and let the API handle it
|
|
175
|
+
return nameOrId;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Get object name from ID
|
|
180
|
+
*/
|
|
181
|
+
private getObjectName(objectId: string): CELESTIAL_OBJECTS | undefined {
|
|
182
|
+
const entry = Object.entries(CELESTIAL_OBJECTS).find(([_, id]) => id === objectId) as CELESTIAL_OBJECTS[];
|
|
183
|
+
return entry?.[0];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Format date to YYYY-MM-DD
|
|
188
|
+
*/
|
|
189
|
+
private formatDate(date: Date): string {
|
|
190
|
+
return date.toISOString().split('T')[0];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Parse vector data from the API response
|
|
195
|
+
*/
|
|
196
|
+
parseVectorData(rawData: string, includeVelocity = false): [number, [number, number, number], [number, number, number]?][] {
|
|
197
|
+
const vectors: [number, [number, number, number], [number, number, number]?][] = [];
|
|
198
|
+
|
|
199
|
+
// Find the section between $$SOE (Start of Ephemeris) and $$EOE (End of Ephemeris)
|
|
200
|
+
const soeIndex = rawData.indexOf('$$SOE');
|
|
201
|
+
const eoeIndex = rawData.indexOf('$$EOE');
|
|
202
|
+
|
|
203
|
+
if (soeIndex === -1 || eoeIndex === -1) {
|
|
204
|
+
throw new Error('Could not find ephemeris data in response');
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const ephemerisData = rawData.substring(soeIndex + 5, eoeIndex).trim();
|
|
208
|
+
const lines = ephemerisData.split('\n').filter(line => line.trim());
|
|
209
|
+
|
|
210
|
+
// Parse data in groups (each record can span multiple lines)
|
|
211
|
+
let i = 0;
|
|
212
|
+
while (i < lines.length) {
|
|
213
|
+
const line = lines[i].trim();
|
|
214
|
+
|
|
215
|
+
// Look for Julian Date line
|
|
216
|
+
if (RegExp(/^\d{7}\.\d+/).exec(line)) {
|
|
217
|
+
// const parts = line.split(/\s+/);
|
|
218
|
+
// const jd = parseFloat(parts[0]);
|
|
219
|
+
|
|
220
|
+
// Next line contains date
|
|
221
|
+
// i++;
|
|
222
|
+
const dateLine = lines[i]?.trim();
|
|
223
|
+
let date = NaN;
|
|
224
|
+
if (dateLine) {
|
|
225
|
+
// Match "1990-Jan-01 00:00:00.0000" (month as 3-letter name) and optional time
|
|
226
|
+
const m = RegExp(/(\d{4})-([A-Za-z]{3})-(\d{2})(?:\s+(\d{2}:\d{2}:\d{2}(?:\.\d+)?))?/).exec(dateLine);
|
|
227
|
+
if (m) {
|
|
228
|
+
const [, year, monStr, day, timePart] = m;
|
|
229
|
+
const months: Record<string, string> = {
|
|
230
|
+
jan: '01', feb: '02', mar: '03', apr: '04', may: '05', jun: '06',
|
|
231
|
+
jul: '07', aug: '08', sep: '09', oct: '10', nov: '11', dec: '12'
|
|
232
|
+
};
|
|
233
|
+
const mon = months[monStr.toLowerCase()] ?? '01';
|
|
234
|
+
const time = timePart ?? '00:00:00.0000';
|
|
235
|
+
// Build an ISO-like string and parse as UTC
|
|
236
|
+
const iso = `${year}-${mon}-${day}T${time}Z`;
|
|
237
|
+
date = new Date(iso).getTime();
|
|
238
|
+
} else {
|
|
239
|
+
// Fallback: try letting Date parse the line
|
|
240
|
+
const parsed = Date.parse(dateLine);
|
|
241
|
+
date = isNaN(parsed) ? NaN : parsed;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Next line contains position X, Y, Z (labels) or plain three numbers
|
|
246
|
+
i++;
|
|
247
|
+
const posLine = lines[i]?.trim();
|
|
248
|
+
const posLabelRegex = /X\s*=\s*([-\d.E+]+)\s+Y\s*=\s*([-\d.E+]+)\s+Z\s*=\s*([-\d.E+]+)/;
|
|
249
|
+
const plainTripleRegex = /^([-\d.E+]+)\s+([-\d.E+]+)\s+([-\d.E+]+)/;
|
|
250
|
+
const posMatch = posLabelRegex.exec(posLine ?? '') || plainTripleRegex.exec(posLine ?? '');
|
|
251
|
+
|
|
252
|
+
let velocity: [number, number, number] | undefined;
|
|
253
|
+
|
|
254
|
+
if (includeVelocity) {
|
|
255
|
+
// Next line contains velocity VX, VY, VZ (labels) or plain three numbers
|
|
256
|
+
i++;
|
|
257
|
+
const velLine = lines[i]?.trim();
|
|
258
|
+
const velLabelRegex = /VX\s*=\s*([-\d.E+]+)\s+VY\s*=\s*([-\d.E+]+)\s+VZ\s*=\s*([-\d.E+]+)/;
|
|
259
|
+
const velMatch = velLabelRegex.exec(velLine ?? '') || plainTripleRegex.exec(velLine ?? '');
|
|
260
|
+
|
|
261
|
+
if (velMatch) {
|
|
262
|
+
velocity = [
|
|
263
|
+
parseFloat(velMatch[1]),
|
|
264
|
+
parseFloat(velMatch[2]),
|
|
265
|
+
parseFloat(velMatch[3])
|
|
266
|
+
];
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (posMatch && velocity) {
|
|
271
|
+
vectors.push([
|
|
272
|
+
date,
|
|
273
|
+
[
|
|
274
|
+
parseFloat(posMatch[1]),
|
|
275
|
+
parseFloat(posMatch[2]),
|
|
276
|
+
parseFloat(posMatch[3])
|
|
277
|
+
],
|
|
278
|
+
velocity,
|
|
279
|
+
]);
|
|
280
|
+
} else if (posMatch) {
|
|
281
|
+
vectors.push([
|
|
282
|
+
date,
|
|
283
|
+
[
|
|
284
|
+
parseFloat(posMatch[1]),
|
|
285
|
+
parseFloat(posMatch[2]),
|
|
286
|
+
parseFloat(posMatch[3])
|
|
287
|
+
],
|
|
288
|
+
]);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
i++;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
return vectors;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// Convenience export for direct usage
|
|
300
|
+
export default HorizonsAPI;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
5
|
*
|
|
@@ -26,8 +26,8 @@ import {
|
|
|
26
26
|
Radians,
|
|
27
27
|
Sun,
|
|
28
28
|
Vector3D,
|
|
29
|
-
} from '../main
|
|
30
|
-
import { Force } from './Force
|
|
29
|
+
} from '../main';
|
|
30
|
+
import { Force } from './Force';
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Harris-Priester atmospheric drag force model.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
5
|
*
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { DataHandler, Earth, ITRF, J2000, Kilometers, KilometersPerSecond, Vector3D } from '../main
|
|
18
|
+
import { DataHandler, Earth, ITRF, J2000, Kilometers, KilometersPerSecond, Vector3D } from '../main';
|
|
19
19
|
/* eslint-disable class-methods-use-this */
|
|
20
20
|
// / Complex Earth gravity model, accounting for EGM-96 zonal, sectoral, and
|
|
21
21
|
|
|
22
|
-
import { Force } from './Force
|
|
22
|
+
import { Force } from './Force';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* designed to model the Earth's gravitational field, which is not uniformly distributed due to variations in mass
|
package/src/force/Force.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
5
|
*
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { J2000, Vector3D } from '../main
|
|
18
|
+
import { J2000, Vector3D } from '../main';
|
|
19
19
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
20
20
|
/* eslint-disable class-methods-use-this */
|
|
21
21
|
|
|
@@ -27,7 +27,5 @@ export abstract class Force {
|
|
|
27
27
|
* @param state The state vector.
|
|
28
28
|
* @throws If the force cannot be calculated.
|
|
29
29
|
*/
|
|
30
|
-
acceleration(state: J2000): Vector3D
|
|
31
|
-
throw Error('Not implemented');
|
|
32
|
-
}
|
|
30
|
+
abstract acceleration(state: J2000): Vector3D;
|
|
33
31
|
}
|
package/src/force/ForceModel.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
5
|
*
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { Earth, J2000, Vector, Vector3D } from '../main
|
|
19
|
-
import { AtmosphericDrag } from './AtmosphericDrag
|
|
20
|
-
import { EarthGravity } from './EarthGravity
|
|
21
|
-
import { Force } from './Force
|
|
22
|
-
import { Gravity } from './Gravity
|
|
23
|
-
import { SolarRadiationPressure } from './SolarRadiationPressure
|
|
24
|
-
import { ThirdBodyGravity } from './ThirdBodyGravity
|
|
25
|
-
import { Thrust } from './Thrust
|
|
18
|
+
import { Earth, J2000, Vector, Vector3D } from '../main';
|
|
19
|
+
import { AtmosphericDrag } from './AtmosphericDrag';
|
|
20
|
+
import { EarthGravity } from './EarthGravity';
|
|
21
|
+
import { Force } from './Force';
|
|
22
|
+
import { Gravity } from './Gravity';
|
|
23
|
+
import { SolarRadiationPressure } from './SolarRadiationPressure';
|
|
24
|
+
import { ThirdBodyGravity } from './ThirdBodyGravity';
|
|
25
|
+
import { Thrust } from './Thrust';
|
|
26
26
|
|
|
27
27
|
// / Force model for spacecraft propagation.
|
|
28
28
|
|
package/src/force/Gravity.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
5
|
*
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { Earth, J2000, Vector3D } from '../main
|
|
19
|
-
import { Force } from './Force
|
|
18
|
+
import { Earth, J2000, Vector3D } from '../main';
|
|
19
|
+
import { Force } from './Force';
|
|
20
20
|
|
|
21
21
|
// / Simple central-body gravity model.
|
|
22
22
|
export class Gravity implements Force {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
5
|
*
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import {
|
|
19
|
-
import { Force } from './Force
|
|
18
|
+
import { J2000, KM_PER_AU, Sun, Vector3D } from '../main';
|
|
19
|
+
import { Force } from './Force';
|
|
20
20
|
|
|
21
21
|
// / Solar radiation pressure model.
|
|
22
22
|
export class SolarRadiationPressure extends Force {
|
|
@@ -26,7 +26,7 @@ export class SolarRadiationPressure extends Force {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// / Solar pressure _(N/m²)_;
|
|
29
|
-
private static readonly _kRef: number = 4.56e-6 *
|
|
29
|
+
private static readonly _kRef: number = 4.56e-6 * KM_PER_AU ** 2;
|
|
30
30
|
|
|
31
31
|
acceleration(state: J2000): Vector3D {
|
|
32
32
|
const rSun = Sun.positionApparent(state.epoch);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
5
|
*
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { J2000, Moon, Sun, Vector3D } from '../main
|
|
19
|
-
import { Force } from './Force
|
|
18
|
+
import { J2000, Moon, Sun, Vector3D } from '../main';
|
|
19
|
+
import { Force } from './Force';
|
|
20
20
|
|
|
21
21
|
// / Third-body gravity model.
|
|
22
22
|
export class ThirdBodyGravity implements Force {
|
package/src/force/Thrust.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
5
|
*
|
|
@@ -25,8 +25,8 @@ import {
|
|
|
25
25
|
Seconds,
|
|
26
26
|
SecondsPerMeterPerSecond,
|
|
27
27
|
Vector3D,
|
|
28
|
-
} from '../main
|
|
29
|
-
import { Force } from './Force
|
|
28
|
+
} from '../main';
|
|
29
|
+
import { Force } from './Force';
|
|
30
30
|
|
|
31
31
|
// / Thrust force model.
|
|
32
32
|
export class Thrust implements Force {
|
package/src/force/index.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { ForceModel } from './ForceModel
|
|
1
|
+
export { ForceModel } from './ForceModel';
|
|
2
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
|
|
4
4
|
* with satellites and other orbital objects.
|
|
5
5
|
* @license AGPL-3.0-or-later
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { EciVec3, KilometersPerSecond, SpaceObjectType } from '../types/types
|
|
24
|
+
import { EciVec3, KilometersPerSecond, SpaceObjectType } from '../types/types';
|
|
25
25
|
|
|
26
26
|
export interface BaseObjectParams {
|
|
27
27
|
id?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
|
|
4
4
|
* with satellites and other orbital objects.
|
|
5
5
|
* @license AGPL-3.0-or-later
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { EpochUTC, Kilometers, Radians } from '../main
|
|
24
|
+
import { EpochUTC, Kilometers, Radians } from '../main';
|
|
25
25
|
|
|
26
26
|
export interface ClassicalElementsParams {
|
|
27
27
|
epoch: EpochUTC;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
|
|
4
4
|
* with satellites and other orbital objects.
|
|
5
5
|
* @license AGPL-3.0-or-later
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { EpochUTC, Kilometers, Radians } from '../main
|
|
24
|
+
import { EpochUTC, Kilometers, Radians } from '../main';
|
|
25
25
|
|
|
26
26
|
export interface EquinoctialElementsParams {
|
|
27
27
|
epoch: EpochUTC;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
|
|
4
4
|
* with satellites and other orbital objects.
|
|
5
5
|
* @license AGPL-3.0-or-later
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { Degrees, Kilometers } from '../types/types
|
|
24
|
+
import { Degrees, Kilometers } from '../types/types';
|
|
25
25
|
|
|
26
26
|
export interface GroundPositionParams {
|
|
27
27
|
lat: Degrees;
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
* SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { Degrees } from '../main
|
|
25
|
-
import { DetailedSensorParams } from '../types/types
|
|
24
|
+
import { Degrees } from '../main';
|
|
25
|
+
import { DetailedSensorParams } from '../types/types';
|
|
26
26
|
|
|
27
27
|
export interface RfSensorParams extends DetailedSensorParams {
|
|
28
28
|
/** The azimuth angles at boresight of the sensor */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EciVec3, SpaceObjectType, TleLine1, TleLine2 } from '../types/types
|
|
2
|
-
import { OmmDataFormat } from './OmmFormat
|
|
1
|
+
import { EciVec3, SpaceObjectType, TleLine1, TleLine2 } from '../types/types';
|
|
2
|
+
import { OmmDataFormat } from './OmmFormat';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Information about a space object.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Degrees, Kilometers, SpaceObjectType } from '../types/types
|
|
2
|
-
import { BaseObjectParams } from './BaseObjectParams
|
|
1
|
+
import { Degrees, Kilometers, SpaceObjectType } from '../types/types';
|
|
2
|
+
import { BaseObjectParams } from './BaseObjectParams';
|
|
3
3
|
|
|
4
|
-
export interface SensorParams extends BaseObjectParams{
|
|
4
|
+
export interface SensorParams extends BaseObjectParams {
|
|
5
5
|
/** Altitude in Kilometers */
|
|
6
6
|
alt: Kilometers;
|
|
7
7
|
/** Latitude in Degrees */
|
package/src/interfaces/index.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export type { BaseObjectParams } from './BaseObjectParams
|
|
2
|
-
export type {
|
|
3
|
-
export type {
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
6
|
-
export type {
|
|
7
|
-
export type {
|
|
8
|
-
export type {
|
|
9
|
-
export type {
|
|
1
|
+
export type { BaseObjectParams } from './BaseObjectParams';
|
|
2
|
+
export type { ClassicalElementsParams } from './ClassicalElementsParams';
|
|
3
|
+
export type { EquinoctialElementsParams } from './EquinoctialElementsParams';
|
|
4
|
+
export type { GroundPositionParams } from './GroundPositionParams';
|
|
5
|
+
export type { OptionsParams } from './OptionsParams';
|
|
6
|
+
export type { RfSensorParams } from './RfSensorParams';
|
|
7
|
+
export type { SatelliteParams } from './SatelliteParams';
|
|
8
|
+
export type { SensorParams } from './SensorParams';
|
|
9
|
+
export type { StarObjectParams } from './StarObjectParams';
|
|
10
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
5
|
*
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { Kilometers, KilometersPerSecond, PositionVelocity, Seconds, Vector3D } from '../main
|
|
18
|
+
import { Kilometers, KilometersPerSecond, PositionVelocity, Seconds, Vector3D } from '../main';
|
|
19
19
|
|
|
20
20
|
// / Chebyshev compressed ephemeris coefficients.
|
|
21
21
|
export class ChebyshevCoefficients {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
5
|
*
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { EpochUTC, EpochWindow, J2000 } from '../main
|
|
19
|
-
import { ChebyshevCoefficients } from './ChebyshevCoefficients
|
|
20
|
-
import { StateInterpolator } from './StateInterpolator
|
|
18
|
+
import { EpochUTC, EpochWindow, J2000 } from '../main';
|
|
19
|
+
import { ChebyshevCoefficients } from './ChebyshevCoefficients';
|
|
20
|
+
import { StateInterpolator } from './StateInterpolator';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Compressed Chebyshev ephemeris interpolator.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
5
|
*
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { Kilometers, KilometersPerSecond, Seconds, Vector3D } from '../main
|
|
18
|
+
import { Kilometers, KilometersPerSecond, Seconds, Vector3D } from '../main';
|
|
19
19
|
|
|
20
20
|
// / Container for cubic spline data.
|
|
21
21
|
export class CubicSpline {
|