ootk 5.1.1 → 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/README.md +18 -0
- package/dist/body/Celestial.d.ts +1 -1
- package/dist/body/Celestial.js +1 -1
- package/dist/body/Celestial.js.map +1 -1
- package/dist/body/Earth.d.ts +3 -3
- package/dist/body/Earth.js +1 -1
- 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 +1 -1
- package/dist/body/PrecessionAngles.d.ts +1 -1
- package/dist/body/Sun.d.ts +1 -1
- package/dist/body/Sun.js +2 -2
- package/dist/body/Sun.js.map +1 -1
- package/dist/body/index.d.ts +4 -4
- package/dist/body/index.js +4 -4
- 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 +6 -6
- package/dist/coordinate/ClassicalElements.js +6 -6
- package/dist/coordinate/ClassicalElements.js.map +1 -1
- package/dist/coordinate/EquinoctialElements.d.ts +4 -4
- package/dist/coordinate/EquinoctialElements.js +3 -3
- package/dist/coordinate/EquinoctialElements.js.map +1 -1
- package/dist/coordinate/FormatTle.d.ts +1 -1
- package/dist/coordinate/FormatTle.js +1 -1
- package/dist/coordinate/FormatTle.js.map +1 -1
- package/dist/coordinate/Geodetic.d.ts +3 -3
- package/dist/coordinate/Geodetic.js +6 -6
- package/dist/coordinate/Geodetic.js.map +1 -1
- package/dist/coordinate/Hill.d.ts +3 -3
- package/dist/coordinate/Hill.js +2 -2
- package/dist/coordinate/Hill.js.map +1 -1
- package/dist/coordinate/ITRF.d.ts +4 -4
- package/dist/coordinate/ITRF.js +4 -4
- package/dist/coordinate/ITRF.js.map +1 -1
- package/dist/coordinate/J2000.d.ts +4 -4
- package/dist/coordinate/J2000.js +4 -4
- package/dist/coordinate/J2000.js.map +1 -1
- package/dist/coordinate/RIC.d.ts +3 -3
- package/dist/coordinate/RIC.js +2 -2
- package/dist/coordinate/RIC.js.map +1 -1
- package/dist/coordinate/RelativeState.d.ts +4 -4
- package/dist/coordinate/RelativeState.js +1 -1
- package/dist/coordinate/RelativeState.js.map +1 -1
- package/dist/coordinate/StateVector.d.ts +1 -1
- package/dist/coordinate/StateVector.js +1 -1
- package/dist/coordinate/StateVector.js.map +1 -1
- package/dist/coordinate/TEME.d.ts +3 -3
- package/dist/coordinate/TEME.js +3 -3
- package/dist/coordinate/TEME.js.map +1 -1
- package/dist/coordinate/Tle.d.ts +4 -4
- package/dist/coordinate/Tle.js +8 -8
- 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/covariance/CovarianceSample.d.ts +4 -4
- package/dist/covariance/CovarianceSample.js +4 -4
- package/dist/covariance/CovarianceSample.js.map +1 -1
- package/dist/covariance/StateCovariance.d.ts +1 -1
- package/dist/covariance/StateCovariance.js +1 -1
- 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 +3 -3
- package/dist/data/DataHandler.js +4 -4
- package/dist/data/DataHandler.js.map +1 -1
- package/dist/data/values/Egm96Data.js +2 -2
- package/dist/data/values/Egm96Data.js.map +1 -1
- package/dist/data/values/HpAtmosphereData.d.ts +1 -1
- package/dist/data/values/HpAtmosphereData.js +2 -2
- package/dist/data/values/HpAtmosphereData.js.map +1 -1
- package/dist/data/values/HpAtmosphereResult.d.ts +1 -1
- package/dist/data/values/Iau1980Data.js +1 -1
- package/dist/data/values/Iau1980Data.js.map +1 -1
- package/dist/data/values/LeapSecondData.d.ts +1 -1
- package/dist/data/values/LeapSecondData.js +1 -1
- package/dist/data/values/LeapSecondData.js.map +1 -1
- package/dist/data/values/egm96.d.ts +1 -1
- package/dist/data/values/hpAtmosphere.d.ts +1 -1
- package/dist/data/values/iau1980.d.ts +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 +2 -2
- package/dist/force/AtmosphericDrag.js +1 -1
- package/dist/force/AtmosphericDrag.js.map +1 -1
- package/dist/force/EarthGravity.d.ts +2 -2
- package/dist/force/EarthGravity.js +1 -1
- package/dist/force/EarthGravity.js.map +1 -1
- package/dist/force/Force.d.ts +2 -2
- package/dist/force/Force.js +0 -9
- package/dist/force/Force.js.map +1 -1
- package/dist/force/ForceModel.d.ts +2 -2
- package/dist/force/ForceModel.js +6 -6
- package/dist/force/ForceModel.js.map +1 -1
- package/dist/force/Gravity.d.ts +2 -2
- package/dist/force/Gravity.js +1 -1
- package/dist/force/Gravity.js.map +1 -1
- package/dist/force/SolarRadiationPressure.d.ts +2 -2
- package/dist/force/SolarRadiationPressure.js +3 -3
- package/dist/force/SolarRadiationPressure.js.map +1 -1
- package/dist/force/ThirdBodyGravity.d.ts +2 -2
- package/dist/force/ThirdBodyGravity.js +1 -1
- package/dist/force/ThirdBodyGravity.js.map +1 -1
- package/dist/force/Thrust.d.ts +2 -2
- package/dist/force/Thrust.js +1 -1
- 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 +1 -1
- package/dist/interfaces/ClassicalElementsParams.d.ts +1 -1
- package/dist/interfaces/EquinoctialElementsParams.d.ts +1 -1
- package/dist/interfaces/GroundPositionParams.d.ts +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 +1 -1
- package/dist/interpolator/ChebyshevCoefficients.js +1 -1
- package/dist/interpolator/ChebyshevCoefficients.js.map +1 -1
- package/dist/interpolator/ChebyshevInterpolator.d.ts +3 -3
- package/dist/interpolator/ChebyshevInterpolator.js +2 -2
- package/dist/interpolator/ChebyshevInterpolator.js.map +1 -1
- package/dist/interpolator/CubicSpline.d.ts +1 -1
- package/dist/interpolator/CubicSplineInterpolator.d.ts +3 -3
- package/dist/interpolator/CubicSplineInterpolator.js +3 -3
- package/dist/interpolator/CubicSplineInterpolator.js.map +1 -1
- package/dist/interpolator/FieldInterpolator.d.ts +2 -2
- package/dist/interpolator/FieldInterpolator.js +1 -11
- package/dist/interpolator/FieldInterpolator.js.map +1 -1
- package/dist/interpolator/Interpolator.d.ts +1 -1
- package/dist/interpolator/Interpolator.js +1 -1
- package/dist/interpolator/Interpolator.js.map +1 -1
- package/dist/interpolator/LagrangeInterpolator.d.ts +2 -2
- package/dist/interpolator/LagrangeInterpolator.js +2 -2
- package/dist/interpolator/LagrangeInterpolator.js.map +1 -1
- package/dist/interpolator/StateInterpolator.d.ts +3 -3
- package/dist/interpolator/StateInterpolator.js +1 -9
- package/dist/interpolator/StateInterpolator.js.map +1 -1
- package/dist/interpolator/VerletBlendInterpolator.d.ts +4 -4
- package/dist/interpolator/VerletBlendInterpolator.js +4 -4
- package/dist/interpolator/VerletBlendInterpolator.js.map +1 -1
- package/dist/main.d.ts +19 -19
- package/dist/main.js +20 -19
- package/dist/main.js.map +1 -1
- package/dist/maneuver/TwoBurnOrbitTransfer.d.ts +2 -2
- package/dist/maneuver/TwoBurnOrbitTransfer.js +2 -2
- package/dist/maneuver/TwoBurnOrbitTransfer.js.map +1 -1
- package/dist/maneuver/Waypoint.d.ts +4 -4
- package/dist/maneuver/Waypoint.js +6 -6
- package/dist/maneuver/Waypoint.js.map +1 -1
- package/dist/objects/BaseObject.d.ts +2 -2
- package/dist/objects/BaseObject.js +1 -1
- package/dist/objects/BaseObject.js.map +1 -1
- package/dist/objects/DetailedSatellite.d.ts +3 -3
- package/dist/objects/DetailedSatellite.js +3 -3
- package/dist/objects/DetailedSatellite.js.map +1 -1
- package/dist/objects/DetailedSensor.d.ts +4 -4
- package/dist/objects/DetailedSensor.js +1 -1
- package/dist/objects/DetailedSensor.js.map +1 -1
- package/dist/objects/GroundObject.d.ts +3 -3
- package/dist/objects/GroundObject.js +2 -2
- package/dist/objects/GroundObject.js.map +1 -1
- package/dist/objects/LandObject.d.ts +2 -2
- package/dist/objects/LandObject.js +1 -1
- package/dist/objects/LandObject.js.map +1 -1
- package/dist/objects/Marker.d.ts +1 -1
- package/dist/objects/Marker.js +1 -1
- 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 +11 -11
- package/dist/objects/Satellite.js +11 -11
- package/dist/objects/Satellite.js.map +1 -1
- package/dist/objects/Sensor.d.ts +5 -5
- package/dist/objects/Sensor.js +4 -4
- package/dist/objects/Sensor.js.map +1 -1
- package/dist/objects/Star.d.ts +2 -2
- package/dist/objects/Star.js +2 -2
- 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 +10 -10
- package/dist/observation/Observation.js +0 -51
- package/dist/observation/Observation.js.map +1 -1
- package/dist/observation/ObservationOptical.d.ts +5 -5
- package/dist/observation/ObservationOptical.js +3 -3
- package/dist/observation/ObservationOptical.js.map +1 -1
- package/dist/observation/ObservationRadar.d.ts +5 -5
- package/dist/observation/ObservationRadar.js +3 -3
- package/dist/observation/ObservationRadar.js.map +1 -1
- package/dist/observation/ObservationUtils.d.ts +1 -1
- package/dist/observation/ObservationUtils.js +1 -1
- package/dist/observation/ObservationUtils.js.map +1 -1
- package/dist/observation/PropagatorPairs.d.ts +1 -1
- package/dist/observation/RAE.d.ts +5 -5
- package/dist/observation/RAE.js +5 -5
- package/dist/observation/RAE.js.map +1 -1
- package/dist/observation/RadecGeocentric.d.ts +5 -5
- package/dist/observation/RadecGeocentric.js +4 -4
- package/dist/observation/RadecGeocentric.js.map +1 -1
- package/dist/observation/RadecTopocentric.d.ts +5 -5
- package/dist/observation/RadecTopocentric.js +8 -6
- package/dist/observation/RadecTopocentric.js.map +1 -1
- package/dist/observation/index.d.ts +4 -4
- package/dist/observation/index.js +4 -4
- package/dist/observation/index.js.map +1 -1
- package/dist/operations/BoxMuller.d.ts +1 -1
- package/dist/operations/BoxMuller.js +1 -1
- package/dist/operations/BoxMuller.js.map +1 -1
- package/dist/operations/EulerAngles.d.ts +1 -1
- package/dist/operations/EulerAngles.js +1 -1
- package/dist/operations/EulerAngles.js.map +1 -1
- package/dist/operations/Matrix.d.ts +1 -1
- package/dist/operations/Matrix.js +1 -1
- package/dist/operations/Matrix.js.map +1 -1
- package/dist/operations/Quaternion.d.ts +1 -1
- package/dist/operations/Quaternion.js +1 -1
- package/dist/operations/Quaternion.js.map +1 -1
- package/dist/operations/RandomGaussianSource.d.ts +1 -1
- package/dist/operations/RandomGaussianSource.js +2 -2
- package/dist/operations/RandomGaussianSource.js.map +1 -1
- package/dist/operations/Vector.d.ts +1 -1
- package/dist/operations/Vector.js +1 -1
- package/dist/operations/Vector.js.map +1 -1
- package/dist/operations/Vector3D.d.ts +4 -3
- package/dist/operations/Vector3D.js +4 -3
- 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 +4 -4
- package/dist/operations/operations.js +4 -4
- package/dist/operations/operations.js.map +1 -1
- package/dist/optimize/ChebyshevCompressor.d.ts +2 -2
- package/dist/optimize/ChebyshevCompressor.js +3 -3
- package/dist/optimize/ChebyshevCompressor.js.map +1 -1
- package/dist/optimize/DownhillSimplex.d.ts +1 -1
- package/dist/optimize/DownhillSimplex.js +1 -1
- package/dist/optimize/DownhillSimplex.js.map +1 -1
- package/dist/optimize/GoldenSection.d.ts +1 -1
- package/dist/optimize/PolynomialRegression.d.ts +1 -1
- package/dist/optimize/PolynomialRegression.js +3 -3
- package/dist/optimize/PolynomialRegression.js.map +1 -1
- package/dist/optimize/SimplexEntry.js +1 -1
- package/dist/optimize/SimplexEntry.js.map +1 -1
- package/dist/orbit_determination/BatchLeastSquaresOD.d.ts +4 -4
- package/dist/orbit_determination/BatchLeastSquaresOD.js +7 -7
- package/dist/orbit_determination/BatchLeastSquaresOD.js.map +1 -1
- package/dist/orbit_determination/BatchLeastSquaresResult.d.ts +2 -2
- 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 +1 -1
- package/dist/orbit_determination/GibbsIOD.js +3 -3
- package/dist/orbit_determination/GibbsIOD.js.map +1 -1
- package/dist/orbit_determination/GoodingIOD.d.ts +57 -7
- package/dist/orbit_determination/GoodingIOD.js +224 -34
- package/dist/orbit_determination/GoodingIOD.js.map +1 -1
- package/dist/orbit_determination/HerrickGibbsIOD.d.ts +1 -1
- package/dist/orbit_determination/HerrickGibbsIOD.js +1 -1
- package/dist/orbit_determination/HerrickGibbsIOD.js.map +1 -1
- package/dist/orbit_determination/LambertIOD.d.ts +1 -1
- package/dist/orbit_determination/LambertIOD.js +1 -1
- package/dist/orbit_determination/LambertIOD.js.map +1 -1
- package/dist/orbit_determination/ModifiedGoodingIOD.d.ts +2 -2
- package/dist/orbit_determination/ModifiedGoodingIOD.js +7 -7
- 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 +1 -1
- package/dist/propagator/DormandPrince54Propagator.js +1 -1
- package/dist/propagator/DormandPrince54Propagator.js.map +1 -1
- package/dist/propagator/KeplerPropagator.d.ts +5 -5
- package/dist/propagator/KeplerPropagator.js +5 -6
- package/dist/propagator/KeplerPropagator.js.map +1 -1
- package/dist/propagator/Propagator.d.ts +4 -4
- package/dist/propagator/Propagator.js +4 -4
- package/dist/propagator/Propagator.js.map +1 -1
- package/dist/propagator/RkCheckpoint.d.ts +1 -1
- package/dist/propagator/RkResult.d.ts +1 -1
- package/dist/propagator/RungeKutta4Propagator.d.ts +5 -5
- package/dist/propagator/RungeKutta4Propagator.js +4 -4
- package/dist/propagator/RungeKutta4Propagator.js.map +1 -1
- package/dist/propagator/RungeKutta89Propagator.d.ts +1 -1
- package/dist/propagator/RungeKutta89Propagator.js +1 -1
- package/dist/propagator/RungeKutta89Propagator.js.map +1 -1
- package/dist/propagator/RungeKuttaAdaptive.d.ts +5 -5
- package/dist/propagator/RungeKuttaAdaptive.js +51 -8
- package/dist/propagator/RungeKuttaAdaptive.js.map +1 -1
- package/dist/propagator/Sgp4Propagator.d.ts +6 -6
- package/dist/propagator/Sgp4Propagator.js +3 -3
- 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 +1 -1
- package/dist/sgp4/index.js +1 -1
- package/dist/sgp4/index.js.map +1 -1
- package/dist/sgp4/sgp4.d.ts +2 -2
- package/dist/sgp4/sgp4.js +4 -4
- package/dist/sgp4/sgp4.js.map +1 -1
- package/dist/smoothing/ExponentialSmoothing.d.ts +1 -1
- package/dist/time/Epoch.d.ts +1 -1
- package/dist/time/Epoch.js +1 -1
- package/dist/time/Epoch.js.map +1 -1
- package/dist/time/EpochGPS.d.ts +2 -2
- package/dist/time/EpochGPS.js +2 -2
- package/dist/time/EpochGPS.js.map +1 -1
- package/dist/time/EpochTAI.d.ts +1 -1
- package/dist/time/EpochTAI.js +1 -1
- package/dist/time/EpochTAI.js.map +1 -1
- package/dist/time/EpochTDB.d.ts +1 -1
- package/dist/time/EpochTDB.js +1 -1
- package/dist/time/EpochTDB.js.map +1 -1
- package/dist/time/EpochTT.d.ts +1 -1
- package/dist/time/EpochTT.js +1 -1
- package/dist/time/EpochTT.js.map +1 -1
- package/dist/time/EpochUTC.d.ts +6 -6
- package/dist/time/EpochUTC.js +8 -8
- package/dist/time/EpochUTC.js.map +1 -1
- package/dist/time/EpochWindow.d.ts +1 -1
- package/dist/time/TimeStamped.d.ts +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/conversions.d.ts +1 -1
- package/dist/transforms/conversions.js +1 -1
- 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 +4 -4
- package/src/body/Celestial.ts +1 -1
- package/src/body/Earth.ts +3 -3
- package/src/body/Moon.ts +7 -7
- package/src/body/NutationAngles.ts +1 -1
- package/src/body/PrecessionAngles.ts +1 -1
- package/src/body/Sun.ts +3 -3
- package/src/body/index.ts +4 -4
- 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 +9 -9
- package/src/coordinate/EquinoctialElements.ts +6 -6
- package/src/coordinate/FormatTle.ts +1 -1
- package/src/coordinate/Geodetic.ts +7 -7
- package/src/coordinate/Hill.ts +3 -3
- package/src/coordinate/ITRF.ts +5 -5
- package/src/coordinate/J2000.ts +6 -6
- package/src/coordinate/RIC.ts +3 -3
- package/src/coordinate/RelativeState.ts +4 -4
- package/src/coordinate/StateVector.ts +1 -1
- package/src/coordinate/TEME.ts +5 -5
- package/src/coordinate/Tle.ts +8 -8
- package/src/coordinate/index.ts +13 -12
- package/src/covariance/CovarianceSample.ts +5 -5
- package/src/covariance/StateCovariance.ts +1 -1
- package/src/covariance/index.ts +3 -2
- package/src/data/DataHandler.ts +5 -5
- package/src/data/values/Egm96Data.ts +2 -2
- package/src/data/values/HpAtmosphereData.ts +2 -2
- package/src/data/values/HpAtmosphereResult.ts +1 -1
- package/src/data/values/Iau1980Data.ts +1 -1
- package/src/data/values/LeapSecondData.ts +1 -1
- package/src/data/values/egm96.ts +1 -1
- package/src/data/values/hpAtmosphere.ts +1 -1
- package/src/data/values/iau1980.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 +2 -2
- package/src/force/EarthGravity.ts +2 -2
- package/src/force/Force.ts +2 -4
- package/src/force/ForceModel.ts +8 -8
- package/src/force/Gravity.ts +2 -2
- package/src/force/SolarRadiationPressure.ts +3 -3
- package/src/force/ThirdBodyGravity.ts +2 -2
- package/src/force/Thrust.ts +2 -2
- package/src/force/index.ts +2 -1
- package/src/interfaces/BaseObjectParams.ts +1 -1
- package/src/interfaces/ClassicalElementsParams.ts +1 -1
- package/src/interfaces/EquinoctialElementsParams.ts +1 -1
- package/src/interfaces/GroundPositionParams.ts +1 -1
- 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 +1 -1
- package/src/interpolator/ChebyshevInterpolator.ts +3 -3
- package/src/interpolator/CubicSpline.ts +1 -1
- package/src/interpolator/CubicSplineInterpolator.ts +3 -3
- package/src/interpolator/FieldInterpolator.ts +2 -4
- package/src/interpolator/Interpolator.ts +1 -1
- package/src/interpolator/LagrangeInterpolator.ts +2 -2
- package/src/interpolator/StateInterpolator.ts +3 -5
- package/src/interpolator/VerletBlendInterpolator.ts +4 -4
- package/src/main.ts +21 -19
- package/src/maneuver/TwoBurnOrbitTransfer.ts +2 -2
- package/src/maneuver/Waypoint.ts +7 -7
- package/src/objects/BaseObject.ts +2 -2
- package/src/objects/DetailedSatellite.ts +3 -3
- package/src/objects/DetailedSensor.ts +4 -4
- package/src/objects/GroundObject.ts +3 -3
- package/src/objects/LandObject.ts +2 -2
- package/src/objects/Marker.ts +1 -1
- package/src/objects/RfSensor.ts +2 -2
- package/src/objects/Satellite.ts +18 -18
- package/src/objects/Sensor.ts +6 -6
- package/src/objects/Star.ts +2 -2
- package/src/objects/index.ts +11 -10
- package/src/observation/Observation.ts +10 -22
- package/src/observation/ObservationOptical.ts +6 -6
- package/src/observation/ObservationRadar.ts +6 -6
- package/src/observation/ObservationUtils.ts +1 -1
- package/src/observation/PropagatorPairs.ts +1 -1
- package/src/observation/RAE.ts +8 -8
- package/src/observation/RadecGeocentric.ts +8 -8
- package/src/observation/RadecTopocentric.ts +12 -9
- package/src/observation/index.ts +4 -4
- package/src/operations/BoxMuller.ts +1 -1
- package/src/operations/EulerAngles.ts +1 -1
- package/src/operations/Matrix.ts +1 -1
- package/src/operations/Quaternion.ts +1 -1
- package/src/operations/RandomGaussianSource.ts +2 -2
- package/src/operations/Vector.ts +1 -1
- package/src/operations/Vector3D.ts +5 -3
- package/src/operations/index.ts +5 -4
- package/src/operations/operations.ts +4 -4
- package/src/optimize/ChebyshevCompressor.ts +4 -4
- package/src/optimize/DownhillSimplex.ts +1 -1
- package/src/optimize/GoldenSection.ts +1 -1
- package/src/optimize/PolynomialRegression.ts +3 -3
- package/src/optimize/SimplexEntry.ts +1 -1
- package/src/orbit_determination/BatchLeastSquaresOD.ts +9 -9
- package/src/orbit_determination/BatchLeastSquaresResult.ts +2 -2
- package/src/orbit_determination/GaussIOD.ts +393 -0
- package/src/orbit_determination/GibbsIOD.ts +3 -3
- package/src/orbit_determination/GoodingIOD.ts +457 -159
- package/src/orbit_determination/HerrickGibbsIOD.ts +1 -1
- package/src/orbit_determination/LambertIOD.ts +1 -1
- package/src/orbit_determination/ModifiedGoodingIOD.ts +32 -21
- package/src/orbit_determination/index.ts +8 -7
- package/src/propagator/DormandPrince54Propagator.ts +1 -1
- package/src/propagator/KeplerPropagator.ts +6 -7
- package/src/propagator/Propagator.ts +5 -5
- package/src/propagator/RkCheckpoint.ts +1 -1
- package/src/propagator/RkResult.ts +1 -1
- package/src/propagator/RungeKutta4Propagator.ts +5 -5
- package/src/propagator/RungeKutta89Propagator.ts +1 -1
- package/src/propagator/RungeKuttaAdaptive.ts +60 -10
- package/src/propagator/Sgp4Propagator.ts +6 -6
- package/src/propagator/index.ts +4 -3
- package/src/sgp4/index.ts +1 -1
- package/src/sgp4/sgp4.ts +5 -5
- package/src/smoothing/ExponentialSmoothing.ts +1 -1
- package/src/time/Epoch.ts +2 -2
- package/src/time/EpochGPS.ts +4 -4
- package/src/time/EpochTAI.ts +1 -1
- package/src/time/EpochTDB.ts +1 -1
- package/src/time/EpochTT.ts +1 -1
- package/src/time/EpochUTC.ts +9 -9
- package/src/time/EpochWindow.ts +1 -1
- package/src/time/TimeStamped.ts +1 -1
- package/src/time/index.ts +9 -8
- package/src/transforms/conversions.ts +1 -1
- 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
package/jest.config.mjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const jestConfig = {
|
|
2
|
+
testEnvironment: 'node',
|
|
3
|
+
extensionsToTreatAsEsm: ['.ts'],
|
|
4
|
+
moduleNameMapper: {
|
|
5
|
+
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
6
|
+
'^@src/(.*)$': '<rootDir>/src/$1',
|
|
7
|
+
'^@src$': '<rootDir>/src',
|
|
8
|
+
},
|
|
9
|
+
transform: {
|
|
10
|
+
'^.+\\.jsx?$': 'babel-jest',
|
|
11
|
+
'^.+\\.tsx?$': [
|
|
12
|
+
'ts-jest',
|
|
13
|
+
{
|
|
14
|
+
useESM: true,
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
testMatch: ['**/test/**/?(*.)+(spec|test).?(m)[jt]s?(x)'],
|
|
19
|
+
moduleFileExtensions: ['js', 'mjs', 'ts'],
|
|
20
|
+
coverageDirectory: '<rootDir>/coverage',
|
|
21
|
+
moduleDirectories: ['node_modules'],
|
|
22
|
+
modulePathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/test/sgp4/sgp4prop'],
|
|
23
|
+
coverageReporters: ['lcov', 'html', 'text'],
|
|
24
|
+
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/lib/', '/commonjs/', '/test/', '/scripts/', '/coverage/'],
|
|
25
|
+
globalSetup: '<rootDir>/test/lib/globalSetup.js',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default jestConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ootk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-rc.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/main.js",
|
|
6
6
|
"description": "Orbital Object Toolkit including Multiple Propagators, Initial Orbit Determination, and Maneuver Calculations.",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@babel/preset-env": "^7.26.9",
|
|
40
40
|
"@babel/preset-typescript": "^7.26.0",
|
|
41
41
|
"@types/jest": "^29.5.14",
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
43
|
-
"@typescript-eslint/parser": "^
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
43
|
+
"@typescript-eslint/parser": "^8.46.2",
|
|
44
44
|
"auto-changelog": "^2.5.0",
|
|
45
45
|
"babel-eslint": "^10.1.0",
|
|
46
46
|
"babel-jest": "^28.1.3",
|
|
@@ -54,4 +54,4 @@
|
|
|
54
54
|
"typescript": "^5.8.2"
|
|
55
55
|
},
|
|
56
56
|
"homepage": "https://github.com/thkruz/ootk"
|
|
57
|
-
}
|
|
57
|
+
}
|
package/src/body/Celestial.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { AzEl, Degrees, Kilometers, RAD2DEG, RaDec, Radians, Sun } from '../main
|
|
24
|
+
import { AzEl, Degrees, Kilometers, RAD2DEG, RaDec, Radians, Sun } from '../main';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Celestial is a static class that provides methods for calculating the position of celestial objects such as the Sun,
|
package/src/body/Earth.ts
CHANGED
|
@@ -39,9 +39,9 @@ import {
|
|
|
39
39
|
TAU,
|
|
40
40
|
ttasec2rad,
|
|
41
41
|
Vector3D,
|
|
42
|
-
} from '../main
|
|
43
|
-
import { NutationAngles } from './NutationAngles
|
|
44
|
-
import { PrecessionAngles } from './PrecessionAngles
|
|
42
|
+
} from '../main';
|
|
43
|
+
import { NutationAngles } from './NutationAngles';
|
|
44
|
+
import { PrecessionAngles } from './PrecessionAngles';
|
|
45
45
|
|
|
46
46
|
// / Earth metrics and operations.
|
|
47
47
|
export class Earth {
|
package/src/body/Moon.ts
CHANGED
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
* moon calculations are based on formulas from this website
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
|
-
import { AngularDiameterMethod, Celestial, Degrees, Kilometers, RaDec, Radians } from '../main
|
|
40
|
-
import { Vector3D } from '../operations/Vector3D
|
|
41
|
-
import { EpochUTC } from '../time/EpochUTC
|
|
42
|
-
import { DEG2RAD, MS_PER_DAY } from '../utils/constants
|
|
43
|
-
import { angularDiameter } from '../utils/functions
|
|
44
|
-
import { Earth } from './Earth
|
|
45
|
-
import { Sun } from './Sun
|
|
39
|
+
import { AngularDiameterMethod, Celestial, Degrees, Kilometers, RaDec, Radians } from '../main';
|
|
40
|
+
import { Vector3D } from '../operations/Vector3D';
|
|
41
|
+
import { EpochUTC } from '../time/EpochUTC';
|
|
42
|
+
import { DEG2RAD, MS_PER_DAY } from '../utils/constants';
|
|
43
|
+
import { angularDiameter } from '../utils/functions';
|
|
44
|
+
import { Earth } from './Earth';
|
|
45
|
+
import { Sun } from './Sun';
|
|
46
46
|
|
|
47
47
|
type MoonIlluminationData = {
|
|
48
48
|
fraction: number;
|
package/src/body/Sun.ts
CHANGED
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
import {
|
|
34
34
|
angularDiameter,
|
|
35
35
|
AngularDiameterMethod,
|
|
36
|
-
astronomicalUnit,
|
|
37
36
|
AzEl,
|
|
38
37
|
Celestial,
|
|
39
38
|
cKmPerSec,
|
|
@@ -42,6 +41,7 @@ import {
|
|
|
42
41
|
Earth,
|
|
43
42
|
EpochUTC,
|
|
44
43
|
Kilometers,
|
|
44
|
+
KM_PER_AU,
|
|
45
45
|
Meters,
|
|
46
46
|
MS_PER_DAY,
|
|
47
47
|
RAD2DEG,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
SunTime,
|
|
52
52
|
TAU,
|
|
53
53
|
Vector3D,
|
|
54
|
-
} from '../main
|
|
54
|
+
} from '../main';
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Sun metrics and operations.
|
|
@@ -500,7 +500,7 @@ export class Sun {
|
|
|
500
500
|
rMag * Math.cos(obliq * dtr) * Math.sin(lamEc * dtr),
|
|
501
501
|
rMag * Math.sin(obliq * dtr) * Math.sin(lamEc * dtr),
|
|
502
502
|
);
|
|
503
|
-
const rMOD = r.scale(
|
|
503
|
+
const rMOD = r.scale(KM_PER_AU);
|
|
504
504
|
const p = Earth.precession(epoch);
|
|
505
505
|
|
|
506
506
|
return rMOD
|
package/src/body/index.ts
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
export { Celestial } from './Celestial
|
|
25
|
-
export { Earth } from './Earth
|
|
26
|
-
export { Moon } from './Moon
|
|
27
|
-
export { Sun } from './Sun
|
|
24
|
+
export { Celestial } from './Celestial';
|
|
25
|
+
export { Earth } from './Earth';
|
|
26
|
+
export { Moon } from './Moon';
|
|
27
|
+
export { Sun } from './Sun';
|
|
28
28
|
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
|
+
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
|
+
*
|
|
6
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
7
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
8
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
11
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
* See the GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
15
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { EpochUTC } from '../time/EpochUTC.js';
|
|
19
|
+
import { J2000 } from '../coordinate/J2000.js';
|
|
20
|
+
import { RIC } from '../coordinate/RIC.js';
|
|
21
|
+
import { Tle } from '../coordinate/Tle.js';
|
|
22
|
+
import { StateCovariance, CovarianceFrame } from '../covariance/StateCovariance.js';
|
|
23
|
+
import { CovarianceSample } from '../covariance/CovarianceSample.js';
|
|
24
|
+
import { Propagator } from '../propagator/Propagator.js';
|
|
25
|
+
import { Sgp4Propagator } from '../propagator/Sgp4Propagator.js';
|
|
26
|
+
import { RungeKutta89Propagator } from '../propagator/RungeKutta89Propagator.js';
|
|
27
|
+
import { ForceModel } from '../force/ForceModel.js';
|
|
28
|
+
import { GoldenSection } from '../optimize/GoldenSection.js';
|
|
29
|
+
import { Matrix } from '../operations/Matrix.js';
|
|
30
|
+
import type { Kilometers, Seconds } from '../main.js';
|
|
31
|
+
import { ConjunctionEvent } from './ConjunctionEvent.js';
|
|
32
|
+
import { ProbabilityOfCollision } from './ProbabilityOfCollision.js';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Input for a space object in conjunction assessment.
|
|
36
|
+
* Can be specified as either a TLE or a state vector with optional covariance.
|
|
37
|
+
*/
|
|
38
|
+
export interface SpaceObject {
|
|
39
|
+
/** Object identifier/name */
|
|
40
|
+
name?: string;
|
|
41
|
+
|
|
42
|
+
/** TLE for the object (alternative to state) */
|
|
43
|
+
tle?: Tle;
|
|
44
|
+
|
|
45
|
+
/** State vector in J2000 frame (alternative to TLE) */
|
|
46
|
+
state?: J2000;
|
|
47
|
+
|
|
48
|
+
/** Covariance matrix (optional, for probability calculation) */
|
|
49
|
+
covariance?: StateCovariance;
|
|
50
|
+
|
|
51
|
+
/** Hard body radius in km (optional, for probability calculation) */
|
|
52
|
+
radius?: Kilometers;
|
|
53
|
+
|
|
54
|
+
/** Custom propagator (optional, overrides default) */
|
|
55
|
+
propagator?: Propagator;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Configuration options for conjunction assessment.
|
|
60
|
+
*/
|
|
61
|
+
export interface ConjunctionAssessmentOptions {
|
|
62
|
+
/** Search window start time */
|
|
63
|
+
startTime: EpochUTC;
|
|
64
|
+
|
|
65
|
+
/** Search window end time */
|
|
66
|
+
endTime: EpochUTC;
|
|
67
|
+
|
|
68
|
+
/** Use high-fidelity propagation (RungeKutta89 instead of SGP4) */
|
|
69
|
+
useHighFidelity?: boolean;
|
|
70
|
+
|
|
71
|
+
/** Force model for high-fidelity propagation (optional) */
|
|
72
|
+
forceModel?: ForceModel;
|
|
73
|
+
|
|
74
|
+
/** Propagate covariances using sigma-point method */
|
|
75
|
+
propagateCovariance?: boolean;
|
|
76
|
+
|
|
77
|
+
/** TCA search tolerance in seconds */
|
|
78
|
+
tcaTolerance?: Seconds;
|
|
79
|
+
|
|
80
|
+
/** Step size for initial TCA search in seconds */
|
|
81
|
+
searchStepSize?: Seconds;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* High accuracy conjunction assessment workflow.
|
|
86
|
+
*
|
|
87
|
+
* This class provides a comprehensive workflow for assessing conjunctions between
|
|
88
|
+
* space objects using:
|
|
89
|
+
* - High accuracy propagators (SGP4 or numerical integrators)
|
|
90
|
+
* - Covariance matrices based on historical TLE accuracy
|
|
91
|
+
* - Time of Closest Approach (TCA) finding using optimization
|
|
92
|
+
* - Probability of collision calculation using Chan's 2D method
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* const primaryTle = new Tle(line1, line2);
|
|
97
|
+
* const secondaryTle = new Tle(line1, line2);
|
|
98
|
+
*
|
|
99
|
+
* const assessment = new ConjunctionAssessment(
|
|
100
|
+
* { tle: primaryTle, radius: 0.01 as Kilometers },
|
|
101
|
+
* { tle: secondaryTle, radius: 0.01 as Kilometers },
|
|
102
|
+
* );
|
|
103
|
+
*
|
|
104
|
+
* const event = assessment.assess({
|
|
105
|
+
* startTime: EpochUTC.fromDateTime(new Date('2025-01-01T00:00:00Z')),
|
|
106
|
+
* endTime: EpochUTC.fromDateTime(new Date('2025-01-02T00:00:00Z')),
|
|
107
|
+
* useHighFidelity: true,
|
|
108
|
+
* propagateCovariance: true,
|
|
109
|
+
* });
|
|
110
|
+
*
|
|
111
|
+
* console.log(event.toString());
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
export class ConjunctionAssessment {
|
|
115
|
+
private primaryProp: Propagator;
|
|
116
|
+
private secondaryProp: Propagator;
|
|
117
|
+
private primaryCovSample?: CovarianceSample;
|
|
118
|
+
private secondaryCovSample?: CovarianceSample;
|
|
119
|
+
|
|
120
|
+
constructor(
|
|
121
|
+
private primary: SpaceObject,
|
|
122
|
+
private secondary: SpaceObject,
|
|
123
|
+
) {
|
|
124
|
+
// Initialize propagators (will be replaced in assess() if needed)
|
|
125
|
+
this.primaryProp = this.createPropagator(primary, false);
|
|
126
|
+
this.secondaryProp = this.createPropagator(secondary, false);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Performs conjunction assessment over the specified time window.
|
|
131
|
+
*
|
|
132
|
+
* @param options Assessment configuration options
|
|
133
|
+
* @returns ConjunctionEvent with TCA, miss distance, and probability of collision
|
|
134
|
+
*/
|
|
135
|
+
assess(options: ConjunctionAssessmentOptions): ConjunctionEvent {
|
|
136
|
+
const {
|
|
137
|
+
startTime,
|
|
138
|
+
endTime,
|
|
139
|
+
useHighFidelity = false,
|
|
140
|
+
forceModel,
|
|
141
|
+
propagateCovariance = false,
|
|
142
|
+
tcaTolerance = 0.001 as Seconds,
|
|
143
|
+
searchStepSize = 60.0 as Seconds,
|
|
144
|
+
} = options;
|
|
145
|
+
|
|
146
|
+
// Create propagators based on options
|
|
147
|
+
this.primaryProp = this.primary.propagator ?? this.createPropagator(this.primary, useHighFidelity, forceModel);
|
|
148
|
+
this.secondaryProp =
|
|
149
|
+
this.secondary.propagator ?? this.createPropagator(this.secondary, useHighFidelity, forceModel);
|
|
150
|
+
|
|
151
|
+
// Initialize covariance samples if requested
|
|
152
|
+
if (propagateCovariance) {
|
|
153
|
+
this.initializeCovarianceSamples(useHighFidelity, forceModel);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Find Time of Closest Approach (TCA)
|
|
157
|
+
const tca = this.findTCA(startTime, endTime, searchStepSize, tcaTolerance);
|
|
158
|
+
|
|
159
|
+
// Propagate states to TCA
|
|
160
|
+
const primaryState = this.primaryProp.propagate(tca);
|
|
161
|
+
const secondaryState = this.secondaryProp.propagate(tca);
|
|
162
|
+
|
|
163
|
+
// Compute relative state in RIC frame
|
|
164
|
+
const relativeState = RIC.fromJ2000(secondaryState, primaryState);
|
|
165
|
+
|
|
166
|
+
// Extract RIC components
|
|
167
|
+
const radialDistance = Math.abs(relativeState.position.x) as Kilometers;
|
|
168
|
+
const intrackDistance = Math.abs(relativeState.position.y) as Kilometers;
|
|
169
|
+
const crosstrackDistance = Math.abs(relativeState.position.z) as Kilometers;
|
|
170
|
+
const missDistance = relativeState.range;
|
|
171
|
+
const relativeVelocity = relativeState.velocity.magnitude();
|
|
172
|
+
|
|
173
|
+
// Compute combined covariance and Pc if available
|
|
174
|
+
let combinedCovariance: StateCovariance | undefined;
|
|
175
|
+
let probabilityOfCollision: number | undefined;
|
|
176
|
+
|
|
177
|
+
if (this.primaryCovSample && this.secondaryCovSample && this.primary.radius && this.secondary.radius) {
|
|
178
|
+
// Propagate covariance samples to TCA
|
|
179
|
+
this.primaryCovSample.propagate(tca);
|
|
180
|
+
this.secondaryCovSample.propagate(tca);
|
|
181
|
+
|
|
182
|
+
// Get covariances in RIC frame
|
|
183
|
+
const primaryCov = this.primaryCovSample.covarianceRIC();
|
|
184
|
+
const secondaryCov = this.secondaryCovSample.covarianceRIC();
|
|
185
|
+
|
|
186
|
+
// Combine covariances
|
|
187
|
+
combinedCovariance = ProbabilityOfCollision.combineCovarianceMatrices(primaryCov, secondaryCov);
|
|
188
|
+
|
|
189
|
+
// Calculate probability of collision
|
|
190
|
+
const combinedRadius = (this.primary.radius + this.secondary.radius) as Kilometers;
|
|
191
|
+
|
|
192
|
+
probabilityOfCollision = ProbabilityOfCollision.calculate(
|
|
193
|
+
relativeState.position,
|
|
194
|
+
relativeState.velocity,
|
|
195
|
+
combinedCovariance,
|
|
196
|
+
combinedRadius,
|
|
197
|
+
);
|
|
198
|
+
} else if (this.primary.covariance && this.secondary.covariance && this.primary.radius && this.secondary.radius) {
|
|
199
|
+
// Use provided covariances without propagation
|
|
200
|
+
// Transform to RIC if needed
|
|
201
|
+
let primaryCovRIC = this.primary.covariance;
|
|
202
|
+
let secondaryCovRIC = this.secondary.covariance;
|
|
203
|
+
|
|
204
|
+
if (this.primary.covariance.frame === CovarianceFrame.ECI) {
|
|
205
|
+
primaryCovRIC = this.transformCovarianceToRIC(this.primary.covariance, primaryState);
|
|
206
|
+
}
|
|
207
|
+
if (this.secondary.covariance.frame === CovarianceFrame.ECI) {
|
|
208
|
+
secondaryCovRIC = this.transformCovarianceToRIC(this.secondary.covariance, secondaryState);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
combinedCovariance = ProbabilityOfCollision.combineCovarianceMatrices(primaryCovRIC, secondaryCovRIC);
|
|
212
|
+
|
|
213
|
+
const combinedRadius = (this.primary.radius + this.secondary.radius) as Kilometers;
|
|
214
|
+
|
|
215
|
+
probabilityOfCollision = ProbabilityOfCollision.calculate(
|
|
216
|
+
relativeState.position,
|
|
217
|
+
relativeState.velocity,
|
|
218
|
+
combinedCovariance,
|
|
219
|
+
combinedRadius,
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return new ConjunctionEvent(
|
|
224
|
+
tca,
|
|
225
|
+
primaryState,
|
|
226
|
+
secondaryState,
|
|
227
|
+
relativeState,
|
|
228
|
+
missDistance,
|
|
229
|
+
radialDistance,
|
|
230
|
+
intrackDistance,
|
|
231
|
+
crosstrackDistance,
|
|
232
|
+
relativeVelocity,
|
|
233
|
+
combinedCovariance,
|
|
234
|
+
probabilityOfCollision,
|
|
235
|
+
this.primary.radius,
|
|
236
|
+
this.secondary.radius,
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Finds the Time of Closest Approach (TCA) using golden section search.
|
|
242
|
+
*
|
|
243
|
+
* @param startTime Search window start
|
|
244
|
+
* @param endTime Search window end
|
|
245
|
+
* @param stepSize Initial search step size in seconds
|
|
246
|
+
* @param tolerance TCA search tolerance in seconds
|
|
247
|
+
* @returns TCA epoch
|
|
248
|
+
*/
|
|
249
|
+
private findTCA(startTime: EpochUTC, endTime: EpochUTC, stepSize: Seconds, tolerance: Seconds): EpochUTC {
|
|
250
|
+
// Coarse search to find approximate TCA region
|
|
251
|
+
let minRange = Infinity;
|
|
252
|
+
let minEpoch = startTime;
|
|
253
|
+
let current = startTime;
|
|
254
|
+
|
|
255
|
+
while (current.posix <= endTime.posix) {
|
|
256
|
+
const primary = this.primaryProp.propagate(current);
|
|
257
|
+
const secondary = this.secondaryProp.propagate(current);
|
|
258
|
+
const ric = RIC.fromJ2000(secondary, primary);
|
|
259
|
+
const range = ric.range;
|
|
260
|
+
|
|
261
|
+
if (range < minRange) {
|
|
262
|
+
minRange = range;
|
|
263
|
+
minEpoch = current;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
current = current.roll(stepSize);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Fine search using golden section optimization
|
|
270
|
+
const searchWindow = 2 * stepSize;
|
|
271
|
+
const lowerBound = Math.max(startTime.posix, minEpoch.posix - searchWindow);
|
|
272
|
+
const upperBound = Math.min(endTime.posix, minEpoch.posix + searchWindow);
|
|
273
|
+
|
|
274
|
+
const tcaPosix = GoldenSection.search(
|
|
275
|
+
(posix) => {
|
|
276
|
+
const epoch = new EpochUTC(posix as Seconds);
|
|
277
|
+
const primary = this.primaryProp.propagate(epoch);
|
|
278
|
+
const secondary = this.secondaryProp.propagate(epoch);
|
|
279
|
+
const ric = RIC.fromJ2000(secondary, primary);
|
|
280
|
+
|
|
281
|
+
return ric.range;
|
|
282
|
+
},
|
|
283
|
+
lowerBound,
|
|
284
|
+
upperBound,
|
|
285
|
+
{ tolerance },
|
|
286
|
+
);
|
|
287
|
+
|
|
288
|
+
return new EpochUTC(tcaPosix as Seconds);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Creates a propagator for a space object.
|
|
293
|
+
*
|
|
294
|
+
* @param obj Space object
|
|
295
|
+
* @param useHighFidelity Whether to use high-fidelity propagation
|
|
296
|
+
* @param forceModel Optional force model for numerical propagation
|
|
297
|
+
* @returns Propagator instance
|
|
298
|
+
*/
|
|
299
|
+
private createPropagator(obj: SpaceObject, useHighFidelity: boolean, forceModel?: ForceModel): Propagator {
|
|
300
|
+
if (obj.tle) {
|
|
301
|
+
if (useHighFidelity) {
|
|
302
|
+
// Convert TLE to state and use RK89
|
|
303
|
+
const state = obj.tle.toJ2000();
|
|
304
|
+
const fm = forceModel ?? new ForceModel().setGravity();
|
|
305
|
+
|
|
306
|
+
return new RungeKutta89Propagator(state, fm);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return new Sgp4Propagator(obj.tle);
|
|
310
|
+
} else if (obj.state) {
|
|
311
|
+
if (useHighFidelity) {
|
|
312
|
+
const fm = forceModel ?? new ForceModel().setGravity();
|
|
313
|
+
|
|
314
|
+
return new RungeKutta89Propagator(obj.state, fm);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// For low-fidelity, still use RK89 but with simpler force model
|
|
318
|
+
const fm = new ForceModel().setGravity();
|
|
319
|
+
|
|
320
|
+
return new RungeKutta89Propagator(obj.state, fm);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
throw new Error('Space object must have either a TLE or state vector');
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Initializes covariance samples for both objects.
|
|
328
|
+
*
|
|
329
|
+
* @param useHighFidelity Whether to use high-fidelity propagation
|
|
330
|
+
* @param forceModel Optional force model
|
|
331
|
+
*/
|
|
332
|
+
private initializeCovarianceSamples(useHighFidelity: boolean, forceModel?: ForceModel): void {
|
|
333
|
+
const fm = forceModel ?? new ForceModel().setGravity();
|
|
334
|
+
|
|
335
|
+
// Primary covariance
|
|
336
|
+
if (this.primary.tle) {
|
|
337
|
+
const state = this.primary.tle.toJ2000();
|
|
338
|
+
const covariance =
|
|
339
|
+
this.primary.covariance ??
|
|
340
|
+
StateCovariance.fromSigmas([1.0, 1.0, 1.0, 0.001, 0.001, 0.001], CovarianceFrame.RIC);
|
|
341
|
+
|
|
342
|
+
this.primaryCovSample = new CovarianceSample(state, covariance, this.primary.tle, fm, fm);
|
|
343
|
+
} else if (this.primary.state && this.primary.covariance) {
|
|
344
|
+
this.primaryCovSample = new CovarianceSample(this.primary.state, this.primary.covariance, undefined, fm, fm);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// Secondary covariance
|
|
348
|
+
if (this.secondary.tle) {
|
|
349
|
+
const state = this.secondary.tle.toJ2000();
|
|
350
|
+
const covariance =
|
|
351
|
+
this.secondary.covariance ??
|
|
352
|
+
StateCovariance.fromSigmas([1.0, 1.0, 1.0, 0.001, 0.001, 0.001], CovarianceFrame.RIC);
|
|
353
|
+
|
|
354
|
+
this.secondaryCovSample = new CovarianceSample(state, covariance, this.secondary.tle, fm, fm);
|
|
355
|
+
} else if (this.secondary.state && this.secondary.covariance) {
|
|
356
|
+
this.secondaryCovSample = new CovarianceSample(this.secondary.state, this.secondary.covariance, undefined, fm, fm);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Transforms ECI covariance to RIC frame.
|
|
362
|
+
*
|
|
363
|
+
* @param covariance ECI covariance
|
|
364
|
+
* @param state State vector for RIC frame definition
|
|
365
|
+
* @returns RIC covariance
|
|
366
|
+
*/
|
|
367
|
+
private transformCovarianceToRIC(covariance: StateCovariance, state: J2000): StateCovariance {
|
|
368
|
+
// Create RIC transformation matrix (3x3)
|
|
369
|
+
const ricMatrix = this.createRICTransformMatrix(state.position, state.velocity);
|
|
370
|
+
|
|
371
|
+
// Build 6x6 transformation matrix (block diagonal with 3x3 rotation)
|
|
372
|
+
const transform = this.build6x6Transform(ricMatrix);
|
|
373
|
+
|
|
374
|
+
// Transform covariance: C_ric = T * C_eci * T^T
|
|
375
|
+
const covRIC = transform.multiply(covariance.matrix).multiply(transform.transpose());
|
|
376
|
+
|
|
377
|
+
return new StateCovariance(covRIC, CovarianceFrame.RIC);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Creates the 3x3 RIC transformation matrix.
|
|
382
|
+
*
|
|
383
|
+
* @param position Position vector
|
|
384
|
+
* @param velocity Velocity vector
|
|
385
|
+
* @returns 3x3 RIC transformation matrix
|
|
386
|
+
*/
|
|
387
|
+
private createRICTransformMatrix(position: any, velocity: any): Matrix {
|
|
388
|
+
const ru = position.normalize();
|
|
389
|
+
const cu = position.cross(velocity).normalize();
|
|
390
|
+
const iu = cu.cross(ru).normalize();
|
|
391
|
+
|
|
392
|
+
return new Matrix([
|
|
393
|
+
[ru.x, ru.y, ru.z],
|
|
394
|
+
[iu.x, iu.y, iu.z],
|
|
395
|
+
[cu.x, cu.y, cu.z],
|
|
396
|
+
]);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Builds a 6x6 transformation matrix from a 3x3 rotation matrix.
|
|
401
|
+
*
|
|
402
|
+
* @param rot 3x3 rotation matrix
|
|
403
|
+
* @returns 6x6 transformation matrix
|
|
404
|
+
*/
|
|
405
|
+
private build6x6Transform(rot: Matrix): Matrix {
|
|
406
|
+
const elements = [
|
|
407
|
+
[rot.elements[0][0], rot.elements[0][1], rot.elements[0][2], 0, 0, 0],
|
|
408
|
+
[rot.elements[1][0], rot.elements[1][1], rot.elements[1][2], 0, 0, 0],
|
|
409
|
+
[rot.elements[2][0], rot.elements[2][1], rot.elements[2][2], 0, 0, 0],
|
|
410
|
+
[0, 0, 0, rot.elements[0][0], rot.elements[0][1], rot.elements[0][2]],
|
|
411
|
+
[0, 0, 0, rot.elements[1][0], rot.elements[1][1], rot.elements[1][2]],
|
|
412
|
+
[0, 0, 0, rot.elements[2][0], rot.elements[2][1], rot.elements[2][2]],
|
|
413
|
+
];
|
|
414
|
+
|
|
415
|
+
return new Matrix(elements);
|
|
416
|
+
}
|
|
417
|
+
}
|