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.
Files changed (261) hide show
  1. package/.eslintrc.json +10 -10
  2. package/CHANGELOG.md +122 -0
  3. package/README.md +27 -40
  4. package/lib/coordinate/Hill.d.ts +50 -0
  5. package/lib/coordinate/Hill.js +214 -0
  6. package/lib/coordinate/Hill.js.map +1 -0
  7. package/lib/coordinate/index.d.ts +1 -0
  8. package/lib/coordinate/index.js +2 -0
  9. package/lib/coordinate/index.js.map +1 -0
  10. package/lib/covariance/CovarianceSample.d.ts +44 -0
  11. package/lib/covariance/CovarianceSample.js +146 -0
  12. package/lib/covariance/CovarianceSample.js.map +1 -0
  13. package/lib/covariance/StateCovariance.d.ts +41 -0
  14. package/lib/covariance/StateCovariance.js +62 -0
  15. package/lib/covariance/StateCovariance.js.map +1 -0
  16. package/lib/force/AtmosphericDrag.d.ts +32 -0
  17. package/lib/force/AtmosphericDrag.js +66 -0
  18. package/lib/force/AtmosphericDrag.js.map +1 -0
  19. package/lib/force/EarthGravity.d.ts +28 -0
  20. package/lib/force/EarthGravity.js +115 -0
  21. package/lib/force/EarthGravity.js.map +1 -0
  22. package/{dist/ootk.d.ts → lib/force/Force.d.ts} +10 -10
  23. package/lib/force/Force.js +30 -0
  24. package/lib/force/Force.js.map +1 -0
  25. package/lib/force/ForceModel.d.ts +38 -0
  26. package/lib/force/ForceModel.js +71 -0
  27. package/lib/force/ForceModel.js.map +1 -0
  28. package/lib/force/Gravity.d.ts +41 -0
  29. package/lib/force/Gravity.js +48 -0
  30. package/lib/force/Gravity.js.map +1 -0
  31. package/lib/force/SolarRadiationPressure.d.ts +27 -0
  32. package/lib/force/SolarRadiationPressure.js +42 -0
  33. package/lib/force/SolarRadiationPressure.js.map +1 -0
  34. package/lib/force/ThirdBodyGravity.d.ts +27 -0
  35. package/lib/force/ThirdBodyGravity.js +56 -0
  36. package/lib/force/ThirdBodyGravity.js.map +1 -0
  37. package/lib/force/Thrust.d.ts +35 -0
  38. package/lib/force/Thrust.js +53 -0
  39. package/lib/force/Thrust.js.map +1 -0
  40. package/lib/interpolator/ChebyshevCoefficients.d.ts +54 -0
  41. package/lib/interpolator/ChebyshevCoefficients.js +90 -0
  42. package/lib/interpolator/ChebyshevCoefficients.js.map +1 -0
  43. package/lib/interpolator/ChebyshevInterpolator.d.ts +39 -0
  44. package/lib/interpolator/ChebyshevInterpolator.js +71 -0
  45. package/lib/interpolator/ChebyshevInterpolator.js.map +1 -0
  46. package/lib/interpolator/CubicSpline.d.ts +36 -0
  47. package/lib/interpolator/CubicSpline.js +64 -0
  48. package/lib/interpolator/CubicSpline.js.map +1 -0
  49. package/lib/interpolator/CubicSplineInterpolator.d.ts +37 -0
  50. package/lib/interpolator/CubicSplineInterpolator.js +78 -0
  51. package/lib/interpolator/CubicSplineInterpolator.js.map +1 -0
  52. package/lib/interpolator/FieldInterpolator.d.ts +26 -0
  53. package/lib/interpolator/FieldInterpolator.js +31 -0
  54. package/lib/interpolator/FieldInterpolator.js.map +1 -0
  55. package/lib/interpolator/Interpolator.d.ts +23 -0
  56. package/lib/interpolator/Interpolator.js +48 -0
  57. package/lib/interpolator/Interpolator.js.map +1 -0
  58. package/lib/interpolator/LagrangeInterpolator.d.ts +42 -0
  59. package/lib/interpolator/LagrangeInterpolator.js +156 -0
  60. package/lib/interpolator/LagrangeInterpolator.js.map +1 -0
  61. package/lib/interpolator/StateInterpolator.d.ts +29 -0
  62. package/lib/interpolator/StateInterpolator.js +37 -0
  63. package/lib/interpolator/StateInterpolator.js.map +1 -0
  64. package/lib/interpolator/VerletBlendInterpolator.d.ts +44 -0
  65. package/lib/interpolator/VerletBlendInterpolator.js +115 -0
  66. package/lib/interpolator/VerletBlendInterpolator.js.map +1 -0
  67. package/lib/maneuver/TwoBurnOrbitTransfer.d.ts +43 -0
  68. package/lib/maneuver/TwoBurnOrbitTransfer.js +62 -0
  69. package/lib/maneuver/TwoBurnOrbitTransfer.js.map +1 -0
  70. package/lib/maneuver/Waypoint.d.ts +66 -0
  71. package/lib/maneuver/Waypoint.js +152 -0
  72. package/lib/maneuver/Waypoint.js.map +1 -0
  73. package/lib/objects/DetailedSatellite.d.ts +94 -0
  74. package/lib/objects/DetailedSatellite.js +140 -0
  75. package/lib/objects/DetailedSatellite.js.map +1 -0
  76. package/lib/objects/DetailedSensor.d.ts +43 -0
  77. package/lib/objects/DetailedSensor.js +45 -0
  78. package/lib/objects/DetailedSensor.js.map +1 -0
  79. package/{dist/objects/space-object.d.ts → lib/objects/LandObject.d.ts} +19 -21
  80. package/lib/objects/LandObject.js +28 -0
  81. package/lib/objects/LandObject.js.map +1 -0
  82. package/lib/objects/Marker.d.ts +21 -0
  83. package/lib/objects/Marker.js +25 -0
  84. package/lib/objects/Marker.js.map +1 -0
  85. package/lib/objects/index.d.ts +5 -4
  86. package/lib/objects/index.js +5 -4
  87. package/lib/objects/index.js.map +1 -1
  88. package/lib/observation/Observation.d.ts +51 -0
  89. package/lib/observation/Observation.js +71 -0
  90. package/lib/observation/Observation.js.map +1 -0
  91. package/lib/observation/ObservationOptical.d.ts +47 -0
  92. package/lib/observation/ObservationOptical.js +101 -0
  93. package/lib/observation/ObservationOptical.js.map +1 -0
  94. package/lib/observation/ObservationRadar.d.ts +43 -0
  95. package/lib/observation/ObservationRadar.js +90 -0
  96. package/lib/observation/ObservationRadar.js.map +1 -0
  97. package/lib/observation/ObservationUtils.d.ts +21 -0
  98. package/lib/observation/ObservationUtils.js +33 -0
  99. package/lib/observation/ObservationUtils.js.map +1 -0
  100. package/lib/observation/PropagatorPairs.d.ts +31 -0
  101. package/lib/observation/PropagatorPairs.js +40 -0
  102. package/lib/observation/PropagatorPairs.js.map +1 -0
  103. package/lib/ootk.d.ts +10 -8
  104. package/lib/ootk.js +10 -8
  105. package/lib/ootk.js.map +1 -1
  106. package/lib/operations/BoxMuller.d.ts +41 -0
  107. package/lib/operations/BoxMuller.js +66 -0
  108. package/lib/operations/BoxMuller.js.map +1 -0
  109. package/lib/operations/EulerAngles.d.ts +50 -0
  110. package/lib/operations/EulerAngles.js +111 -0
  111. package/lib/operations/EulerAngles.js.map +1 -0
  112. package/lib/operations/Quaternion.d.ts +57 -0
  113. package/lib/operations/Quaternion.js +164 -0
  114. package/lib/operations/Quaternion.js.map +1 -0
  115. package/lib/operations/RandomGaussianSource.d.ts +25 -0
  116. package/lib/operations/RandomGaussianSource.js +43 -0
  117. package/lib/operations/RandomGaussianSource.js.map +1 -0
  118. package/lib/operations/index.d.ts +4 -0
  119. package/lib/operations/index.js +5 -0
  120. package/lib/operations/index.js.map +1 -0
  121. package/lib/optimize/ChebyshevCompressor.d.ts +31 -0
  122. package/lib/optimize/ChebyshevCompressor.js +80 -0
  123. package/lib/optimize/ChebyshevCompressor.js.map +1 -0
  124. package/lib/optimize/DownhillSimplex.d.ts +50 -0
  125. package/lib/optimize/DownhillSimplex.js +168 -0
  126. package/lib/optimize/DownhillSimplex.js.map +1 -0
  127. package/lib/optimize/GoldenSection.d.ts +33 -0
  128. package/lib/optimize/GoldenSection.js +49 -0
  129. package/lib/optimize/GoldenSection.js.map +1 -0
  130. package/lib/optimize/PolynomialRegression.d.ts +37 -0
  131. package/lib/optimize/PolynomialRegression.js +66 -0
  132. package/lib/optimize/PolynomialRegression.js.map +1 -0
  133. package/lib/optimize/PolynomicalRegressionResult.d.ts +28 -0
  134. package/lib/optimize/PolynomicalRegressionResult.js +32 -0
  135. package/lib/optimize/PolynomicalRegressionResult.js.map +1 -0
  136. package/lib/optimize/SimpleLinearRegression.d.ts +41 -0
  137. package/lib/optimize/SimpleLinearRegression.js +107 -0
  138. package/lib/optimize/SimpleLinearRegression.js.map +1 -0
  139. package/lib/optimize/SimplexEntry.d.ts +33 -0
  140. package/lib/optimize/SimplexEntry.js +39 -0
  141. package/lib/optimize/SimplexEntry.js.map +1 -0
  142. package/lib/orbit_determination/BatchLeastSquaresOD.d.ts +54 -0
  143. package/lib/orbit_determination/BatchLeastSquaresOD.js +118 -0
  144. package/lib/orbit_determination/BatchLeastSquaresOD.js.map +1 -0
  145. package/lib/orbit_determination/BatchLeastSquaresResult.d.ts +29 -0
  146. package/lib/orbit_determination/BatchLeastSquaresResult.js +31 -0
  147. package/lib/orbit_determination/BatchLeastSquaresResult.js.map +1 -0
  148. package/lib/orbit_determination/GibbsIOD.d.ts +33 -0
  149. package/lib/orbit_determination/GibbsIOD.js +70 -0
  150. package/lib/orbit_determination/GibbsIOD.js.map +1 -0
  151. package/lib/orbit_determination/GoodingIOD.d.ts +52 -0
  152. package/lib/orbit_determination/GoodingIOD.js +244 -0
  153. package/lib/orbit_determination/GoodingIOD.js.map +1 -0
  154. package/lib/{objects/space-object.d.ts → orbit_determination/HerrickGibbsIOD.d.ts} +17 -22
  155. package/lib/orbit_determination/HerrickGibbsIOD.js +49 -0
  156. package/lib/orbit_determination/HerrickGibbsIOD.js.map +1 -0
  157. package/lib/orbit_determination/LambertIOD.d.ts +46 -0
  158. package/lib/orbit_determination/LambertIOD.js +199 -0
  159. package/lib/orbit_determination/LambertIOD.js.map +1 -0
  160. package/lib/orbit_determination/ModifiedGoodingIOD.d.ts +41 -0
  161. package/lib/orbit_determination/ModifiedGoodingIOD.js +82 -0
  162. package/lib/orbit_determination/ModifiedGoodingIOD.js.map +1 -0
  163. package/lib/propagator/DormandPrince54Propagator.d.ts +29 -0
  164. package/lib/propagator/DormandPrince54Propagator.js +68 -0
  165. package/lib/propagator/DormandPrince54Propagator.js.map +1 -0
  166. package/lib/propagator/KeplerPropagator.d.ts +36 -0
  167. package/lib/propagator/KeplerPropagator.js +81 -0
  168. package/lib/propagator/KeplerPropagator.js.map +1 -0
  169. package/lib/propagator/Propagator.d.ts +35 -0
  170. package/lib/propagator/Propagator.js +163 -0
  171. package/lib/propagator/Propagator.js.map +1 -0
  172. package/lib/propagator/RkCheckpoint.d.ts +23 -0
  173. package/lib/propagator/RkCheckpoint.js +26 -0
  174. package/lib/propagator/RkCheckpoint.js.map +1 -0
  175. package/lib/propagator/RkResult.d.ts +24 -0
  176. package/lib/propagator/RkResult.js +28 -0
  177. package/lib/propagator/RkResult.js.map +1 -0
  178. package/lib/propagator/RungeKutta4Propagator.d.ts +46 -0
  179. package/lib/propagator/RungeKutta4Propagator.js +132 -0
  180. package/lib/propagator/RungeKutta4Propagator.js.map +1 -0
  181. package/lib/propagator/RungeKutta89Propagator.d.ts +29 -0
  182. package/lib/propagator/RungeKutta89Propagator.js +130 -0
  183. package/lib/propagator/RungeKutta89Propagator.js.map +1 -0
  184. package/lib/propagator/RungeKuttaAdaptive.d.ts +52 -0
  185. package/lib/propagator/RungeKuttaAdaptive.js +152 -0
  186. package/lib/propagator/RungeKuttaAdaptive.js.map +1 -0
  187. package/lib/propagator/Sgp4Propagator.d.ts +35 -0
  188. package/lib/propagator/Sgp4Propagator.js +55 -0
  189. package/lib/propagator/Sgp4Propagator.js.map +1 -0
  190. package/lib/smoothing/ExponentialSmoothing.d.ts +24 -0
  191. package/lib/smoothing/ExponentialSmoothing.js +82 -0
  192. package/lib/smoothing/ExponentialSmoothing.js.map +1 -0
  193. package/lib/types/types.d.ts +65 -584
  194. package/lib/types/types.js +21 -33
  195. package/lib/types/types.js.map +1 -1
  196. package/package.json +16 -14
  197. package/.prettierrc +0 -17
  198. package/babel.config.js +0 -16
  199. package/codecov.yml +0 -21
  200. package/dist/objects/base-object.d.ts +0 -40
  201. package/dist/objects/detailed-sat.d.ts +0 -66
  202. package/dist/objects/index.d.ts +0 -4
  203. package/dist/objects/sat.d.ts +0 -92
  204. package/dist/objects/sensor.d.ts +0 -93
  205. package/dist/objects/star.d.ts +0 -46
  206. package/dist/ootk.js +0 -2
  207. package/dist/ootk.js.LICENSE.txt +0 -77
  208. package/dist/sgp4/sgp4.d.ts +0 -82
  209. package/dist/tle/tle-format-data.d.ts +0 -6
  210. package/dist/tle/tle.d.ts +0 -375
  211. package/dist/transforms/transforms.d.ts +0 -94
  212. package/dist/types/types.d.ts +0 -605
  213. package/dist/utils/constants.d.ts +0 -34
  214. package/dist/utils/moon-math.d.ts +0 -113
  215. package/dist/utils/sun-math.d.ts +0 -230
  216. package/dist/utils/utils.d.ts +0 -39
  217. package/lib/objects/base-object.d.ts +0 -40
  218. package/lib/objects/base-object.js +0 -79
  219. package/lib/objects/base-object.js.map +0 -1
  220. package/lib/objects/detailed-sat.d.ts +0 -66
  221. package/lib/objects/detailed-sat.js +0 -149
  222. package/lib/objects/detailed-sat.js.map +0 -1
  223. package/lib/objects/sat.d.ts +0 -92
  224. package/lib/objects/sat.js +0 -188
  225. package/lib/objects/sat.js.map +0 -1
  226. package/lib/objects/sensor.d.ts +0 -93
  227. package/lib/objects/sensor.js +0 -273
  228. package/lib/objects/sensor.js.map +0 -1
  229. package/lib/objects/space-object.js +0 -60
  230. package/lib/objects/space-object.js.map +0 -1
  231. package/lib/objects/star.d.ts +0 -46
  232. package/lib/objects/star.js +0 -91
  233. package/lib/objects/star.js.map +0 -1
  234. package/lib/sgp4/sgp4.d.ts +0 -82
  235. package/lib/sgp4/sgp4.js +0 -3262
  236. package/lib/sgp4/sgp4.js.map +0 -1
  237. package/lib/tle/tle-format-data.d.ts +0 -6
  238. package/lib/tle/tle-format-data.js +0 -10
  239. package/lib/tle/tle-format-data.js.map +0 -1
  240. package/lib/tle/tle.d.ts +0 -375
  241. package/lib/tle/tle.js +0 -611
  242. package/lib/tle/tle.js.map +0 -1
  243. package/lib/transforms/transforms.d.ts +0 -94
  244. package/lib/transforms/transforms.js +0 -308
  245. package/lib/transforms/transforms.js.map +0 -1
  246. package/lib/utils/constants.d.ts +0 -34
  247. package/lib/utils/constants.js +0 -35
  248. package/lib/utils/constants.js.map +0 -1
  249. package/lib/utils/moon-math.d.ts +0 -113
  250. package/lib/utils/moon-math.js +0 -387
  251. package/lib/utils/moon-math.js.map +0 -1
  252. package/lib/utils/sun-math.d.ts +0 -230
  253. package/lib/utils/sun-math.js +0 -422
  254. package/lib/utils/sun-math.js.map +0 -1
  255. package/lib/utils/utils.d.ts +0 -39
  256. package/lib/utils/utils.js +0 -102
  257. package/lib/utils/utils.js.map +0 -1
  258. package/sandbox.html +0 -8
  259. package/tsconfig.base.json +0 -31
  260. package/tsconfig.build.json +0 -14
  261. /package/{LICENSE.MD → LICENSE.md} +0 -0
@@ -1,273 +0,0 @@
1
- /**
2
- * @author Theodore Kruczek.
3
- * @description Orbital Object ToolKit (OOTK) is a collection of tools for working
4
- * with satellites and other orbital objects.
5
- *
6
- * @file The Sensor class is used for creating ground based observers.
7
- *
8
- * @license AGPL-3.0-or-later
9
- * @Copyright (c) 2020-2023 Theodore Kruczek
10
- *
11
- * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
12
- * terms of the GNU Affero General Public License as published by the Free Software
13
- * Foundation, either version 3 of the License, or (at your option) any later version.
14
- *
15
- * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
16
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
- * See the GNU Affero General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public License along with
20
- * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
21
- */
22
- var __extends = (this && this.__extends) || (function () {
23
- var extendStatics = function (d, b) {
24
- extendStatics = Object.setPrototypeOf ||
25
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
27
- return extendStatics(d, b);
28
- };
29
- return function (d, b) {
30
- if (typeof b !== "function" && b !== null)
31
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
32
- extendStatics(d, b);
33
- function __() { this.constructor = d; }
34
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
35
- };
36
- })();
37
- import { SpaceObjectType } from '../types/types';
38
- import { RAD2DEG } from '../utils/constants';
39
- import { BaseObject } from './base-object';
40
- export var PassType;
41
- (function (PassType) {
42
- PassType[PassType["OUT_OF_VIEW"] = -1] = "OUT_OF_VIEW";
43
- PassType[PassType["ENTER"] = 0] = "ENTER";
44
- PassType[PassType["IN_VIEW"] = 1] = "IN_VIEW";
45
- PassType[PassType["EXIT"] = 2] = "EXIT";
46
- })(PassType || (PassType = {}));
47
- var TAU = Math.PI * 2;
48
- var Sensor = /** @class */ (function (_super) {
49
- __extends(Sensor, _super);
50
- /**
51
- * * name: Name as a string - OPTIONAL
52
- * * type: SpaceObjectType - OPTIONAL
53
- * * lat: Latitude in Radians
54
- * * lon: Longitude in Radians
55
- * * alt: Altitude in Kilometers
56
- * * minAz: Minimum Azimuth in Degrees
57
- * * maxAz: Maximum Azimuth in Degrees
58
- * * minEl: Minimum Elevation in Degrees
59
- * * maxEl: Maximum Elevation in Degrees
60
- * * minRng: Minimum Range in Kilometers
61
- * * maxRng: Maximum Range in Kilometers
62
- * @param {ObjectInfo} info ObjectInfo object containing the object's information
63
- */
64
- function Sensor(info) {
65
- var _this = this;
66
- // If there is a sensor type verify it is valid
67
- if (info.type) {
68
- switch (info.type) {
69
- case SpaceObjectType.OPTICAL:
70
- case SpaceObjectType.MECHANICAL:
71
- case SpaceObjectType.PHASED_ARRAY_RADAR:
72
- case SpaceObjectType.OBSERVER:
73
- case SpaceObjectType.BISTATIC_RADIO_TELESCOPE:
74
- break;
75
- default:
76
- throw new Error('Invalid sensor type');
77
- }
78
- }
79
- _this = _super.call(this, info) || this;
80
- _this.validateInputData(info);
81
- return _this;
82
- }
83
- Sensor.prototype.validateInputData = function (info) {
84
- this.validateLla(info);
85
- this.validateFov(info);
86
- };
87
- Sensor.prototype.validateFov = function (info) {
88
- this.validateMinAz(info);
89
- this.validateMaxAz(info);
90
- this.validateMinEl(info);
91
- this.validateMaxEl(info);
92
- this.validateMinRng(info);
93
- this.validateMaxRng(info);
94
- };
95
- Sensor.prototype.validateMaxRng = function (info) {
96
- if (info.maxRng >= 0) {
97
- this.maxRng = info.maxRng;
98
- }
99
- else if (typeof info.maxRng === 'undefined') {
100
- // Default is a telescope
101
- this.maxRng = 50000; // arbitrary large number
102
- }
103
- else {
104
- throw new Error('Invalid maximum range - must be greater than 0');
105
- }
106
- };
107
- Sensor.prototype.validateMinRng = function (info) {
108
- if (info.minRng >= 0) {
109
- this.minRng = info.minRng;
110
- }
111
- else if (typeof info.minRng === 'undefined') {
112
- // Default is a telescope
113
- this.minRng = 0;
114
- }
115
- else {
116
- throw new Error('Invalid minimum range - must be greater than 0');
117
- }
118
- };
119
- Sensor.prototype.validateMaxEl = function (info) {
120
- if (info.maxEl >= 0 && info.maxEl <= 180) {
121
- this.maxEl = info.maxEl;
122
- }
123
- else if (typeof info.maxEl === 'undefined') {
124
- // Default is a telescope
125
- this.maxEl = 90;
126
- }
127
- else {
128
- throw new Error('Invalid maximum elevation - must be between 0 and 180');
129
- }
130
- };
131
- Sensor.prototype.validateMinEl = function (info) {
132
- if (info.minEl >= 0 && info.minEl <= 90) {
133
- this.minEl = info.minEl;
134
- }
135
- else if (typeof info.minEl === 'undefined') {
136
- // Default is a telescope
137
- this.minEl = 0;
138
- }
139
- else {
140
- throw new Error('Invalid minimum elevation - must be between 0 and 90');
141
- }
142
- };
143
- Sensor.prototype.validateMaxAz = function (info) {
144
- if (info.maxAz >= 0 && info.maxAz <= 360) {
145
- this.maxAz = info.maxAz;
146
- }
147
- else if (typeof info.maxAz === 'undefined') {
148
- // Default is a telescope
149
- this.maxAz = 360;
150
- }
151
- else {
152
- throw new Error('Invalid maximum azimuth - must be between 0 and 360');
153
- }
154
- };
155
- Sensor.prototype.validateMinAz = function (info) {
156
- if (info.minAz >= 0 && info.minAz <= 360) {
157
- this.minAz = info.minAz;
158
- }
159
- else if (typeof info.minAz === 'undefined') {
160
- // Default is a telescope
161
- this.minAz = 0;
162
- }
163
- else {
164
- throw new Error('Invalid minimum azimuth - must be between 0 and 360');
165
- }
166
- };
167
- Sensor.prototype.validateLla = function (info) {
168
- if (info.lat >= -90 && info.lat <= 90) {
169
- this.lat = info.lat;
170
- }
171
- else {
172
- throw new Error('Invalid latitude');
173
- }
174
- if (info.lon >= -180 && info.lon <= 180) {
175
- this.lon = info.lon;
176
- }
177
- else {
178
- throw new Error('Invalid longitude');
179
- }
180
- if (info.alt >= 0) {
181
- this.alt = info.alt;
182
- }
183
- else {
184
- throw new Error('Invalid altitude');
185
- }
186
- };
187
- Sensor.prototype.setTime = function (date) {
188
- this.time = date;
189
- return this;
190
- };
191
- Sensor.prototype.getRae = function (sat, date) {
192
- if (date === void 0) { date = this.time; }
193
- return sat.getRae(this, date);
194
- };
195
- Sensor.prototype.isRaeInFov = function (rae) {
196
- if (rae.el * RAD2DEG < this.minEl || rae.el * RAD2DEG > this.maxEl) {
197
- return false;
198
- }
199
- if (rae.rng < this.minRng || rae.rng > this.maxRng) {
200
- return false;
201
- }
202
- if (this.minAz * RAD2DEG > this.maxAz) {
203
- // North Facing Sensors
204
- if (rae.az * RAD2DEG < this.minAz && rae.az * RAD2DEG > this.maxAz) {
205
- return false;
206
- }
207
- // Normal Facing Sensors
208
- }
209
- else if (rae.az * RAD2DEG < this.minAz || rae.az * RAD2DEG > this.maxAz) {
210
- return false;
211
- }
212
- return true;
213
- };
214
- Sensor.prototype.isSatInFov = function (sat, date) {
215
- if (date === void 0) { date = this.time; }
216
- return this.isRaeInFov(this.getRae(sat, date));
217
- };
218
- Sensor.prototype.calculatePasses = function (planningInterval, sat, date) {
219
- if (date === void 0) { date = this.time; }
220
- var isInViewLast = false;
221
- var maxElThisPass = 0;
222
- var msnPlanPasses = [];
223
- var startTime = date.getTime();
224
- for (var timeOffset = 0; timeOffset < planningInterval; timeOffset++) {
225
- var curTime = new Date(startTime + timeOffset * 1000);
226
- var rae = this.getRae(sat, curTime);
227
- // Radians to Degrees
228
- var azDeg = ((rae.az * 360) / TAU);
229
- var elDeg = ((rae.el * 360) / TAU);
230
- var isInView = this.isRaeInFov(rae);
231
- if (timeOffset === 0) {
232
- // Propagate Backwards to get the previous pass
233
- var oldRae = this.getRae(sat, new Date(Date.now() - 1 * 1000));
234
- isInViewLast = this.isRaeInFov(oldRae);
235
- }
236
- var type = Sensor.getPassType_(isInView, isInViewLast);
237
- maxElThisPass = Math.max(maxElThisPass, rae.el);
238
- if (type === PassType.ENTER || type === PassType.EXIT) {
239
- var pass = {
240
- type: type,
241
- time: curTime,
242
- az: azDeg,
243
- el: elDeg,
244
- rng: rae.rng,
245
- };
246
- // Only set maxEl for EXIT passes
247
- if (type === PassType.EXIT) {
248
- pass.maxElPass = maxElThisPass;
249
- }
250
- msnPlanPasses.push(pass);
251
- maxElThisPass = 0;
252
- }
253
- isInViewLast = isInView;
254
- }
255
- return msnPlanPasses;
256
- };
257
- Sensor.getPassType_ = function (isInView, isInViewLast) {
258
- var type = PassType.OUT_OF_VIEW;
259
- if (isInView && !isInViewLast) {
260
- type = PassType.ENTER;
261
- }
262
- else if (!isInView && isInViewLast) {
263
- type = PassType.EXIT;
264
- }
265
- else if (isInView && isInViewLast) {
266
- type = PassType.IN_VIEW;
267
- }
268
- return type;
269
- };
270
- return Sensor;
271
- }(BaseObject));
272
- export { Sensor };
273
- //# sourceMappingURL=sensor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sensor.js","sourceRoot":"","sources":["../../src/objects/sensor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,OAAO,EAAyC,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAExF,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAiB3C,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,sDAAgB,CAAA;IAChB,yCAAS,CAAA;IACT,6CAAW,CAAA;IACX,uCAAQ,CAAA;AACV,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB;AAWD,IAAM,GAAG,GAAG,IAAI,CAAC,EAAE,GAAG,C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TK) is a collection of tools for working
4
- * with satellites and other orbital objects.
5
- *
6
- * @file The SpaceObject class is meant to provide properties to satellites/stars that
7
- * do not apply to ground based objects.
8
- *
9
- * @license AGPL-3.0-or-later
10
- * @Copyright (c) 2020-2023 Theodore Kruczek
11
- *
12
- * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
13
- * terms of the GNU Affero General Public License as published by the Free Software
14
- * Foundation, either version 3 of the License, or (at your option) any later version.
15
- *
16
- * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
17
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18
- * See the GNU Affero General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU Affero General Public License along with
21
- * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
22
- */
23
- var __extends = (this && this.__extends) || (function () {
24
- var extendStatics = function (d, b) {
25
- extendStatics = Object.setPrototypeOf ||
26
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
27
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
28
- return extendStatics(d, b);
29
- };
30
- return function (d, b) {
31
- if (typeof b !== "function" && b !== null)
32
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33
- extendStatics(d, b);
34
- function __() { this.constructor = d; }
35
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
- };
37
- })();
38
- import { BaseObject } from './base-object';
39
- var SpaceObject = /** @class */ (function (_super) {
40
- __extends(SpaceObject, _super);
41
- function SpaceObject(info) {
42
- var _this = _super.call(this, info) || this;
43
- if (info.rcs) {
44
- _this.rcs = info.rcs;
45
- }
46
- if (info.vmag) {
47
- _this.vmag = info.vmag;
48
- }
49
- return _this;
50
- }
51
- SpaceObject.prototype.getRcs = function () {
52
- return this.rcs;
53
- };
54
- SpaceObject.prototype.getVmag = function () {
55
- return this.vmag;
56
- };
57
- return SpaceObject;
58
- }(BaseObject));
59
- export { SpaceObject };
60
- //# sourceMappingURL=space-object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"space-object.js","sourceRoot":"","sources":["../../src/objects/space-object.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C;IAAiC,+BAAU;IAIzC,qBAAY,IAAgB;QAA5B,YACE,kBAAM,IAAI,CAAC,SASZ;QAPC,IAAI,IAAI,CAAC,GAAG,EAAE;YACZ,KAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;SACrB;QAED,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACvB;;IACH,CAAC;IAEM,4BAAM,GAAb;QACE,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAEM,6BAAO,GAAd;QACE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IACH,kBAAC;AAAD,CAAC,AAvBD,CAAiC,UAAU,GAuB1C"}
@@ -1,46 +0,0 @@
1
- /**
2
- * @author Theodore Kruczek.
3
- * @description Orbital Object ToolKit (OOTK) is a collection of tools for working
4
- * with satellites and other orbital objects.
5
- *
6
- * @file The Star class is meant to help with cacluating star positions relative to
7
- * satellites and earth based sensors.
8
- *
9
- * @license AGPL-3.0-or-later
10
- * @Copyright (c) 2020-2023 Theodore Kruczek
11
- *
12
- * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
13
- * terms of the GNU Affero General Public License as published by the Free Software
14
- * Foundation, either version 3 of the License, or (at your option) any later version.
15
- *
16
- * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
17
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18
- * See the GNU Affero General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU Affero General Public License along with
21
- * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
22
- */
23
- import { EciVec3, LlaVec3, Radians, RaeVec3, SpaceObjectType } from '../types/types';
24
- import { SpaceObject } from './space-object';
25
- interface ObjectInfo {
26
- bf?: string;
27
- dec: Radians;
28
- h?: string;
29
- name?: string;
30
- pname?: string;
31
- ra: Radians;
32
- type?: SpaceObjectType;
33
- vmag?: number;
34
- }
35
- export declare class Star extends SpaceObject {
36
- bf: string;
37
- dec: Radians;
38
- h: string;
39
- pname: string;
40
- ra: Radians;
41
- constructor(info: ObjectInfo);
42
- getEci(lla?: LlaVec3, date?: Date): EciVec3;
43
- getRae(lla?: LlaVec3, date?: Date): RaeVec3;
44
- private static calculateTimeVariables_;
45
- }
46
- export {};
@@ -1,91 +0,0 @@
1
- /**
2
- * @author Theodore Kruczek.
3
- * @description Orbital Object ToolKit (OOTK) is a collection of tools for working
4
- * with satellites and other orbital objects.
5
- *
6
- * @file The Star class is meant to help with cacluating star positions relative to
7
- * satellites and earth based sensors.
8
- *
9
- * @license AGPL-3.0-or-later
10
- * @Copyright (c) 2020-2023 Theodore Kruczek
11
- *
12
- * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
13
- * terms of the GNU Affero General Public License as published by the Free Software
14
- * Foundation, either version 3 of the License, or (at your option) any later version.
15
- *
16
- * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
17
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18
- * See the GNU Affero General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU Affero General Public License along with
21
- * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
22
- */
23
- var __extends = (this && this.__extends) || (function () {
24
- var extendStatics = function (d, b) {
25
- extendStatics = Object.setPrototypeOf ||
26
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
27
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
28
- return extendStatics(d, b);
29
- };
30
- return function (d, b) {
31
- if (typeof b !== "function" && b !== null)
32
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33
- extendStatics(d, b);
34
- function __() { this.constructor = d; }
35
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
- };
37
- })();
38
- import { SpaceObjectType, } from '../types/types';
39
- import { DAY_TO_MS, DEG2RAD, RAD2DEG } from '../utils/constants';
40
- import { Sgp4 } from '../sgp4/sgp4';
41
- import { Transforms } from '../transforms/transforms';
42
- import { Utils } from '../utils/utils';
43
- import { SpaceObject } from './space-object';
44
- var Star = /** @class */ (function (_super) {
45
- __extends(Star, _super);
46
- function Star(info) {
47
- var _this = this;
48
- if (info.type && info.type !== SpaceObjectType.STAR) {
49
- throw new Error('Invalid object type');
50
- }
51
- else {
52
- info.type = SpaceObjectType.STAR;
53
- }
54
- _this = _super.call(this, info) || this;
55
- _this.ra = info.ra;
56
- _this.dec = info.dec;
57
- if (info.pname) {
58
- _this.pname = info.pname;
59
- }
60
- if (info.bf) {
61
- _this.bf = info.bf;
62
- }
63
- if (info.h) {
64
- _this.h = info.h;
65
- }
66
- return _this;
67
- }
68
- Star.prototype.getEci = function (lla, date) {
69
- if (lla === void 0) { lla = { lat: (180 * DEG2RAD), lon: 0, alt: 0 }; }
70
- if (date === void 0) { date = this.time; }
71
- var rae = this.getRae(lla, date);
72
- var gmst = Star.calculateTimeVariables_(date).gmst;
73
- // Arbitrary distance to enable using ECI coordinates
74
- return Transforms.ecf2eci(Transforms.rae2ecf(rae, { lat: 0, lon: 0, alt: 0 }), gmst);
75
- };
76
- Star.prototype.getRae = function (lla, date) {
77
- if (lla === void 0) { lla = { lat: (180 * DEG2RAD), lon: 0, alt: 0 }; }
78
- if (date === void 0) { date = this.time; }
79
- var starPos = Utils.SunMath.getStarAzEl(date, (lla.lat * RAD2DEG), (lla.lon * RAD2DEG), this.ra, this.dec);
80
- return { az: starPos.az, el: starPos.el, rng: 250000 };
81
- };
82
- Star.calculateTimeVariables_ = function (date) {
83
- var j = Utils.jday(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()) +
84
- date.getUTCMilliseconds() * DAY_TO_MS;
85
- var gmst = Sgp4.gstime(j);
86
- return { gmst: gmst, j: j };
87
- };
88
- return Star;
89
- }(SpaceObject));
90
- export { Star };
91
- //# sourceMappingURL=star.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"star.js","sourceRoot":"","sources":["../../src/objects/star.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;;;;;AAEH,OAAO,EAQL,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAa7C;IAA0B,wBAAW;IAOnC,cAAY,IAAgB;QAA5B,iBAuBC;QAtBC,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC,IAAI,EAAE;YACnD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SACxC;aAAM;YACL,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;SAClC;gBAED,kBAAM,IAAI,CAAC;QAEX,KAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,KAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QAEpB,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,KAAI,CAAC,KAA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,CACT,CAAC;QAEF,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,EAAc,MAAM,EAAE,CAAC;IACrE,CAAC;IAEc,4BAAuB,GAAtC,UAAuC,IAAU;QAC/C,IAAM,CAAC,GACL,KAAK,CAAC,IAAI,CACR,IAAI,CAAC,cAAc,EAAE,EACrB,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,EACtB,IAAI,CAAC,UAAU,EAAE,EACjB,IAAI,CAAC,WAAW,EAAE,EAClB,IAAI,CAAC,aAAa,EAAE,EACpB,IAAI,CAAC,aAAa,EAAE,CACrB;YACD,IAAI,CAAC,kBAAkB,EAAE,GAAG,SAAS,CAAC;QACxC,IAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAE5B,OAAO,EAAE,IAAI,MAAA,EAAE,CAAC,GAAA,EAAE,CAAC;IACrB,CAAC;IACH,WAAC;AAAD,CAAC,AAzED,CAA0B,WAAW,GAyEpC"}
@@ -1,82 +0,0 @@
1
- /**
2
- * @author Theodore Kruczek.
3
- * @description Orbital Object ToolKit (OOTK) is a collection of tools for working
4
- * with satellites and other orbital objects.
5
- *
6
- * @file The Sgp4 module contains a TypeScript port of the 2020 version of
7
- * sgp4unit.cpp from "Fundamentals of Astrodynamics and Applications" by David
8
- * Vallado. All of the original comments and notes are inserted in the code below
9
- * in order provide context to the functions and clarify any adjustments made for
10
- * TypeScript/JavaScript compatibility.
11
- *
12
- * @license AGPL-3.0-or-later
13
- * @Copyright (c) 2020-2023 Theodore Kruczek
14
- *
15
- * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
16
- * terms of the GNU Affero General Public License as published by the Free Software
17
- * Foundation, either version 3 of the License, or (at your option) any later version.
18
- *
19
- * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
20
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21
- * See the GNU Affero General Public License for more details.
22
- *
23
- * You should have received a copy of the GNU Affero General Public License along with
24
- * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
25
- */
26
- import { GreenwichMeanSiderealTime, SatelliteRecord, StateVector, Vec3Flat } from '../types/types';
27
- declare class Sgp4 {
28
- static angle(vec1: Vec3Flat, vec2: Vec3Flat): number;
29
- static asinh(xval: number): number;
30
- static createSatrec(tleLine1: string, tleLine2: string, whichconst?: string, opsmode?: string): SatelliteRecord;
31
- static cross(vec1: Vec3Flat, vec2: Vec3Flat): Vec3Flat;
32
- static days2mdhms(year: number, days: number): {
33
- mon: number;
34
- day: number;
35
- hr: number;
36
- min: number;
37
- sec: number;
38
- };
39
- static dot(x: Vec3Flat, y: Vec3Flat): number;
40
- static gstime(jdut1: number): GreenwichMeanSiderealTime;
41
- static invjday(jd: number, jdfrac: number): {
42
- year: number;
43
- mon: number;
44
- day: number;
45
- hr: number;
46
- min: number;
47
- sec: number;
48
- };
49
- static jday(year: number | Date, mon?: number, day?: number, hr?: number, min?: number, sec?: number, ms?: number): {
50
- jd: number;
51
- jdFrac: number;
52
- };
53
- static mag(x: Vec3Flat): number;
54
- static newtonnu(ecc: number, nu: number): {
55
- e0: number;
56
- m: number;
57
- };
58
- static propagate(satrec: SatelliteRecord, tsince: number): StateVector;
59
- static rv2coe(r: Vec3Flat, v: Vec3Flat, mus: number): {
60
- p: number;
61
- a: number;
62
- ecc: number;
63
- incl: number;
64
- omega: number;
65
- argp: number;
66
- nu: number;
67
- m: number;
68
- arglat: number;
69
- truelon: number;
70
- lonper: number;
71
- };
72
- static sgn(x: number): number;
73
- static sinh(x: number): number;
74
- private static dpper_;
75
- private static dscom_;
76
- private static dsinit_;
77
- private static dspace_;
78
- private static getgravconst_;
79
- private static initl_;
80
- private static sgp4init_;
81
- }
82
- export { Sgp4 };