ootk 3.0.0 → 4.0.0-0
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/.eslintrc.json +10 -10
- package/CHANGELOG.md +122 -0
- package/README.md +27 -40
- package/lib/coordinate/Hill.d.ts +50 -0
- package/lib/coordinate/Hill.js +214 -0
- package/lib/coordinate/Hill.js.map +1 -0
- package/lib/coordinate/index.d.ts +1 -0
- package/lib/coordinate/index.js +2 -0
- package/lib/coordinate/index.js.map +1 -0
- package/lib/covariance/CovarianceSample.d.ts +44 -0
- package/lib/covariance/CovarianceSample.js +146 -0
- package/lib/covariance/CovarianceSample.js.map +1 -0
- package/lib/covariance/StateCovariance.d.ts +41 -0
- package/lib/covariance/StateCovariance.js +62 -0
- package/lib/covariance/StateCovariance.js.map +1 -0
- package/lib/force/AtmosphericDrag.d.ts +32 -0
- package/lib/force/AtmosphericDrag.js +66 -0
- package/lib/force/AtmosphericDrag.js.map +1 -0
- package/lib/force/EarthGravity.d.ts +28 -0
- package/lib/force/EarthGravity.js +115 -0
- package/lib/force/EarthGravity.js.map +1 -0
- package/{dist/ootk.d.ts → lib/force/Force.d.ts} +10 -10
- package/lib/force/Force.js +30 -0
- package/lib/force/Force.js.map +1 -0
- package/lib/force/ForceModel.d.ts +38 -0
- package/lib/force/ForceModel.js +71 -0
- package/lib/force/ForceModel.js.map +1 -0
- package/lib/force/Gravity.d.ts +41 -0
- package/lib/force/Gravity.js +48 -0
- package/lib/force/Gravity.js.map +1 -0
- package/lib/force/SolarRadiationPressure.d.ts +27 -0
- package/lib/force/SolarRadiationPressure.js +42 -0
- package/lib/force/SolarRadiationPressure.js.map +1 -0
- package/lib/force/ThirdBodyGravity.d.ts +27 -0
- package/lib/force/ThirdBodyGravity.js +56 -0
- package/lib/force/ThirdBodyGravity.js.map +1 -0
- package/lib/force/Thrust.d.ts +35 -0
- package/lib/force/Thrust.js +53 -0
- package/lib/force/Thrust.js.map +1 -0
- package/lib/interpolator/ChebyshevCoefficients.d.ts +54 -0
- package/lib/interpolator/ChebyshevCoefficients.js +90 -0
- package/lib/interpolator/ChebyshevCoefficients.js.map +1 -0
- package/lib/interpolator/ChebyshevInterpolator.d.ts +39 -0
- package/lib/interpolator/ChebyshevInterpolator.js +71 -0
- package/lib/interpolator/ChebyshevInterpolator.js.map +1 -0
- package/lib/interpolator/CubicSpline.d.ts +36 -0
- package/lib/interpolator/CubicSpline.js +64 -0
- package/lib/interpolator/CubicSpline.js.map +1 -0
- package/lib/interpolator/CubicSplineInterpolator.d.ts +37 -0
- package/lib/interpolator/CubicSplineInterpolator.js +78 -0
- package/lib/interpolator/CubicSplineInterpolator.js.map +1 -0
- package/lib/interpolator/FieldInterpolator.d.ts +26 -0
- package/lib/interpolator/FieldInterpolator.js +31 -0
- package/lib/interpolator/FieldInterpolator.js.map +1 -0
- package/lib/interpolator/Interpolator.d.ts +23 -0
- package/lib/interpolator/Interpolator.js +48 -0
- package/lib/interpolator/Interpolator.js.map +1 -0
- package/lib/interpolator/LagrangeInterpolator.d.ts +42 -0
- package/lib/interpolator/LagrangeInterpolator.js +156 -0
- package/lib/interpolator/LagrangeInterpolator.js.map +1 -0
- package/lib/interpolator/StateInterpolator.d.ts +29 -0
- package/lib/interpolator/StateInterpolator.js +37 -0
- package/lib/interpolator/StateInterpolator.js.map +1 -0
- package/lib/interpolator/VerletBlendInterpolator.d.ts +44 -0
- package/lib/interpolator/VerletBlendInterpolator.js +115 -0
- package/lib/interpolator/VerletBlendInterpolator.js.map +1 -0
- package/lib/maneuver/TwoBurnOrbitTransfer.d.ts +43 -0
- package/lib/maneuver/TwoBurnOrbitTransfer.js +62 -0
- package/lib/maneuver/TwoBurnOrbitTransfer.js.map +1 -0
- package/lib/maneuver/Waypoint.d.ts +66 -0
- package/lib/maneuver/Waypoint.js +152 -0
- package/lib/maneuver/Waypoint.js.map +1 -0
- package/lib/objects/DetailedSatellite.d.ts +94 -0
- package/lib/objects/DetailedSatellite.js +140 -0
- package/lib/objects/DetailedSatellite.js.map +1 -0
- package/lib/objects/DetailedSensor.d.ts +43 -0
- package/lib/objects/DetailedSensor.js +45 -0
- package/lib/objects/DetailedSensor.js.map +1 -0
- package/{dist/objects/space-object.d.ts → lib/objects/LandObject.d.ts} +19 -21
- package/lib/objects/LandObject.js +28 -0
- package/lib/objects/LandObject.js.map +1 -0
- package/lib/objects/Marker.d.ts +21 -0
- package/lib/objects/Marker.js +25 -0
- package/lib/objects/Marker.js.map +1 -0
- package/lib/objects/index.d.ts +5 -4
- package/lib/objects/index.js +5 -4
- package/lib/objects/index.js.map +1 -1
- package/lib/observation/Observation.d.ts +51 -0
- package/lib/observation/Observation.js +71 -0
- package/lib/observation/Observation.js.map +1 -0
- package/lib/observation/ObservationOptical.d.ts +47 -0
- package/lib/observation/ObservationOptical.js +101 -0
- package/lib/observation/ObservationOptical.js.map +1 -0
- package/lib/observation/ObservationRadar.d.ts +43 -0
- package/lib/observation/ObservationRadar.js +90 -0
- package/lib/observation/ObservationRadar.js.map +1 -0
- package/lib/observation/ObservationUtils.d.ts +21 -0
- package/lib/observation/ObservationUtils.js +33 -0
- package/lib/observation/ObservationUtils.js.map +1 -0
- package/lib/observation/PropagatorPairs.d.ts +31 -0
- package/lib/observation/PropagatorPairs.js +40 -0
- package/lib/observation/PropagatorPairs.js.map +1 -0
- package/lib/ootk.d.ts +10 -8
- package/lib/ootk.js +10 -8
- package/lib/ootk.js.map +1 -1
- package/lib/operations/BoxMuller.d.ts +41 -0
- package/lib/operations/BoxMuller.js +66 -0
- package/lib/operations/BoxMuller.js.map +1 -0
- package/lib/operations/EulerAngles.d.ts +50 -0
- package/lib/operations/EulerAngles.js +111 -0
- package/lib/operations/EulerAngles.js.map +1 -0
- package/lib/operations/Quaternion.d.ts +57 -0
- package/lib/operations/Quaternion.js +164 -0
- package/lib/operations/Quaternion.js.map +1 -0
- package/lib/operations/RandomGaussianSource.d.ts +25 -0
- package/lib/operations/RandomGaussianSource.js +43 -0
- package/lib/operations/RandomGaussianSource.js.map +1 -0
- package/lib/operations/index.d.ts +4 -0
- package/lib/operations/index.js +5 -0
- package/lib/operations/index.js.map +1 -0
- package/lib/optimize/ChebyshevCompressor.d.ts +31 -0
- package/lib/optimize/ChebyshevCompressor.js +80 -0
- package/lib/optimize/ChebyshevCompressor.js.map +1 -0
- package/lib/optimize/DownhillSimplex.d.ts +50 -0
- package/lib/optimize/DownhillSimplex.js +168 -0
- package/lib/optimize/DownhillSimplex.js.map +1 -0
- package/lib/optimize/GoldenSection.d.ts +33 -0
- package/lib/optimize/GoldenSection.js +49 -0
- package/lib/optimize/GoldenSection.js.map +1 -0
- package/lib/optimize/PolynomialRegression.d.ts +37 -0
- package/lib/optimize/PolynomialRegression.js +66 -0
- package/lib/optimize/PolynomialRegression.js.map +1 -0
- package/lib/optimize/PolynomicalRegressionResult.d.ts +28 -0
- package/lib/optimize/PolynomicalRegressionResult.js +32 -0
- package/lib/optimize/PolynomicalRegressionResult.js.map +1 -0
- package/lib/optimize/SimpleLinearRegression.d.ts +41 -0
- package/lib/optimize/SimpleLinearRegression.js +107 -0
- package/lib/optimize/SimpleLinearRegression.js.map +1 -0
- package/lib/optimize/SimplexEntry.d.ts +33 -0
- package/lib/optimize/SimplexEntry.js +39 -0
- package/lib/optimize/SimplexEntry.js.map +1 -0
- package/lib/orbit_determination/BatchLeastSquaresOD.d.ts +54 -0
- package/lib/orbit_determination/BatchLeastSquaresOD.js +118 -0
- package/lib/orbit_determination/BatchLeastSquaresOD.js.map +1 -0
- package/lib/orbit_determination/BatchLeastSquaresResult.d.ts +29 -0
- package/lib/orbit_determination/BatchLeastSquaresResult.js +31 -0
- package/lib/orbit_determination/BatchLeastSquaresResult.js.map +1 -0
- package/lib/orbit_determination/GibbsIOD.d.ts +33 -0
- package/lib/orbit_determination/GibbsIOD.js +70 -0
- package/lib/orbit_determination/GibbsIOD.js.map +1 -0
- package/lib/orbit_determination/GoodingIOD.d.ts +52 -0
- package/lib/orbit_determination/GoodingIOD.js +244 -0
- package/lib/orbit_determination/GoodingIOD.js.map +1 -0
- package/lib/{objects/space-object.d.ts → orbit_determination/HerrickGibbsIOD.d.ts} +17 -22
- package/lib/orbit_determination/HerrickGibbsIOD.js +49 -0
- package/lib/orbit_determination/HerrickGibbsIOD.js.map +1 -0
- package/lib/orbit_determination/LambertIOD.d.ts +46 -0
- package/lib/orbit_determination/LambertIOD.js +199 -0
- package/lib/orbit_determination/LambertIOD.js.map +1 -0
- package/lib/orbit_determination/ModifiedGoodingIOD.d.ts +41 -0
- package/lib/orbit_determination/ModifiedGoodingIOD.js +82 -0
- package/lib/orbit_determination/ModifiedGoodingIOD.js.map +1 -0
- package/lib/propagator/DormandPrince54Propagator.d.ts +29 -0
- package/lib/propagator/DormandPrince54Propagator.js +68 -0
- package/lib/propagator/DormandPrince54Propagator.js.map +1 -0
- package/lib/propagator/KeplerPropagator.d.ts +36 -0
- package/lib/propagator/KeplerPropagator.js +81 -0
- package/lib/propagator/KeplerPropagator.js.map +1 -0
- package/lib/propagator/Propagator.d.ts +35 -0
- package/lib/propagator/Propagator.js +163 -0
- package/lib/propagator/Propagator.js.map +1 -0
- package/lib/propagator/RkCheckpoint.d.ts +23 -0
- package/lib/propagator/RkCheckpoint.js +26 -0
- package/lib/propagator/RkCheckpoint.js.map +1 -0
- package/lib/propagator/RkResult.d.ts +24 -0
- package/lib/propagator/RkResult.js +28 -0
- package/lib/propagator/RkResult.js.map +1 -0
- package/lib/propagator/RungeKutta4Propagator.d.ts +46 -0
- package/lib/propagator/RungeKutta4Propagator.js +132 -0
- package/lib/propagator/RungeKutta4Propagator.js.map +1 -0
- package/lib/propagator/RungeKutta89Propagator.d.ts +29 -0
- package/lib/propagator/RungeKutta89Propagator.js +130 -0
- package/lib/propagator/RungeKutta89Propagator.js.map +1 -0
- package/lib/propagator/RungeKuttaAdaptive.d.ts +52 -0
- package/lib/propagator/RungeKuttaAdaptive.js +152 -0
- package/lib/propagator/RungeKuttaAdaptive.js.map +1 -0
- package/lib/propagator/Sgp4Propagator.d.ts +35 -0
- package/lib/propagator/Sgp4Propagator.js +55 -0
- package/lib/propagator/Sgp4Propagator.js.map +1 -0
- package/lib/smoothing/ExponentialSmoothing.d.ts +24 -0
- package/lib/smoothing/ExponentialSmoothing.js +82 -0
- package/lib/smoothing/ExponentialSmoothing.js.map +1 -0
- package/lib/types/types.d.ts +65 -584
- package/lib/types/types.js +21 -33
- package/lib/types/types.js.map +1 -1
- package/package.json +16 -14
- package/.prettierrc +0 -17
- package/babel.config.js +0 -16
- package/codecov.yml +0 -21
- package/dist/objects/base-object.d.ts +0 -40
- package/dist/objects/detailed-sat.d.ts +0 -66
- package/dist/objects/index.d.ts +0 -4
- package/dist/objects/sat.d.ts +0 -92
- package/dist/objects/sensor.d.ts +0 -93
- package/dist/objects/star.d.ts +0 -46
- package/dist/ootk.js +0 -2
- package/dist/ootk.js.LICENSE.txt +0 -77
- package/dist/sgp4/sgp4.d.ts +0 -82
- package/dist/tle/tle-format-data.d.ts +0 -6
- package/dist/tle/tle.d.ts +0 -375
- package/dist/transforms/transforms.d.ts +0 -94
- package/dist/types/types.d.ts +0 -605
- package/dist/utils/constants.d.ts +0 -34
- package/dist/utils/moon-math.d.ts +0 -113
- package/dist/utils/sun-math.d.ts +0 -230
- package/dist/utils/utils.d.ts +0 -39
- package/lib/objects/base-object.d.ts +0 -40
- package/lib/objects/base-object.js +0 -79
- package/lib/objects/base-object.js.map +0 -1
- package/lib/objects/detailed-sat.d.ts +0 -66
- package/lib/objects/detailed-sat.js +0 -149
- package/lib/objects/detailed-sat.js.map +0 -1
- package/lib/objects/sat.d.ts +0 -92
- package/lib/objects/sat.js +0 -188
- package/lib/objects/sat.js.map +0 -1
- package/lib/objects/sensor.d.ts +0 -93
- package/lib/objects/sensor.js +0 -273
- package/lib/objects/sensor.js.map +0 -1
- package/lib/objects/space-object.js +0 -60
- package/lib/objects/space-object.js.map +0 -1
- package/lib/objects/star.d.ts +0 -46
- package/lib/objects/star.js +0 -91
- package/lib/objects/star.js.map +0 -1
- package/lib/sgp4/sgp4.d.ts +0 -82
- package/lib/sgp4/sgp4.js +0 -3262
- package/lib/sgp4/sgp4.js.map +0 -1
- package/lib/tle/tle-format-data.d.ts +0 -6
- package/lib/tle/tle-format-data.js +0 -10
- package/lib/tle/tle-format-data.js.map +0 -1
- package/lib/tle/tle.d.ts +0 -375
- package/lib/tle/tle.js +0 -611
- package/lib/tle/tle.js.map +0 -1
- package/lib/transforms/transforms.d.ts +0 -94
- package/lib/transforms/transforms.js +0 -308
- package/lib/transforms/transforms.js.map +0 -1
- package/lib/utils/constants.d.ts +0 -34
- package/lib/utils/constants.js +0 -35
- package/lib/utils/constants.js.map +0 -1
- package/lib/utils/moon-math.d.ts +0 -113
- package/lib/utils/moon-math.js +0 -387
- package/lib/utils/moon-math.js.map +0 -1
- package/lib/utils/sun-math.d.ts +0 -230
- package/lib/utils/sun-math.js +0 -422
- package/lib/utils/sun-math.js.map +0 -1
- package/lib/utils/utils.d.ts +0 -39
- package/lib/utils/utils.js +0 -102
- package/lib/utils/utils.js.map +0 -1
- package/sandbox.html +0 -8
- package/tsconfig.base.json +0 -31
- package/tsconfig.build.json +0 -14
- /package/{LICENSE.MD → LICENSE.md} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
*
|
|
4
|
+
* @license AGPL-3.0-or-later
|
|
5
|
+
* @Copyright (c) 2020-2024 Theodore Kruczek
|
|
6
|
+
*
|
|
7
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
8
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
9
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
12
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
+
* See the GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
16
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { EpochUTC, EpochWindow, J2000 } from 'ootk-core';
|
|
19
|
+
import { ChebyshevCoefficients } from './ChebyshevCoefficients';
|
|
20
|
+
import { StateInterpolator } from './StateInterpolator';
|
|
21
|
+
/**
|
|
22
|
+
* Compressed Chebyshev ephemeris interpolator.
|
|
23
|
+
*
|
|
24
|
+
* The ChebyshevInterpolator sacrifices state accuracy in order to gain
|
|
25
|
+
* speed and memory requirements, so you can store many ephemerides in RAM
|
|
26
|
+
* and interpolate through them quickly.
|
|
27
|
+
*
|
|
28
|
+
* Using more coefficients per revolution during lossy compression results
|
|
29
|
+
* in increased accuracy and decreased performance.
|
|
30
|
+
*/
|
|
31
|
+
export declare class ChebyshevInterpolator extends StateInterpolator {
|
|
32
|
+
private _coefficients;
|
|
33
|
+
constructor(coefficients: ChebyshevCoefficients[]);
|
|
34
|
+
private _calcSizeBytes;
|
|
35
|
+
get sizeBytes(): number;
|
|
36
|
+
interpolate(epoch: EpochUTC): J2000 | null;
|
|
37
|
+
window(): EpochWindow;
|
|
38
|
+
private _matchCoefficients;
|
|
39
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
*
|
|
4
|
+
* @license AGPL-3.0-or-later
|
|
5
|
+
* @Copyright (c) 2020-2024 Theodore Kruczek
|
|
6
|
+
*
|
|
7
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
8
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
9
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
12
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
+
* See the GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
16
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { EpochUTC, EpochWindow, J2000 } from 'ootk-core';
|
|
19
|
+
import { StateInterpolator } from './StateInterpolator';
|
|
20
|
+
/**
|
|
21
|
+
* Compressed Chebyshev ephemeris interpolator.
|
|
22
|
+
*
|
|
23
|
+
* The ChebyshevInterpolator sacrifices state accuracy in order to gain
|
|
24
|
+
* speed and memory requirements, so you can store many ephemerides in RAM
|
|
25
|
+
* and interpolate through them quickly.
|
|
26
|
+
*
|
|
27
|
+
* Using more coefficients per revolution during lossy compression results
|
|
28
|
+
* in increased accuracy and decreased performance.
|
|
29
|
+
*/
|
|
30
|
+
export class ChebyshevInterpolator extends StateInterpolator {
|
|
31
|
+
constructor(coefficients) {
|
|
32
|
+
super();
|
|
33
|
+
this._coefficients = coefficients;
|
|
34
|
+
}
|
|
35
|
+
_calcSizeBytes() {
|
|
36
|
+
let output = 0;
|
|
37
|
+
for (const coeffs of this._coefficients) {
|
|
38
|
+
output += coeffs.sizeBytes;
|
|
39
|
+
}
|
|
40
|
+
return output;
|
|
41
|
+
}
|
|
42
|
+
get sizeBytes() {
|
|
43
|
+
return this._calcSizeBytes();
|
|
44
|
+
}
|
|
45
|
+
interpolate(epoch) {
|
|
46
|
+
if (!this.inWindow(epoch)) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const coeffs = this._matchCoefficients(epoch.posix);
|
|
50
|
+
const { position: pos, velocity: vel } = coeffs.interpolate(epoch.posix);
|
|
51
|
+
return new J2000(epoch, pos, vel);
|
|
52
|
+
}
|
|
53
|
+
window() {
|
|
54
|
+
return new EpochWindow(new EpochUTC(this._coefficients[0].a), new EpochUTC(this._coefficients[this._coefficients.length - 1].b));
|
|
55
|
+
}
|
|
56
|
+
_matchCoefficients(posix) {
|
|
57
|
+
let left = 0;
|
|
58
|
+
let right = this._coefficients.length;
|
|
59
|
+
while (left < right) {
|
|
60
|
+
const middle = (left + right) >> 1;
|
|
61
|
+
if (this._coefficients[middle].b < posix) {
|
|
62
|
+
left = middle + 1;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
right = middle;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return this._coefficients[left];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=ChebyshevInterpolator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChebyshevInterpolator.js","sourceRoot":"","sources":["../../src/interpolator/ChebyshevInterpolator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;;;;;;GASG;AACH,MAAM,OAAO,qBAAsB,SAAQ,iBAAiB;IAG1D,YAAY,YAAqC;QAC/C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACpC,CAAC;IAEO,cAAc;QACpB,IAAI,MAAM,GAAG,CAAC,CAAC;QAEf,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,aAAa,EAAE;YACvC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC;SAC5B;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;IAC/B,CAAC;IAED,WAAW,CAAC,KAAe;QACzB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACzB,OAAO,IAAI,CAAC;SACb;QACD,MA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can redistribute it and/or modify it under the
|
|
8
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
9
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
12
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
+
* See the GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
16
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { Vector3D } from 'ootk-core';
|
|
19
|
+
export declare class CubicSpline {
|
|
20
|
+
t0: number;
|
|
21
|
+
p0: Vector3D;
|
|
22
|
+
m0: Vector3D;
|
|
23
|
+
t1: number;
|
|
24
|
+
p1: Vector3D;
|
|
25
|
+
m1: Vector3D;
|
|
26
|
+
constructor(t0: number, p0: Vector3D, m0: Vector3D, t1: number, p1: Vector3D, m1: Vector3D);
|
|
27
|
+
private _position;
|
|
28
|
+
private _velocity;
|
|
29
|
+
/**
|
|
30
|
+
* Interpolates the position and velocity at a given time.
|
|
31
|
+
* (km) and velocity (km/s) vectors at the provided time.
|
|
32
|
+
* @param t The time value to interpolate at _(POSIX seconds)_.
|
|
33
|
+
* @returns An array containing the interpolated position and velocity as Vector3D objects.
|
|
34
|
+
*/
|
|
35
|
+
interpolate(t: number): Vector3D[];
|
|
36
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
*
|
|
4
|
+
* @license AGPL-3.0-or-later
|
|
5
|
+
* @Copyright (c) 2020-2024 Theodore Kruczek
|
|
6
|
+
*
|
|
7
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
8
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
9
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
12
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
+
* See the GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
16
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
// / Container for cubic spline data.
|
|
19
|
+
export class CubicSpline {
|
|
20
|
+
// / Create a new [CubicSpline] object.
|
|
21
|
+
constructor(t0, p0, m0, t1, p1, m1) {
|
|
22
|
+
this.t0 = t0;
|
|
23
|
+
this.p0 = p0;
|
|
24
|
+
this.m0 = m0;
|
|
25
|
+
this.t1 = t1;
|
|
26
|
+
this.p1 = p1;
|
|
27
|
+
this.m1 = m1;
|
|
28
|
+
// Nothing to do here.
|
|
29
|
+
}
|
|
30
|
+
// / Interpolate position at the provided time [t] _(POSIX seconds)_.
|
|
31
|
+
_position(t) {
|
|
32
|
+
const t2 = t * t;
|
|
33
|
+
const t3 = t2 * t;
|
|
34
|
+
const r0 = this.p0.scale(2 * t3 - 3 * t2 + 1);
|
|
35
|
+
const v0 = this.m0.scale((t3 - 2 * t2 + t) * (this.t1 - this.t0));
|
|
36
|
+
const r1 = this.p1.scale(-2 * t3 + 3 * t2);
|
|
37
|
+
const v1 = this.m1.scale((t3 - t2) * (this.t1 - this.t0));
|
|
38
|
+
return r0.add(v0).add(r1).add(v1);
|
|
39
|
+
}
|
|
40
|
+
// / Interpolate velocity at the provided time [t] _(POSIX seconds)_.
|
|
41
|
+
_velocity(t) {
|
|
42
|
+
const t2 = t * t;
|
|
43
|
+
const r0 = this.p0.scale(6 * t2 - 6 * t);
|
|
44
|
+
const v0 = this.m0.scale((3 * t2 - 4 * t + 1) * (this.t1 - this.t0));
|
|
45
|
+
const r1 = this.p1.scale(-6 * t2 + 6 * t);
|
|
46
|
+
const v1 = this.m1.scale((3 * t2 - 2 * t) * (this.t1 - this.t0));
|
|
47
|
+
return r0
|
|
48
|
+
.add(v0)
|
|
49
|
+
.add(r1)
|
|
50
|
+
.add(v1)
|
|
51
|
+
.scale(1 / (this.t1 - this.t0));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Interpolates the position and velocity at a given time.
|
|
55
|
+
* (km) and velocity (km/s) vectors at the provided time.
|
|
56
|
+
* @param t The time value to interpolate at _(POSIX seconds)_.
|
|
57
|
+
* @returns An array containing the interpolated position and velocity as Vector3D objects.
|
|
58
|
+
*/
|
|
59
|
+
interpolate(t) {
|
|
60
|
+
const n = (t - this.t0) / (this.t1 - this.t0);
|
|
61
|
+
return [this._position(n), this._velocity(n)];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=CubicSpline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubicSpline.js","sourceRoot":"","sources":["../../src/interpolator/CubicSpline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,qCAAqC;AACrC,MAAM,OAAO,WAAW;IACtB,uCAAuC;IACvC,YACS,EAAU,EACV,EAAY,EACZ,EAAY,EACZ,EAAU,EACV,EAAY,EACZ,EAAY;QALZ,OAAE,GAAF,EAAE,CAAQ;QACV,OAAE,GAAF,EAAE,CAAU;QACZ,OAAE,GAAF,EAAE,CAAU;QACZ,OAAE,GAAF,EAAE,CAAQ;QACV,OAAE,GAAF,EAAE,CAAU;QACZ,OAAE,GAAF,EAAE,CAAU;QAEnB,sBAAsB;IACxB,CAAC;IAED,qEAAqE;IAC7D,SAAS,CAAC,CAAS;QACzB,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAClB,MAAM,EAAE,GAAG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AM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAEjE,OAAO,EAAE;aACN,GAAG,CAAC,EAAE,CAAC;aACP,GAAG,CAAC,EAAE,CAAC;aACP,GAAG,CAAC,EAAE,CAAC;aACP,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,CAAS;QACnB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;QAE9C,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,CAAC;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
*
|
|
4
|
+
* @license AGPL-3.0-or-later
|
|
5
|
+
* @Copyright (c) 2020-2024 Theodore Kruczek
|
|
6
|
+
*
|
|
7
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
8
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
9
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
12
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
+
* See the GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
16
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { EpochUTC, EpochWindow, J2000 } from 'ootk-core';
|
|
19
|
+
import { CubicSpline } from './CubicSpline';
|
|
20
|
+
import { StateInterpolator } from './StateInterpolator';
|
|
21
|
+
/**
|
|
22
|
+
* Cubic spline ephemeris interpolator.
|
|
23
|
+
*
|
|
24
|
+
* The [CubicSplineInterpolator] is a very fast and accurate interpolator
|
|
25
|
+
* at the expense of memory due to the cached spline pairs used in the
|
|
26
|
+
* interpolation operation. Accuracy is significantly impacted when using
|
|
27
|
+
* sparse ephemerides.
|
|
28
|
+
*/
|
|
29
|
+
export declare class CubicSplineInterpolator extends StateInterpolator {
|
|
30
|
+
private _splines;
|
|
31
|
+
constructor(_splines: CubicSpline[]);
|
|
32
|
+
static fromEphemeris(ephemeris: J2000[]): CubicSplineInterpolator;
|
|
33
|
+
get sizeBytes(): number;
|
|
34
|
+
private _matchSpline;
|
|
35
|
+
interpolate(epoch: EpochUTC): J2000 | null;
|
|
36
|
+
window(): EpochWindow;
|
|
37
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
*
|
|
4
|
+
* @license AGPL-3.0-or-later
|
|
5
|
+
* @Copyright (c) 2020-2024 Theodore Kruczek
|
|
6
|
+
*
|
|
7
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
8
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
9
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
12
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
+
* See the GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
16
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { EpochUTC, EpochWindow, J2000 } from 'ootk-core';
|
|
19
|
+
import { CubicSpline } from './CubicSpline';
|
|
20
|
+
import { StateInterpolator } from './StateInterpolator';
|
|
21
|
+
/**
|
|
22
|
+
* Cubic spline ephemeris interpolator.
|
|
23
|
+
*
|
|
24
|
+
* The [CubicSplineInterpolator] is a very fast and accurate interpolator
|
|
25
|
+
* at the expense of memory due to the cached spline pairs used in the
|
|
26
|
+
* interpolation operation. Accuracy is significantly impacted when using
|
|
27
|
+
* sparse ephemerides.
|
|
28
|
+
*/
|
|
29
|
+
export class CubicSplineInterpolator extends StateInterpolator {
|
|
30
|
+
constructor(_splines) {
|
|
31
|
+
super();
|
|
32
|
+
this._splines = _splines;
|
|
33
|
+
}
|
|
34
|
+
static fromEphemeris(ephemeris) {
|
|
35
|
+
const splines = [];
|
|
36
|
+
for (let i = 0; i < ephemeris.length - 1; i++) {
|
|
37
|
+
const e0 = ephemeris[i];
|
|
38
|
+
const t0 = e0.epoch.posix;
|
|
39
|
+
const p0 = e0.position;
|
|
40
|
+
const m0 = e0.velocity;
|
|
41
|
+
const e1 = ephemeris[i + 1];
|
|
42
|
+
const t1 = e1.epoch.posix;
|
|
43
|
+
const p1 = e1.position;
|
|
44
|
+
const m1 = e1.velocity;
|
|
45
|
+
splines.push(new CubicSpline(t0, p0, m0, t1, p1, m1));
|
|
46
|
+
}
|
|
47
|
+
return new CubicSplineInterpolator(splines);
|
|
48
|
+
}
|
|
49
|
+
get sizeBytes() {
|
|
50
|
+
return (64 * 14 * this._splines.length) / 8;
|
|
51
|
+
}
|
|
52
|
+
_matchSpline(posix) {
|
|
53
|
+
let left = 0;
|
|
54
|
+
let right = this._splines.length;
|
|
55
|
+
while (left < right) {
|
|
56
|
+
const middle = (left + right) >> 1;
|
|
57
|
+
if (this._splines[middle].t1 < posix) {
|
|
58
|
+
left = middle + 1;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
right = middle;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return this._splines[left];
|
|
65
|
+
}
|
|
66
|
+
interpolate(epoch) {
|
|
67
|
+
if (!this.inWindow(epoch)) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const posix = epoch.posix;
|
|
71
|
+
const splineVecs = this._matchSpline(posix).interpolate(posix);
|
|
72
|
+
return new J2000(epoch, splineVecs[0], splineVecs[1]);
|
|
73
|
+
}
|
|
74
|
+
window() {
|
|
75
|
+
return new EpochWindow(new EpochUTC(this._splines[0].t0), new EpochUTC(this._splines[this._splines.length - 1].t1));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=CubicSplineInterpolator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubicSplineInterpolator.js","sourceRoot":"","sources":["../../src/interpolator/CubicSplineInterpolator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iBAAiB;IAC5D,YAAoB,QAAuB;QACzC,KAAK,EAAE,CAAC;QADU,aAAQ,GAAR,QAAQ,CAAe;IAE3C,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,SAAkB;QACrC,MAAM,OAAO,GAAkB,EAAE,CAAC;QAElC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAC7C,MAAM,EAAE,GAAG,SAAS,CAAC,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QACzB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACzB,OAAO,IAAI,CAAC;SACb;QACD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAE/D,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,WAAW,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtH,CAAC;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
*
|
|
4
|
+
* @license AGPL-3.0-or-later
|
|
5
|
+
* @Copyright (c) 2020-2024 Theodore Kruczek
|
|
6
|
+
*
|
|
7
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
8
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
9
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
12
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
+
* See the GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
16
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { Interpolator } from './Interpolator';
|
|
19
|
+
export declare abstract class FieldInterpolator extends Interpolator {
|
|
20
|
+
Float64List?: any;
|
|
21
|
+
/**
|
|
22
|
+
* Interpolate field values at the provided [epoch].
|
|
23
|
+
* @returns Returns `null` if the epoch is outside the cached field range.
|
|
24
|
+
*/
|
|
25
|
+
interpolate(final: any, EpochUTC: any, epoch: any): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
*
|
|
4
|
+
* @license AGPL-3.0-or-later
|
|
5
|
+
* @Copyright (c) 2020-2024 Theodore Kruczek
|
|
6
|
+
*
|
|
7
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
8
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
9
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
12
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
+
* See the GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
16
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
19
|
+
/* eslint-disable class-methods-use-this */
|
|
20
|
+
import { Interpolator } from './Interpolator';
|
|
21
|
+
// / Base class for arbitrary field interpolators.
|
|
22
|
+
export class FieldInterpolator extends Interpolator {
|
|
23
|
+
/**
|
|
24
|
+
* Interpolate field values at the provided [epoch].
|
|
25
|
+
* @returns Returns `null` if the epoch is outside the cached field range.
|
|
26
|
+
*/
|
|
27
|
+
interpolate(final, EpochUTC, epoch) {
|
|
28
|
+
throw new Error('Method not implemented.');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=FieldInterpolator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldInterpolator.js","sourceRoot":"","sources":["../../src/interpolator/FieldInterpolator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,sDAAsD;AACtD,2CAA2C;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,kDAAkD;AAClD,MAAM,OAAgB,iBAAkB,SAAQ,YAAY;IAG1D;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK;QAChC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
*
|
|
4
|
+
* @license AGPL-3.0-or-later
|
|
5
|
+
* @Copyright (c) 2020-2024 Theodore Kruczek
|
|
6
|
+
*
|
|
7
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
8
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
9
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
12
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
+
* See the GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
16
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { EpochUTC, EpochWindow } from 'ootk-core';
|
|
19
|
+
export declare abstract class Interpolator {
|
|
20
|
+
abstract window(): EpochWindow;
|
|
21
|
+
inWindow(epoch: EpochUTC): boolean;
|
|
22
|
+
overlap(interpolator: Interpolator): EpochWindow | null;
|
|
23
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
*
|
|
4
|
+
* @license AGPL-3.0-or-later
|
|
5
|
+
* @Copyright (c) 2020-2024 Theodore Kruczek
|
|
6
|
+
*
|
|
7
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
8
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
9
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
12
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
+
* See the GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
16
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { EpochUTC, EpochWindow } from 'ootk-core';
|
|
19
|
+
// / Interpolator base class.
|
|
20
|
+
export class Interpolator {
|
|
21
|
+
/*
|
|
22
|
+
* Return `true` if the provided [epoch] is within this interpolator's
|
|
23
|
+
* cached value range.
|
|
24
|
+
*/
|
|
25
|
+
inWindow(epoch) {
|
|
26
|
+
const start = this.window().start;
|
|
27
|
+
const stop = this.window().end;
|
|
28
|
+
return start <= epoch && epoch <= stop;
|
|
29
|
+
}
|
|
30
|
+
/*
|
|
31
|
+
* Calculate the start/stop epoch between this and another [Interpolator].
|
|
32
|
+
*
|
|
33
|
+
* Returns `null` if there is no overlap between interpolators.
|
|
34
|
+
*/
|
|
35
|
+
overlap(interpolator) {
|
|
36
|
+
const x1 = this.window().start;
|
|
37
|
+
const x2 = this.window().end;
|
|
38
|
+
const y1 = interpolator.window().start;
|
|
39
|
+
const y2 = interpolator.window().end;
|
|
40
|
+
if (x1 <= y2 && y1 <= x2) {
|
|
41
|
+
const e1 = new EpochUTC(Math.max(x1.posix, y1.posix));
|
|
42
|
+
const e2 = new EpochUTC(Math.min(x2.posix, y2.posix));
|
|
43
|
+
return new EpochWindow(e1, e2);
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=Interpolator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Interpolator.js","sourceRoot":"","sources":["../../src/interpolator/Interpolator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,6BAA6B;AAC7B,MAAM,OAAgB,YAAY;IAIhC;;;OAGG;IACH,QAAQ,CAAC,KAAe;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC;QAClC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC;QAE/B,OAAO,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,IAAI,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,YAA0B;QAChC,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC;QAC/B,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC;QACvC,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC;QAErC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;YACxB,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;YACtD,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;YAEtD,OAAO,IAAI,WAAW,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;SAChC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
*
|
|
4
|
+
* @license AGPL-3.0-or-later
|
|
5
|
+
* @Copyright (c) 2020-2024 Theodore Kruczek
|
|
6
|
+
*
|
|
7
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
8
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
9
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
12
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
+
* See the GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
16
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { EpochUTC, EpochWindow, J2000 } from 'ootk-core';
|
|
19
|
+
import { StateInterpolator } from './StateInterpolator';
|
|
20
|
+
export declare class LagrangeInterpolator extends StateInterpolator {
|
|
21
|
+
private _t;
|
|
22
|
+
private _x;
|
|
23
|
+
private _y;
|
|
24
|
+
private _z;
|
|
25
|
+
private order;
|
|
26
|
+
constructor(t: Float64Array, x: Float64Array, y: Float64Array, z: Float64Array, order?: number);
|
|
27
|
+
/**
|
|
28
|
+
* Creates a LagrangeInterpolator from an array of J2000 ephemeris data.
|
|
29
|
+
*
|
|
30
|
+
* @param ephemeris - The array of J2000 ephemeris data.
|
|
31
|
+
* @param order - The order of the LagrangeInterpolator. Default is 10.
|
|
32
|
+
* @returns A new LagrangeInterpolator instance.
|
|
33
|
+
*/
|
|
34
|
+
static fromEphemeris(ephemeris: J2000[], order?: number): LagrangeInterpolator;
|
|
35
|
+
get sizeBytes(): number;
|
|
36
|
+
interpolate(epoch: EpochUTC): J2000 | null;
|
|
37
|
+
private static _position;
|
|
38
|
+
private static _velocity;
|
|
39
|
+
private static _getClosest;
|
|
40
|
+
private _slice;
|
|
41
|
+
window(): EpochWindow;
|
|
42
|
+
}
|