ootk 1.0.8 → 1.5.1

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 (92) hide show
  1. package/{asc → .asc}/asconfig.json +0 -0
  2. package/{asc → .asc}/assembly/index.ts +0 -0
  3. package/{asc → .asc}/ex/asconfig.json +0 -0
  4. package/{asc → .asc}/ex/assembly/index.ts +0 -0
  5. package/{asc → .asc}/ex/index.html +0 -0
  6. package/{asc → .asc}/ex/package.json +0 -0
  7. package/{asc → .asc}/ex/tests/index.js +0 -0
  8. package/{asc → .asc}/package.json +0 -0
  9. package/{asc → .asc}/tests/index.js +0 -0
  10. package/.eslintrc.json +244 -0
  11. package/CHANGELOG.md +21 -1
  12. package/LICENSE.MD +299 -21
  13. package/README.md +17 -22
  14. package/dist/objects/base-object.d.ts +40 -0
  15. package/dist/objects/detailed-sat.d.ts +66 -0
  16. package/dist/objects/index.d.ts +4 -0
  17. package/dist/objects/sat.d.ts +88 -0
  18. package/dist/objects/sensor.d.ts +40 -0
  19. package/dist/objects/space-object.d.ts +38 -0
  20. package/dist/objects/star.d.ts +46 -0
  21. package/dist/ootk.d.ts +16 -21
  22. package/dist/ootk.js +2 -1
  23. package/dist/ootk.js.LICENSE.txt +77 -0
  24. package/dist/{sgp4.d.ts → sgp4/sgp4.d.ts} +14 -21
  25. package/dist/tle/tle-format-data.d.ts +6 -0
  26. package/dist/tle/tle.d.ts +374 -0
  27. package/{lib → dist/transforms}/transforms.d.ts +14 -17
  28. package/dist/{types.d.ts → types/types.d.ts} +111 -3
  29. package/dist/utils/constants.d.ts +34 -0
  30. package/dist/utils/moon-math.d.ts +104 -0
  31. package/dist/utils/sun-math.d.ts +230 -0
  32. package/dist/utils/utils.d.ts +36 -0
  33. package/lib/objects/base-object.d.ts +40 -0
  34. package/lib/objects/base-object.js +109 -0
  35. package/lib/objects/base-object.js.map +1 -0
  36. package/lib/objects/detailed-sat.d.ts +66 -0
  37. package/lib/objects/detailed-sat.js +149 -0
  38. package/lib/objects/detailed-sat.js.map +1 -0
  39. package/lib/objects/index.d.ts +4 -0
  40. package/lib/objects/index.js +5 -0
  41. package/lib/objects/index.js.map +1 -0
  42. package/lib/objects/sat.d.ts +88 -0
  43. package/lib/objects/sat.js +141 -0
  44. package/lib/objects/sat.js.map +1 -0
  45. package/lib/objects/sensor.d.ts +40 -0
  46. package/lib/objects/sensor.js +88 -0
  47. package/lib/objects/sensor.js.map +1 -0
  48. package/lib/objects/space-object.d.ts +38 -0
  49. package/lib/objects/space-object.js +60 -0
  50. package/lib/objects/space-object.js.map +1 -0
  51. package/lib/objects/star.d.ts +46 -0
  52. package/lib/objects/star.js +91 -0
  53. package/lib/objects/star.js.map +1 -0
  54. package/lib/ootk.d.ts +16 -21
  55. package/lib/ootk.js +16 -21
  56. package/lib/ootk.js.map +1 -1
  57. package/lib/{sgp4.d.ts → sgp4/sgp4.d.ts} +14 -21
  58. package/lib/{sgp4.js → sgp4/sgp4.js} +1064 -898
  59. package/lib/sgp4/sgp4.js.map +1 -0
  60. package/lib/tle/tle-format-data.d.ts +6 -0
  61. package/lib/tle/tle-format-data.js +10 -0
  62. package/lib/tle/tle-format-data.js.map +1 -0
  63. package/lib/tle/tle.d.ts +374 -0
  64. package/lib/tle/tle.js +611 -0
  65. package/lib/tle/tle.js.map +1 -0
  66. package/{dist → lib/transforms}/transforms.d.ts +14 -17
  67. package/lib/{transforms.js → transforms/transforms.js} +44 -40
  68. package/lib/transforms/transforms.js.map +1 -0
  69. package/lib/{types.d.ts → types/types.d.ts} +111 -3
  70. package/lib/types/types.js +34 -0
  71. package/lib/types/types.js.map +1 -0
  72. package/lib/utils/constants.d.ts +19 -15
  73. package/lib/utils/constants.js +20 -16
  74. package/lib/utils/constants.js.map +1 -1
  75. package/lib/utils/moon-math.d.ts +104 -0
  76. package/lib/utils/moon-math.js +387 -0
  77. package/lib/utils/moon-math.js.map +1 -0
  78. package/lib/utils/sun-math.d.ts +230 -0
  79. package/lib/utils/sun-math.js +421 -0
  80. package/lib/utils/sun-math.js.map +1 -0
  81. package/lib/utils/utils.d.ts +36 -0
  82. package/lib/utils/utils.js +81 -0
  83. package/lib/utils/utils.js.map +1 -0
  84. package/package.json +4 -3
  85. package/dist/utils.d.ts +0 -34
  86. package/lib/sgp4.js.map +0 -1
  87. package/lib/transforms.js.map +0 -1
  88. package/lib/types.js +0 -2
  89. package/lib/types.js.map +0 -1
  90. package/lib/utils.d.ts +0 -34
  91. package/lib/utils.js +0 -62
  92. package/lib/utils.js.map +0 -1
@@ -0,0 +1,374 @@
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 TLE module contains a collection of functions for working with TLEs.
7
+ *
8
+ * @license AGPL-3.0-or-later
9
+ * @Copyright (c) 2020-2022 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
+ import { Line1Data, Line2Data, TleLine1, TleLine2 } from '../types/types';
23
+ declare type TleData = {
24
+ satNum: number;
25
+ intlDes: string;
26
+ epochYear: number;
27
+ epochDay: number;
28
+ meanMoDev1: number;
29
+ meanMoDev2: number;
30
+ bstar: number;
31
+ inclination: number;
32
+ raan: number;
33
+ eccentricity: number;
34
+ argOfPerigee: number;
35
+ meanAnomaly: number;
36
+ meanMotion: number;
37
+ };
38
+ declare type TleDataFull = Line1Data & Line2Data;
39
+ export declare class Tle {
40
+ private static lineNumber;
41
+ private static satNum;
42
+ private static classification;
43
+ private static intlDes;
44
+ private static intlDesYear;
45
+ private static intlDesLaunchNum;
46
+ private static intlDesLaunchPiece;
47
+ private static epochYear;
48
+ private static epochDay;
49
+ private static meanMoDev1;
50
+ private static meanMoDev2;
51
+ private static bstar;
52
+ private static ephemerisType;
53
+ private static elsetNum;
54
+ private static checksum;
55
+ private static inclination;
56
+ private static raan;
57
+ private static eccentricity;
58
+ private static argPerigee;
59
+ private static meanAnom;
60
+ private static meanMo;
61
+ private static revNum;
62
+ /**
63
+ * Parses the TLE into orbital data.
64
+ *
65
+ * If you want all of the data then use parseTleFull instead.
66
+ * @param {TleLine1} tleLine1 TLE line 1
67
+ * @param {TleLine2} tleLine2 TLE line 2
68
+ * @returns {TleData} Returns most commonly used orbital data from TLE
69
+ */
70
+ static parseTle(tleLine1: TleLine1, tleLine2: TleLine2): TleData;
71
+ /**
72
+ * Parses all of the data contained in the TLE.
73
+ *
74
+ * If you only want the most commonly used data then use parseTle instead.
75
+ * @param {TleLine1} tleLine1 The first line of the TLE to parse.
76
+ * @param {TleLine2} tleLine2 The second line of the TLE to parse.
77
+ * @returns {TleDataFull} Returns all of the data from the TLE.
78
+ */
79
+ static parseTleFull(tleLine1: TleLine1, tleLine2: TleLine2): TleDataFull;
80
+ /**
81
+ * Parse the first line of the TLE.
82
+ * @param {TleLine1} tleLine1 The first line of the TLE to parse.
83
+ * @returns {Line1Data} Returns the data from the first line of the TLE.
84
+ */
85
+ static parseLine1(tleLine1: TleLine1): Line1Data;
86
+ /**
87
+ * Parse the second line of the TLE.
88
+ * @param {TleLine2} tleLine2 The second line of the TLE to parse.
89
+ * @returns {Line2Data} Returns the data from the second line of the TLE.
90
+ */
91
+ static parseLine2(tleLine2: TleLine2): Line2Data;
92
+ /**
93
+ * This should always return a 1 or a 2.
94
+ * @param {string} tleLine The first line of the TLE to parse.
95
+ * @returns {number} The line number of the TLE.
96
+ */
97
+ static getLineNumber(tleLine: TleLine1 | TleLine2): 1 | 2;
98
+ /**
99
+ * See https://en.wikipedia.org/wiki/Satellite_Catalog_Number
100
+ *
101
+ * Range: 0 to 99999 or 26999.
102
+ *
103
+ * NOTE: To support Alpha-5, the first digit can be a letter.
104
+ * This will be converted to a number in order to expand the range to 26999.
105
+ *
106
+ * Example: 25544 or B1234 (e.g. Sputnik's rocket body was number 00001)
107
+ *
108
+ * @param {string} tleLine The first line of the TLE to parse.
109
+ * @returns {number} NORAD catalog number.
110
+ */
111
+ static getSatNum(tleLine: TleLine1 | TleLine2): number;
112
+ /**
113
+ * See https://en.wikipedia.org/wiki/Satellite_Catalog_Number
114
+ *
115
+ * Range: 0 to 99999 or 26999.
116
+ *
117
+ * NOTE: To support Alpha-5, the first digit can be a letter.
118
+ * This will NOT be converted to a number. Use getSatNum() for that.
119
+ *
120
+ * Example: 25544 or B1234 (e.g. Sputnik's rocket body was number 00001)
121
+ *
122
+ * @param {string} tleLine The first line of the TLE to parse.
123
+ * @returns {string} NORAD catalog number.
124
+ */
125
+ static getRawSatNum(tleLine: TleLine1 | TleLine2): string;
126
+ /**
127
+ * Satellite classification.
128
+ * * 'U' = unclassified
129
+ * * 'C' = confidential
130
+ * * 'S' = secret
131
+ *
132
+ * Example: 'U'
133
+ * @param {string} tleLine1 The first line of the TLE to parse.
134
+ * @returns {string} The classification.
135
+ */
136
+ static getClassification(tleLine1: TleLine1): string;
137
+ /**
138
+ * International Designator (COSPAR ID)
139
+ * See https://en.wikipedia.org/wiki/International_Designator
140
+ * @param {string} tleLine1 The first line of the TLE to parse.
141
+ * @returns {string} The International Designator.
142
+ */
143
+ static getIntlDes(tleLine1: TleLine1): string;
144
+ /**
145
+ * International Designator (COSPAR ID): Last 2 digits of launch year.
146
+ *
147
+ * Range: 00 to 99
148
+ *
149
+ * Example: 98
150
+ *
151
+ * @param {string} tleLine1 The first line of the TLE to parse.
152
+ * @returns {number} The year of the International Designator.
153
+ */
154
+ static getIntlDesYear(tleLine1: TleLine1): number;
155
+ /**
156
+ * International Designator (COSPAR ID): Launch number of the year.
157
+ *
158
+ * Range: 1 to 999
159
+ *
160
+ * Example: 67
161
+ *
162
+ * @param {string} tleLine1 The first line of the TLE to parse.
163
+ * @returns {number} The launch number of the International Designator.
164
+ */
165
+ static getIntlDesLaunchNum(tleLine1: string): number;
166
+ /**
167
+ * International Designator (COSPAR ID): Piece of the launch.
168
+ *
169
+ * Range: A to ZZZ
170
+ *
171
+ * Example: 'A'
172
+ *
173
+ * @param {string} tleLine1 The first line of the TLE to parse.
174
+ * @returns {string} The launch piece of the International Designator.
175
+ */
176
+ static getIntlDesLaunchPiece(tleLine1: TleLine1): string;
177
+ /**
178
+ * Year when the TLE was generated (TLE epoch), last two digits.
179
+ *
180
+ * Range: 00 to 99
181
+ *
182
+ * Example: 17
183
+ *
184
+ * @param {string} tleLine1 The first line of the TLE to parse.
185
+ * @returns {number} The year the TLE was generated.
186
+ */
187
+ static getEpochYear(tleLine1: TleLine1): number;
188
+ /**
189
+ * Year when the TLE was generated (TLE epoch), four digits.
190
+ *
191
+ * Range: 1957 to 2056
192
+ *
193
+ * Example: 2008
194
+ *
195
+ * @param {string} tleLine1 The first line of the TLE to parse.
196
+ * @returns {number} The year the TLE was generated.
197
+ */
198
+ static getEpochYearFull(tleLine1: TleLine1): number;
199
+ /**
200
+ * Fractional day of the year when the TLE was generated (TLE epoch).
201
+ *
202
+ * Range: 1 to 365.99999999
203
+ *
204
+ * Example: 206.18396726
205
+ *
206
+ * @param {string} tleLine1 The first line of the TLE to parse.
207
+ * @returns {number} The day of the year the TLE was generated.
208
+ */
209
+ static getEpochDay(tleLine1: string): number;
210
+ /**
211
+ * First Time Derivative of the Mean Motion divided by two. Defines how mean motion changes
212
+ * over time, so TLE propagators can still be used to make reasonable guesses when
213
+ * times are distant from the original TLE epoch.
214
+ *
215
+ * Units: Orbits / day ^ 2
216
+ *
217
+ * Example: 0.00001961
218
+ *
219
+ * @param {string} tleLine1 The first line of the TLE to parse.
220
+ * @returns {number} The first derivative of the mean motion.
221
+ */
222
+ static getMeanMoDev1(tleLine1: TleLine1): number;
223
+ /**
224
+ * Second Time Derivative of Mean Motion divided by six (decimal point assumed). Measures rate
225
+ * of change in the Mean Motion Dot so software can make reasonable guesses when times are
226
+ * distant from the original TLE epoch.
227
+ *
228
+ * Usually zero, unless the satellite is manuevering or in a decaying orbit.
229
+ *
230
+ * Units: Orbits / day ^ 3.
231
+ *
232
+ * Example: 0 ('00000-0' in the original TLE [= 0.00000 * 10 ^ 0])
233
+ *
234
+ * @param {string} tleLine1 The first line of the TLE to parse.
235
+ * @returns {number} The second derivative of the mean motion.
236
+ */
237
+ static getMeanMoDev2(tleLine1: string): number;
238
+ /**
239
+ * BSTAR drag term (decimal point assumed). Estimates the effects of
240
+ * atmospheric drag on the satellite's motion.
241
+ *
242
+ * Units: EarthRadii ^ -1
243
+ *
244
+ * Example: 0.000036771 ('36771-4' in the original TLE [= 0.36771 * 10 ^ -4])
245
+ *
246
+ * @param {string} tleLine1 The first line of the TLE to parse.
247
+ * @returns {number} The drag coefficient.
248
+ */
249
+ static getBstar(tleLine1: TleLine1): number;
250
+ /**
251
+ * Private value - used by United States Space Force to reference the orbit model used to
252
+ * generate the TLE. Will always be seen as zero externally (e.g. by "us", unless you are
253
+ * "them" - in which case, hello!).
254
+ *
255
+ * Example: 0
256
+ *
257
+ * @param {string} tleLine1 The first line of the TLE to parse.
258
+ * @returns {number} The ephemeris type.
259
+ */
260
+ static getEphemerisType(tleLine1: TleLine1): number;
261
+ /**
262
+ * TLE element set number, incremented for each new TLE generated. 999 seems to mean the TLE
263
+ * has maxed out.
264
+ *
265
+ * Range: Technically 1 to 9999, though in practice the maximum number seems to be 999.
266
+ *
267
+ * Example: 999
268
+ * @param {string} tleLine1 The first line of the TLE to parse.
269
+ * @returns {number} The element number.
270
+ */
271
+ static getElsetNum(tleLine1: TleLine1): number;
272
+ /**
273
+ * TLE line 1 checksum (modulo 10), for verifying the integrity of this line of the TLE.
274
+ *
275
+ * Range: 0 to 9
276
+ * Example: 3
277
+ *
278
+ * @param {string} tleLine1 The first line of the TLE to parse.
279
+ * @returns {number} The checksum value.
280
+ */
281
+ static getChecksum(tleLine1: TleLine1): number;
282
+ /**
283
+ * Inclination relative to the Earth's equatorial plane in degrees. 0 to 90 degrees is a
284
+ * prograde orbit and 90 to 180 degrees is a retrograde orbit.
285
+ *
286
+ * Units: degrees
287
+ *
288
+ * Range: 0 to 180
289
+ *
290
+ * Example: 51.6400
291
+ *
292
+ * @param {string} tleLine2 The second line of the TLE to parse.
293
+ * @returns {number} The inclination of the satellite.
294
+ */
295
+ static getInclination(tleLine2: TleLine2): number;
296
+ /**
297
+ * Right ascension of the ascending node in degrees. Essentially, this is the angle of the
298
+ * satellite as it crosses northward (ascending) across the Earth's equator (equatorial
299
+ * plane).
300
+ *
301
+ * Units: degrees
302
+ *
303
+ * Range: 0 to 359.9999
304
+ *
305
+ * Example: 208.9163
306
+ *
307
+ * @param {string} tleLine2 The second line of the TLE to parse.
308
+ * @returns {number} The right ascension of the satellite.
309
+ */
310
+ static getRaan(tleLine2: TleLine2): number;
311
+ /**
312
+ * Orbital eccentricity, decimal point assumed. All artificial Earth satellites have an
313
+ * eccentricity between 0 (perfect circle) and 1 (parabolic orbit).
314
+ *
315
+ * Range: 0 to 1
316
+ *
317
+ * Example: 0.0006317 (`0006317` in the original TLE)
318
+ *
319
+ * @param {string} tleLine2 The second line of the TLE to parse.
320
+ * @returns {number} The eccentricity of the satellite.
321
+ */
322
+ static getEccentricity(tleLine2: TleLine2): number;
323
+ /**
324
+ * Argument of perigee. See https://en.wikipedia.org/wiki/Argument_of_perigee
325
+ *
326
+ * Units: degrees
327
+ *
328
+ * Range: 0 to 359.9999
329
+ *
330
+ * Example: 69.9862
331
+ *
332
+ * @param {string} tleLine2 The second line of the TLE to parse.
333
+ * @returns {number} The argument of perigee in degrees.
334
+ */
335
+ static getArgOfPerigee(tleLine2: TleLine2): number;
336
+ /**
337
+ * Mean anomaly. Indicates where the satellite was located within its orbit at the time of the
338
+ * TLE epoch.
339
+ * See https://en.wikipedia.org/wiki/Mean_Anomaly
340
+ *
341
+ * Units: degrees
342
+ *
343
+ * Range: 0 to 359.9999
344
+ *
345
+ * Example: 25.2906
346
+ *
347
+ * @param {string} tleLine2 The second line of the TLE to parse.
348
+ * @returns {number} The mean anomaly of the satellite.
349
+ */
350
+ static getMeanAnomaly(tleLine2: TleLine2): number;
351
+ /**
352
+ * Revolutions around the Earth per day (mean motion).
353
+ * See https://en.wikipedia.org/wiki/Mean_Motion
354
+ *
355
+ * Range: 0 to 17 (theoretically)
356
+ * Example: 15.54225995
357
+ * @param {string} tleLine2 The second line of the TLE to parse.
358
+ * @returns {number} The mean motion of the satellite.
359
+ */
360
+ static getMeanMotion(tleLine2: TleLine2): number;
361
+ /**
362
+ * Total satellite revolutions when this TLE was generated. This number rolls over
363
+ * (e.g. 99999 -> 0).
364
+ *
365
+ * Range: 0 to 99999
366
+ *
367
+ * Example: 6766
368
+ *
369
+ * @param {string} tleLine2 The second line of the TLE to parse.
370
+ * @returns {number} The revolutions around the Earth per day (mean motion).
371
+ */
372
+ static getRevNum(tleLine2: TleLine2): number;
373
+ }
374
+ export {};
@@ -7,25 +7,21 @@
7
7
  * in the original SGP4 library such as ECI to ECF and ECF to RAE. This was based
8
8
  * on some of the functions in satellite.js.
9
9
  *
10
- * Permission is hereby granted, free of charge, to any person obtaining a copy
11
- * of this software and associated documentation files (the "Software"), to deal
12
- * in the Software without restriction, including without limitation the rights
13
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- * copies of the Software, and to permit persons to whom the Software is
15
- * furnished to do so, subject to the following conditions:
10
+ * @license AGPL-3.0-or-later
11
+ * @Copyright (c) 2020-2022 Theodore Kruczek
16
12
  *
17
- * The above copyright notice and this permission notice shall be included in all
18
- * copies or substantial portions of the Software.
13
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
14
+ * terms of the GNU Affero General Public License as published by the Free Software
15
+ * Foundation, either version 3 of the License, or (at your option) any later version.
19
16
  *
20
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- * SOFTWARE.
17
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
18
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19
+ * See the GNU Affero General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU Affero General Public License along with
22
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
27
23
  */
28
- import { Degrees, EcfVec3, EciVec3, LlaVec3, Radians, RaeVec3, SezVec3 } from './types';
24
+ import { Degrees, EcfVec3, EciVec3, LlaVec3, Radians, RaeVec3, SezVec3 } from '../types/types';
29
25
  declare class Transforms {
30
26
  static getDegLat(radians: Radians): Degrees;
31
27
  static getDegLon(radians: Radians): Degrees;
@@ -35,7 +31,8 @@ declare class Transforms {
35
31
  static deg2rad(degrees: Degrees): Radians;
36
32
  static ecf2eci(ecf: EcfVec3, gmst: number): EciVec3;
37
33
  static ecf2rae(lla: LlaVec3, ecf: EcfVec3): RaeVec3;
38
- /** eciToGeodetic converts eci coordinates to lla coordinates
34
+ /**
35
+ * EciToGeodetic converts eci coordinates to lla coordinates
39
36
  * @param {vec3} eci takes xyz coordinates
40
37
  * @param {number} gmst takes a number in gmst time
41
38
  * @returns {array} array containing lla coordinates
@@ -1,4 +1,6 @@
1
1
  export declare type Kilometer = number;
2
+ export declare type Radians = number;
3
+ export declare type Degrees = number;
2
4
  export declare type Vec3<Type> = {
3
5
  x: Type;
4
6
  y: Type;
@@ -25,9 +27,11 @@ export declare type SezVec3 = {
25
27
  e: Kilometer;
26
28
  z: Kilometer;
27
29
  };
28
- export declare type Radians = number;
29
- export declare type Degrees = number;
30
- /** @interface SatelliteRecord contains all of the orbital parameters necessary for running SGP4. It is generated by Sgp4.createSatrec.*/
30
+ /**
31
+ * @interface SatelliteRecord contains all of the orbital parameters necessary for running SGP4.
32
+ * It is generated by Sgp4.createSatrec.
33
+ *
34
+ */
31
35
  export interface SatelliteRecord {
32
36
  a: number;
33
37
  am: number;
@@ -162,3 +166,107 @@ export declare type StateVector = {
162
166
  };
163
167
  /** @typedef Vec3Flat is a flat three dimensional array used in vector math.*/
164
168
  export declare type Vec3Flat = [number, number, number];
169
+ /** @typedef TleLine1 is the first line of a two line element set */
170
+ export declare type TleLine1 = string;
171
+ /** @typedef TleLine2 is the second line of a two line element set */
172
+ export declare type TleLine2 = string;
173
+ export declare type Line1Data = {
174
+ lineNumber1: number;
175
+ satNum: number;
176
+ satNumRaw: string;
177
+ classification: string;
178
+ intlDes: string;
179
+ intlDesYear: number;
180
+ intlDesLaunchNum: number;
181
+ intlDesLaunchPiece: string;
182
+ epochYear: number;
183
+ epochYearFull: number;
184
+ epochDay: number;
185
+ meanMoDev1: number;
186
+ meanMoDev2: number;
187
+ bstar: number;
188
+ ephemerisType: number;
189
+ elsetNum: number;
190
+ checksum1: number;
191
+ };
192
+ export declare type Line2Data = {
193
+ lineNumber2: number;
194
+ satNum: number;
195
+ satNumRaw: string;
196
+ inclination: number;
197
+ raan: number;
198
+ eccentricity: number;
199
+ argOfPerigee: number;
200
+ meanAnomaly: number;
201
+ meanMotion: number;
202
+ revNum: number;
203
+ checksum2: number;
204
+ };
205
+ export declare enum SpaceObjectType {
206
+ UNKNOWN = 0,
207
+ PAYLOAD = 1,
208
+ ROCKET_BODY = 2,
209
+ DEBRIS = 3,
210
+ SPECIAL = 4,
211
+ RADAR_MEASUREMENT = 5,
212
+ RADAR_TRACK = 6,
213
+ RADAR_OBJECT = 7,
214
+ BALLISTIC_MISSILE = 8,
215
+ STAR = 9,
216
+ INTERGOVERNMENTAL_ORGANIZATION = 10,
217
+ SUBORBITAL_PAYLOAD_OPERATOR = 11,
218
+ PAYLOAD_OWNER = 12,
219
+ METEOROLOGICAL_ROCKET_LAUNCH_AGENCY_OR_MANUFACTURER = 13,
220
+ PAYLOAD_MANUFACTURER = 14,
221
+ LAUNCH_AGENCY = 15,
222
+ LAUNCH_SITE = 16,
223
+ LAUNCH_POSITION = 17,
224
+ LAUNCH_FACILITY = 18,
225
+ CONTROL_FACILITY = 19,
226
+ GROUND_SENSOR_STATION = 20,
227
+ OPTICAL = 21,
228
+ MECHANICAL = 22,
229
+ PHASED_ARRAY_RADAR = 23,
230
+ OBSERVER = 24,
231
+ BISTATIC_RADIO_TELESCOPE = 25,
232
+ COUNTRY = 26,
233
+ LAUNCH_VEHICLE_MANUFACTURER = 27,
234
+ ENGINE_MANUFACTURER = 28
235
+ }
236
+ export declare type GreenwichMeanSiderealTime = number;
237
+ export declare type LaunchDetails = {
238
+ launchDate?: string;
239
+ launchMass?: string;
240
+ launchSite?: string;
241
+ launchVehicle?: string;
242
+ };
243
+ export declare type SpaceCraftDetails = {
244
+ lifetime?: string | number;
245
+ maneuver?: string;
246
+ manufacturer?: string;
247
+ motor?: string;
248
+ power?: string;
249
+ payload?: string;
250
+ purpose?: string;
251
+ shape?: string;
252
+ span?: string;
253
+ bus?: string;
254
+ configuration?: string;
255
+ equipment?: string;
256
+ dryMass?: string;
257
+ };
258
+ export declare type OperationsDetails = {
259
+ user?: string;
260
+ mission?: string;
261
+ owner?: string;
262
+ country?: string;
263
+ };
264
+ export declare type AzEl = {
265
+ az: Radians;
266
+ el: Radians;
267
+ };
268
+ export declare type Meters = number;
269
+ export declare type SunTime = {
270
+ solarNoon: Date;
271
+ nadir: Date;
272
+ };
@@ -0,0 +1,34 @@
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 Commonly used constants.
7
+ *
8
+ * @license AGPL-3.0-or-later
9
+ * @Copyright (c) 2020-2022 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
+ export declare const PI: number;
23
+ export declare const TAU: number;
24
+ export declare const DEG2RAD: number;
25
+ export declare const x2o3: number;
26
+ export declare const temp4 = 1.5e-12;
27
+ export declare const RAD2DEG: number;
28
+ export declare const MINUTES_PER_DAY = 1440;
29
+ export declare const MS_PER_DAY = 86400000;
30
+ export declare const DAY_TO_MS = 1.15741e-8;
31
+ export declare const cMPerSec = 299792458;
32
+ export declare const cKmPerSec: number;
33
+ export declare const cKmPerMs: number;
34
+ export declare const RADIUS_OF_EARTH = 6371;
@@ -0,0 +1,104 @@
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 MoonMath is a an extension to SunMath for calculating the position of the moon
7
+ * and its phases. This was originally created by Vladimir Agafonkin. Robert Gester's
8
+ * update was referenced for documentation. There were a couple of bugs in both versions
9
+ * so there will be some differences if you are migrating from either to this library.
10
+ *
11
+ *
12
+ * @license AGPL-3.0-or-later
13
+ * @Copyright (c) 2020-2022 Theodore Kruczek
14
+ *
15
+ * @Copyright (c) 2011-2015, Vladimir Agafonkin
16
+ * SunCalc is a JavaScript library for calculating sun/moon position and light phases.
17
+ * https://github.com/mourner/suncalc
18
+ *
19
+ * Reworked and enhanced by Robert Gester
20
+ * @Copyright (c) 2022 Robert Gester
21
+ * https://github.com/hypnos3/suncalc3
22
+ *
23
+ * moon calculations, based on http://aa.quae.nl/en/reken/hemelpositie.html formulas
24
+ *
25
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
26
+ * terms of the GNU Affero General Public License as published by the Free Software
27
+ * Foundation, either version 3 of the License, or (at your option) any later version.
28
+ *
29
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
30
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31
+ * See the GNU Affero General Public License for more details.
32
+ *
33
+ * You should have received a copy of the GNU Affero General Public License along with
34
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
35
+ */
36
+ import { Radians } from '../ootk';
37
+ declare type MoonIlluminationData = {
38
+ fraction: number;
39
+ phase: any;
40
+ phaseValue: number;
41
+ angle: any;
42
+ next: {
43
+ value: number;
44
+ date: string;
45
+ type: string;
46
+ newMoon: {
47
+ value: any;
48
+ date: string;
49
+ };
50
+ fullMoon: {
51
+ value: any;
52
+ date: string;
53
+ };
54
+ firstQuarter: {
55
+ value: any;
56
+ date: string;
57
+ };
58
+ thirdQuarter: {
59
+ value: any;
60
+ date: string;
61
+ };
62
+ };
63
+ };
64
+ export declare class MoonMath {
65
+ static moonCoords(d: any): {
66
+ ra: number;
67
+ dec: number;
68
+ dist: number;
69
+ };
70
+ static hoursLater(date: Date, h: number): Date;
71
+ static getMoonPosition(date: any, lat: any, lon: any): {
72
+ az: number;
73
+ el: number;
74
+ rng: number;
75
+ parallacticAngle: number;
76
+ };
77
+ private static moonCycles;
78
+ /**
79
+ * calculations for illumination parameters of the moon,
80
+ * based on http://idlastro.gsfc.nasa.gov/ftp/pro/astro/mphase.pro formulas and
81
+ * Chapter 48 of "Astronomical Algorithms" 2nd edition by Jean Meeus (Willmann-Bell, Richmond) 1998.
82
+ * @param {number | Date} date Date object or timestamp for calculating moon-illumination
83
+ * @return {MoonIlluminationData} result object of moon-illumination
84
+ */
85
+ static getMoonIllumination(date: number | Date): MoonIlluminationData;
86
+ /**
87
+ * calculations for moon rise/set times are based on http://www.stargazing.net/kepler/moonrise.html article
88
+ * @param {number|Date} dateValue Date object or timestamp for calculating moon-times
89
+ * @param {number} lat latitude for calculating moon-times
90
+ * @param {number} lon longitude for calculating moon-times
91
+ * @param {boolean} [isUtc] defines if the calculation should be in utc or local time (default is local)
92
+ * @return {IMoonTimes} result object of sunTime
93
+ */
94
+ static getMoonTimes(dateValue: Date, lat: Radians, lon: Radians, isUtc?: boolean): {
95
+ rise: any;
96
+ set: any;
97
+ ye: any;
98
+ alwaysUp: any;
99
+ alwaysDown: any;
100
+ highest: any;
101
+ };
102
+ private static calculateRiseSetTimes;
103
+ }
104
+ export {};