ootk 1.0.6 → 1.2.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/lib/tle.js ADDED
@@ -0,0 +1,615 @@
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
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ */
26
+ var __assign = (this && this.__assign) || function () {
27
+ __assign = Object.assign || function(t) {
28
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
29
+ s = arguments[i];
30
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
31
+ t[p] = s[p];
32
+ }
33
+ return t;
34
+ };
35
+ return __assign.apply(this, arguments);
36
+ };
37
+ import { TleFormatData } from './utils/TleFormatData';
38
+ import { Utils } from './utils';
39
+ var Tle = /** @class */ (function () {
40
+ function Tle() {
41
+ }
42
+ /**
43
+ * Parses the TLE into orbital data.
44
+ *
45
+ * If you want all of the data then use parseTleFull instead.
46
+ * @param {TleLine1} tleLine1 TLE line 1
47
+ * @param {TleLine2} tleLine2 TLE line 2
48
+ * @returns {TleData} Returns most commonly used orbital data from TLE
49
+ */
50
+ Tle.parseTle = function (tleLine1, tleLine2) {
51
+ var line1 = Tle.parseLine1(tleLine1);
52
+ var line2 = Tle.parseLine2(tleLine2);
53
+ if (line1.satNum !== line2.satNum) {
54
+ throw new Error('Satellite numbers do not match');
55
+ }
56
+ if (line1.satNumRaw !== line2.satNumRaw) {
57
+ throw new Error('Raw satellite numbers do not match');
58
+ }
59
+ if (line1.lineNumber1 !== 1) {
60
+ throw new Error('First line number must be 1');
61
+ }
62
+ if (line2.lineNumber2 !== 2) {
63
+ throw new Error('Second line number must be 2');
64
+ }
65
+ return {
66
+ satNum: line1.satNum,
67
+ intlDes: line1.intlDes,
68
+ epochYear: line1.epochYear,
69
+ epochDay: line1.epochDay,
70
+ meanMoDev1: line1.meanMoDev1,
71
+ meanMoDev2: line1.meanMoDev2,
72
+ bstar: line1.bstar,
73
+ inclination: line2.inclination,
74
+ raan: line2.raan,
75
+ eccentricity: line2.eccentricity,
76
+ argOfPerigee: line2.argOfPerigee,
77
+ meanAnomaly: line2.meanAnomaly,
78
+ meanMotion: line2.meanMotion,
79
+ };
80
+ };
81
+ /**
82
+ * Parses all of the data contained in the TLE.
83
+ *
84
+ * If you only want the most commonly used data then use parseTle instead.
85
+ * @param {TleLine1} tleLine1 The first line of the TLE to parse.
86
+ * @param {TleLine2} tleLine2 The second line of the TLE to parse.
87
+ * @returns {TleDataFull} Returns all of the data from the TLE.
88
+ */
89
+ Tle.parseTleFull = function (tleLine1, tleLine2) {
90
+ var line1 = Tle.parseLine1(tleLine1);
91
+ var line2 = Tle.parseLine2(tleLine2);
92
+ if (line1.satNum !== line2.satNum) {
93
+ throw new Error('Satellite numbers do not match');
94
+ }
95
+ if (line1.satNumRaw !== line2.satNumRaw) {
96
+ throw new Error('Raw satellite numbers do not match');
97
+ }
98
+ if (line1.lineNumber1 !== 1) {
99
+ throw new Error('First line number must be 1');
100
+ }
101
+ if (line2.lineNumber2 !== 2) {
102
+ throw new Error('Second line number must be 2');
103
+ }
104
+ return __assign(__assign({}, line1), line2);
105
+ };
106
+ /**
107
+ * Parse the first line of the TLE.
108
+ * @param {TleLine1} tleLine1 The first line of the TLE to parse.
109
+ * @returns {Line1Data} Returns the data from the first line of the TLE.
110
+ */
111
+ Tle.parseLine1 = function (tleLine1) {
112
+ var lineNumber1 = Tle.getLineNumber(tleLine1);
113
+ var satNum = Tle.getSatNum(tleLine1);
114
+ var satNumRaw = Tle.getRawSatNum(tleLine1);
115
+ var classification = Tle.getClassification(tleLine1);
116
+ var intlDes = Tle.getIntlDes(tleLine1);
117
+ var intlDesYear = Tle.getIntlDesYear(tleLine1);
118
+ var intlDesLaunchNum = Tle.getIntlDesLaunchNum(tleLine1);
119
+ var intlDesLaunchPiece = Tle.getIntlDesLaunchPiece(tleLine1);
120
+ var epochYear = Tle.getEpochYear(tleLine1);
121
+ var epochYearFull = Tle.getEpochYearFull(tleLine1);
122
+ var epochDay = Tle.getEpochDay(tleLine1);
123
+ var meanMoDev1 = Tle.getMeanMoDev1(tleLine1);
124
+ var meanMoDev2 = Tle.getMeanMoDev2(tleLine1);
125
+ var bstar = Tle.getBstar(tleLine1);
126
+ var ephemerisType = Tle.getEphemerisType(tleLine1);
127
+ var elsetNum = Tle.getElsetNum(tleLine1);
128
+ var checksum1 = Tle.getChecksum(tleLine1);
129
+ return {
130
+ lineNumber1: lineNumber1,
131
+ satNum: satNum,
132
+ satNumRaw: satNumRaw,
133
+ classification: classification,
134
+ intlDes: intlDes,
135
+ intlDesYear: intlDesYear,
136
+ intlDesLaunchNum: intlDesLaunchNum,
137
+ intlDesLaunchPiece: intlDesLaunchPiece,
138
+ epochYear: epochYear,
139
+ epochYearFull: epochYearFull,
140
+ epochDay: epochDay,
141
+ meanMoDev1: meanMoDev1,
142
+ meanMoDev2: meanMoDev2,
143
+ bstar: bstar,
144
+ ephemerisType: ephemerisType,
145
+ elsetNum: elsetNum,
146
+ checksum1: checksum1,
147
+ };
148
+ };
149
+ /**
150
+ * Parse the second line of the TLE.
151
+ * @param {TleLine2} tleLine2 The second line of the TLE to parse.
152
+ * @returns {Line2Data} Returns the data from the second line of the TLE.
153
+ */
154
+ Tle.parseLine2 = function (tleLine2) {
155
+ var lineNumber2 = Tle.getLineNumber(tleLine2);
156
+ var satNum = Tle.getSatNum(tleLine2);
157
+ var satNumRaw = Tle.getRawSatNum(tleLine2);
158
+ var inclination = Tle.getInclination(tleLine2);
159
+ var raan = Tle.getRaan(tleLine2);
160
+ var eccentricity = Tle.getEccentricity(tleLine2);
161
+ var argOfPerigee = Tle.getArgOfPerigee(tleLine2);
162
+ var meanAnomaly = Tle.getMeanAnomaly(tleLine2);
163
+ var meanMotion = Tle.getMeanMotion(tleLine2);
164
+ var revNum = Tle.getRevNum(tleLine2);
165
+ var checksum2 = Tle.getChecksum(tleLine2);
166
+ return {
167
+ lineNumber2: lineNumber2,
168
+ satNum: satNum,
169
+ satNumRaw: satNumRaw,
170
+ inclination: inclination,
171
+ raan: raan,
172
+ eccentricity: eccentricity,
173
+ argOfPerigee: argOfPerigee,
174
+ meanAnomaly: meanAnomaly,
175
+ meanMotion: meanMotion,
176
+ revNum: revNum,
177
+ checksum2: checksum2,
178
+ };
179
+ };
180
+ /**
181
+ * This should always return a 1 or a 2.
182
+ * @param {string} tleLine The first line of the TLE to parse.
183
+ * @returns {number} The line number of the TLE.
184
+ */
185
+ Tle.getLineNumber = function (tleLine) {
186
+ var lineNum = parseInt(tleLine.substring(Tle.lineNumber.start, Tle.lineNumber.stop));
187
+ if (lineNum !== 1 && lineNum !== 2) {
188
+ throw new Error('Invalid line number');
189
+ }
190
+ return lineNum;
191
+ };
192
+ /**
193
+ * See https://en.wikipedia.org/wiki/Satellite_Catalog_Number
194
+ *
195
+ * Range: 0 to 99999 or 26999.
196
+ *
197
+ * NOTE: To support Alpha-5, the first digit can be a letter.
198
+ * This will be converted to a number in order to expand the range to 26999.
199
+ *
200
+ * Example: 25544 or B1234 (e.g. Sputnik's rocket body was number 00001)
201
+ *
202
+ * @param {string} tleLine The first line of the TLE to parse.
203
+ * @returns {number} NORAD catalog number.
204
+ */
205
+ Tle.getSatNum = function (tleLine) {
206
+ var satNumStr = tleLine.substring(Tle.satNum.start, Tle.satNum.stop);
207
+ var leadingChar = satNumStr.split('')[0].toLowerCase(); // Using uppercase will break the -96 math.
208
+ if (isNaN(parseInt(leadingChar))) {
209
+ return parseInt(leadingChar.charCodeAt(0) - 96 + 9 + satNumStr.slice(1, 5));
210
+ }
211
+ return parseInt(satNumStr);
212
+ };
213
+ /**
214
+ * See https://en.wikipedia.org/wiki/Satellite_Catalog_Number
215
+ *
216
+ * Range: 0 to 99999 or 26999.
217
+ *
218
+ * NOTE: To support Alpha-5, the first digit can be a letter.
219
+ * This will NOT be converted to a number. Use getSatNum() for that.
220
+ *
221
+ * Example: 25544 or B1234 (e.g. Sputnik's rocket body was number 00001)
222
+ *
223
+ * @param {string} tleLine The first line of the TLE to parse.
224
+ * @returns {string} NORAD catalog number.
225
+ */
226
+ Tle.getRawSatNum = function (tleLine) {
227
+ return tleLine.substring(Tle.satNum.start, Tle.satNum.stop);
228
+ };
229
+ /**
230
+ * Satellite classification.
231
+ * * 'U' = unclassified
232
+ * * 'C' = confidential
233
+ * * 'S' = secret
234
+ *
235
+ * Example: 'U'
236
+ * @param {string} tleLine1 The first line of the TLE to parse.
237
+ * @returns {string} The classification.
238
+ */
239
+ Tle.getClassification = function (tleLine1) {
240
+ return tleLine1.substring(Tle.classification.start, Tle.classification.stop);
241
+ };
242
+ /**
243
+ * International Designator (COSPAR ID)
244
+ * See https://en.wikipedia.org/wiki/International_Designator
245
+ * @param {string} tleLine1 The first line of the TLE to parse.
246
+ * @returns {string} The International Designator.
247
+ */
248
+ Tle.getIntlDes = function (tleLine1) {
249
+ return tleLine1.substring(Tle.intlDes.start, Tle.intlDes.stop).trim();
250
+ };
251
+ /**
252
+ * International Designator (COSPAR ID): Last 2 digits of launch year.
253
+ *
254
+ * Range: 00 to 99
255
+ *
256
+ * Example: 98
257
+ *
258
+ * @param {string} tleLine1 The first line of the TLE to parse.
259
+ * @returns {number} The year of the International Designator.
260
+ */
261
+ Tle.getIntlDesYear = function (tleLine1) {
262
+ return parseInt(tleLine1.substring(Tle.intlDesYear.start, Tle.intlDesYear.stop));
263
+ };
264
+ /**
265
+ * International Designator (COSPAR ID): Launch number of the year.
266
+ *
267
+ * Range: 1 to 999
268
+ *
269
+ * Example: 67
270
+ *
271
+ * @param {string} tleLine1 The first line of the TLE to parse.
272
+ * @returns {number} The launch number of the International Designator.
273
+ */
274
+ Tle.getIntlDesLaunchNum = function (tleLine1) {
275
+ return parseInt(tleLine1.substring(Tle.intlDesLaunchNum.start, Tle.intlDesLaunchNum.stop));
276
+ };
277
+ /**
278
+ * International Designator (COSPAR ID): Piece of the launch.
279
+ *
280
+ * Range: A to ZZZ
281
+ *
282
+ * Example: 'A'
283
+ *
284
+ * @param {string} tleLine1 The first line of the TLE to parse.
285
+ * @returns {string} The launch piece of the International Designator.
286
+ */
287
+ Tle.getIntlDesLaunchPiece = function (tleLine1) {
288
+ return tleLine1.substring(Tle.intlDesLaunchPiece.start, Tle.intlDesLaunchPiece.stop).trim();
289
+ };
290
+ /**
291
+ * Year when the TLE was generated (TLE epoch), last two digits.
292
+ *
293
+ * Range: 00 to 99
294
+ *
295
+ * Example: 17
296
+ *
297
+ * @param {string} tleLine1 The first line of the TLE to parse.
298
+ * @returns {number} The year the TLE was generated.
299
+ */
300
+ Tle.getEpochYear = function (tleLine1) {
301
+ var epochYear = parseInt(tleLine1.substring(Tle.epochYear.start, Tle.epochYear.stop));
302
+ if (epochYear < 0 || epochYear > 99) {
303
+ throw new Error('Invalid epoch year');
304
+ }
305
+ return epochYear;
306
+ };
307
+ /**
308
+ * Year when the TLE was generated (TLE epoch), four digits.
309
+ *
310
+ * Range: 1957 to 2056
311
+ *
312
+ * Example: 2008
313
+ *
314
+ * @param {string} tleLine1 The first line of the TLE to parse.
315
+ * @returns {number} The year the TLE was generated.
316
+ */
317
+ Tle.getEpochYearFull = function (tleLine1) {
318
+ var epochYear = parseInt(tleLine1.substring(Tle.epochYear.start, Tle.epochYear.stop));
319
+ if (epochYear < 0 || epochYear > 99) {
320
+ throw new Error('Invalid epoch year');
321
+ }
322
+ if (epochYear < 57) {
323
+ return epochYear + 2000;
324
+ }
325
+ return epochYear + 1900;
326
+ };
327
+ /**
328
+ * Fractional day of the year when the TLE was generated (TLE epoch).
329
+ *
330
+ * Range: 1 to 365.99999999
331
+ *
332
+ * Example: 206.18396726
333
+ *
334
+ * @param {string} tleLine1 The first line of the TLE to parse.
335
+ * @returns {number} The day of the year the TLE was generated.
336
+ */
337
+ Tle.getEpochDay = function (tleLine1) {
338
+ var epochDay = parseFloat(tleLine1.substring(Tle.epochDay.start, Tle.epochDay.stop));
339
+ if (epochDay < 1 || epochDay > 365.99999999) {
340
+ throw new Error('Invalid epoch day');
341
+ }
342
+ return Utils.roundToNDecimalPlaces(epochDay, 8);
343
+ };
344
+ /**
345
+ * First Time Derivative of the Mean Motion divided by two. Defines how mean motion changes
346
+ * over time, so TLE propagators can still be used to make reasonable guesses when
347
+ * times are distant from the original TLE epoch.
348
+ *
349
+ * Units: Orbits / day ^ 2
350
+ *
351
+ * Example: 0.00001961
352
+ *
353
+ * @param {string} tleLine1 The first line of the TLE to parse.
354
+ * @returns {number} The first derivative of the mean motion.
355
+ */
356
+ Tle.getMeanMoDev1 = function (tleLine1) {
357
+ var meanMoDev1 = parseFloat(tleLine1.substring(Tle.meanMoDev1.start, Tle.meanMoDev1.stop));
358
+ if (isNaN(meanMoDev1)) {
359
+ throw new Error('Invalid first derivative of mean motion.');
360
+ }
361
+ return Utils.roundToNDecimalPlaces(meanMoDev1, 8);
362
+ };
363
+ /**
364
+ * Second Time Derivative of Mean Motion divided by six (decimal point assumed). Measures rate
365
+ * of change in the Mean Motion Dot so software can make reasonable guesses when times are
366
+ * distant from the original TLE epoch.
367
+ *
368
+ * Usually zero, unless the satellite is manuevering or in a decaying orbit.
369
+ *
370
+ * Units: Orbits / day ^ 3.
371
+ *
372
+ * Example: 0 ('00000-0' in the original TLE [= 0.00000 * 10 ^ 0])
373
+ *
374
+ * @param {string} tleLine1 The first line of the TLE to parse.
375
+ * @returns {number} The second derivative of the mean motion.
376
+ */
377
+ Tle.getMeanMoDev2 = function (tleLine1) {
378
+ var meanMoDev2 = parseFloat(tleLine1.substring(Tle.meanMoDev2.start, Tle.meanMoDev2.stop));
379
+ if (isNaN(meanMoDev2)) {
380
+ throw new Error('Invalid second derivative of mean motion.');
381
+ }
382
+ // NOTE: Should this limit to a specific number of decimals?
383
+ return meanMoDev2;
384
+ };
385
+ /**
386
+ * BSTAR drag term (decimal point assumed). Estimates the effects of
387
+ * atmospheric drag on the satellite's motion.
388
+ *
389
+ * Units: EarthRadii ^ -1
390
+ *
391
+ * Example: 0.000036771 ('36771-4' in the original TLE [= 0.36771 * 10 ^ -4])
392
+ *
393
+ * @param {string} tleLine1 The first line of the TLE to parse.
394
+ * @returns {number} The drag coefficient.
395
+ */
396
+ Tle.getBstar = function (tleLine1) {
397
+ var BSTAR_PART_2 = Tle.bstar.start + 1;
398
+ var BSTAR_PART_3 = Tle.bstar.start + 6;
399
+ var BSTAR_PART_4 = Tle.bstar.stop - 1;
400
+ var bstarSymbol = tleLine1.substring(Tle.bstar.start, BSTAR_PART_2);
401
+ // Decimal place is assumed
402
+ var bstar1 = parseFloat("0.".concat(tleLine1.substring(BSTAR_PART_2, BSTAR_PART_3)));
403
+ var exponentSymbol = tleLine1.substring(BSTAR_PART_3, BSTAR_PART_4);
404
+ var exponent = parseInt(tleLine1.substring(BSTAR_PART_4, Tle.bstar.stop));
405
+ if (exponentSymbol === '-') {
406
+ exponent *= -1;
407
+ }
408
+ else if (exponentSymbol !== '+') {
409
+ throw new Error("Invalid BSTAR symbol: ".concat(bstarSymbol));
410
+ }
411
+ bstar1 *= Math.pow(10, exponent);
412
+ if (bstarSymbol === '-') {
413
+ bstar1 *= -1;
414
+ }
415
+ else if (bstarSymbol === '+' || bstarSymbol === ' ') {
416
+ // Do nothing
417
+ }
418
+ else {
419
+ throw new Error("Invalid BSTAR symbol: ".concat(bstarSymbol));
420
+ }
421
+ return Utils.roundToNDecimalPlaces(bstar1, 14);
422
+ };
423
+ /**
424
+ * Private value - used by United States Space Force to reference the orbit model used to
425
+ * generate the TLE. Will always be seen as zero externally (e.g. by "us", unless you are
426
+ * "them" - in which case, hello!).
427
+ *
428
+ * Example: 0
429
+ *
430
+ * @param {string} tleLine1 The first line of the TLE to parse.
431
+ * @returns {number} The ephemeris type.
432
+ */
433
+ Tle.getEphemerisType = function (tleLine1) {
434
+ return parseInt(tleLine1.substring(Tle.ephemerisType.start, Tle.ephemerisType.stop));
435
+ };
436
+ /**
437
+ * TLE element set number, incremented for each new TLE generated. 999 seems to mean the TLE
438
+ * has maxed out.
439
+ *
440
+ * Range: Technically 1 to 9999, though in practice the maximum number seems to be 999.
441
+ *
442
+ * Example: 999
443
+ * @param {string} tleLine1 The first line of the TLE to parse.
444
+ * @returns {number} The element number.
445
+ */
446
+ Tle.getElsetNum = function (tleLine1) {
447
+ return parseInt(tleLine1.substring(Tle.elsetNum.start, Tle.elsetNum.stop));
448
+ };
449
+ /**
450
+ * TLE line 1 checksum (modulo 10), for verifying the integrity of this line of the TLE.
451
+ *
452
+ * Range: 0 to 9
453
+ * Example: 3
454
+ *
455
+ * @param {string} tleLine1 The first line of the TLE to parse.
456
+ * @returns {number} The checksum value.
457
+ */
458
+ Tle.getChecksum = function (tleLine1) {
459
+ return parseInt(tleLine1.substring(Tle.checksum.start, Tle.checksum.stop));
460
+ };
461
+ /**
462
+ * Inclination relative to the Earth's equatorial plane in degrees. 0 to 90 degrees is a
463
+ * prograde orbit and 90 to 180 degrees is a retrograde orbit.
464
+ *
465
+ * Units: degrees
466
+ *
467
+ * Range: 0 to 180
468
+ *
469
+ * Example: 51.6400
470
+ *
471
+ * @param {string} tleLine2 The second line of the TLE to parse.
472
+ * @returns {number} The inclination of the satellite.
473
+ */
474
+ Tle.getInclination = function (tleLine2) {
475
+ var inc = parseFloat(tleLine2.substring(Tle.inclination.start, Tle.inclination.stop));
476
+ if (inc < 0 || inc > 180) {
477
+ throw new Error("Invalid inclination: ".concat(inc));
478
+ }
479
+ return Utils.roundToNDecimalPlaces(inc, 4);
480
+ };
481
+ /**
482
+ * Right ascension of the ascending node in degrees. Essentially, this is the angle of the
483
+ * satellite as it crosses northward (ascending) across the Earth's equator (equatorial
484
+ * plane).
485
+ *
486
+ * Units: degrees
487
+ *
488
+ * Range: 0 to 359.9999
489
+ *
490
+ * Example: 208.9163
491
+ *
492
+ * @param {string} tleLine2 The second line of the TLE to parse.
493
+ * @returns {number} The right ascension of the satellite.
494
+ */
495
+ Tle.getRaan = function (tleLine2) {
496
+ var raan = parseFloat(tleLine2.substring(Tle.raan.start, Tle.raan.stop));
497
+ if (!(raan >= 0 && raan <= 360)) {
498
+ throw new Error("Invalid RAAN: ".concat(raan));
499
+ }
500
+ return Utils.roundToNDecimalPlaces(raan, 4);
501
+ };
502
+ /**
503
+ * Orbital eccentricity, decimal point assumed. All artificial Earth satellites have an
504
+ * eccentricity between 0 (perfect circle) and 1 (parabolic orbit).
505
+ *
506
+ * Range: 0 to 1
507
+ *
508
+ * Example: 0.0006317 (`0006317` in the original TLE)
509
+ *
510
+ * @param {string} tleLine2 The second line of the TLE to parse.
511
+ * @returns {number} The eccentricity of the satellite.
512
+ */
513
+ Tle.getEccentricity = function (tleLine2) {
514
+ var ecc = parseFloat("0.".concat(tleLine2.substring(Tle.eccentricity.start, Tle.eccentricity.stop)));
515
+ if (!(ecc >= 0 && ecc <= 1)) {
516
+ throw new Error("Invalid eccentricity: ".concat(ecc));
517
+ }
518
+ return Utils.roundToNDecimalPlaces(ecc, 7);
519
+ };
520
+ /**
521
+ * Argument of perigee. See https://en.wikipedia.org/wiki/Argument_of_perigee
522
+ *
523
+ * Units: degrees
524
+ *
525
+ * Range: 0 to 359.9999
526
+ *
527
+ * Example: 69.9862
528
+ *
529
+ * @param {string} tleLine2 The second line of the TLE to parse.
530
+ * @returns {number} The argument of perigee in degrees.
531
+ */
532
+ Tle.getArgOfPerigee = function (tleLine2) {
533
+ var argPe = parseFloat(tleLine2.substring(Tle.argPerigee.start, Tle.argPerigee.stop));
534
+ if (!(argPe >= 0 && argPe <= 360)) {
535
+ throw new Error("Invalid argument of perigee: ".concat(argPe));
536
+ }
537
+ return Utils.roundToNDecimalPlaces(argPe, 4);
538
+ };
539
+ /**
540
+ * Mean anomaly. Indicates where the satellite was located within its orbit at the time of the
541
+ * TLE epoch.
542
+ * See https://en.wikipedia.org/wiki/Mean_Anomaly
543
+ *
544
+ * Units: degrees
545
+ *
546
+ * Range: 0 to 359.9999
547
+ *
548
+ * Example: 25.2906
549
+ *
550
+ * @param {string} tleLine2 The second line of the TLE to parse.
551
+ * @returns {number} The mean anomaly of the satellite.
552
+ */
553
+ Tle.getMeanAnomaly = function (tleLine2) {
554
+ var meanA = parseFloat(tleLine2.substring(Tle.meanAnom.start, Tle.meanAnom.stop));
555
+ if (!(meanA >= 0 && meanA <= 360)) {
556
+ throw new Error("Invalid mean anomaly: ".concat(meanA));
557
+ }
558
+ return Utils.roundToNDecimalPlaces(meanA, 4);
559
+ };
560
+ /**
561
+ * Revolutions around the Earth per day (mean motion).
562
+ * See https://en.wikipedia.org/wiki/Mean_Motion
563
+ *
564
+ * Range: 0 to 17 (theoretically)
565
+ * Example: 15.54225995
566
+ * @param {string} tleLine2 The second line of the TLE to parse.
567
+ * @returns {number} The mean motion of the satellite.
568
+ */
569
+ Tle.getMeanMotion = function (tleLine2) {
570
+ var meanMo = parseFloat(tleLine2.substring(Tle.meanMo.start, Tle.meanMo.stop));
571
+ if (!(meanMo >= 0 && meanMo <= 17)) {
572
+ throw new Error("Invalid mean motion: ".concat(meanMo));
573
+ }
574
+ return Utils.roundToNDecimalPlaces(meanMo, 8);
575
+ };
576
+ /**
577
+ * Total satellite revolutions when this TLE was generated. This number rolls over
578
+ * (e.g. 99999 -> 0).
579
+ *
580
+ * Range: 0 to 99999
581
+ *
582
+ * Example: 6766
583
+ *
584
+ * @param {string} tleLine2 The second line of the TLE to parse.
585
+ * @returns {number} The revolutions around the Earth per day (mean motion).
586
+ */
587
+ Tle.getRevNum = function (tleLine2) {
588
+ return parseInt(tleLine2.substring(Tle.revNum.start, Tle.revNum.stop));
589
+ };
590
+ Tle.lineNumber = new TleFormatData(1, 1);
591
+ Tle.satNum = new TleFormatData(3, 7);
592
+ Tle.classification = new TleFormatData(8, 8);
593
+ Tle.intlDes = new TleFormatData(10, 17);
594
+ Tle.intlDesYear = new TleFormatData(10, 11);
595
+ Tle.intlDesLaunchNum = new TleFormatData(12, 14);
596
+ Tle.intlDesLaunchPiece = new TleFormatData(15, 17);
597
+ Tle.epochYear = new TleFormatData(19, 20);
598
+ Tle.epochDay = new TleFormatData(21, 32);
599
+ Tle.meanMoDev1 = new TleFormatData(34, 43);
600
+ Tle.meanMoDev2 = new TleFormatData(45, 52);
601
+ Tle.bstar = new TleFormatData(54, 61);
602
+ Tle.ephemerisType = new TleFormatData(63, 63);
603
+ Tle.elsetNum = new TleFormatData(65, 68);
604
+ Tle.checksum = new TleFormatData(69, 69);
605
+ Tle.inclination = new TleFormatData(9, 16);
606
+ Tle.raan = new TleFormatData(18, 25);
607
+ Tle.eccentricity = new TleFormatData(27, 33);
608
+ Tle.argPerigee = new TleFormatData(35, 42);
609
+ Tle.meanAnom = new TleFormatData(44, 51);
610
+ Tle.meanMo = new TleFormatData(53, 63);
611
+ Tle.revNum = new TleFormatData(64, 68);
612
+ return Tle;
613
+ }());
614
+ export { Tle };
615
+ //# sourceMappingURL=t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a,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAEnC,UAAM,GAAG,IAAI,aAAa,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IA0mBpD,UAAC;CAAA,AArpBD,IAqpBC;SArpBY,GAAG"}
@@ -25,7 +25,7 @@
25
25
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
26
  * SOFTWARE.
27
27
  */
28
- import { Degrees, EcfVec3, EciVec3, LlaVec3, Radians, RaeVec3, SezVec3 } from './utils/types';
28
+ import { Degrees, EcfVec3, EciVec3, LlaVec3, Radians, RaeVec3, SezVec3 } from './types';
29
29
  declare class Transforms {
30
30
  static getDegLat(radians: Radians): Degrees;
31
31
  static getDegLon(radians: Radians): Degrees;
@@ -35,7 +35,8 @@ declare class Transforms {
35
35
  static deg2rad(degrees: Degrees): Radians;
36
36
  static ecf2eci(ecf: EcfVec3, gmst: number): EciVec3;
37
37
  static ecf2rae(lla: LlaVec3, ecf: EcfVec3): RaeVec3;
38
- /** eciToGeodetic converts eci coordinates to lla coordinates
38
+ /**
39
+ * EciToGeodetic converts eci coordinates to lla coordinates
39
40
  * @param {vec3} eci takes xyz coordinates
40
41
  * @param {number} gmst takes a number in gmst time
41
42
  * @returns {array} array containing lla coordinates