ootk 1.0.8 → 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.d.ts ADDED
@@ -0,0 +1,378 @@
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
+ import { Line1Data, Line2Data, TleLine1, TleLine2 } from './types';
27
+ declare type TleData = {
28
+ satNum: number;
29
+ intlDes: string;
30
+ epochYear: number;
31
+ epochDay: number;
32
+ meanMoDev1: number;
33
+ meanMoDev2: number;
34
+ bstar: number;
35
+ inclination: number;
36
+ raan: number;
37
+ eccentricity: number;
38
+ argOfPerigee: number;
39
+ meanAnomaly: number;
40
+ meanMotion: number;
41
+ };
42
+ declare type TleDataFull = Line1Data & Line2Data;
43
+ export declare class Tle {
44
+ private static lineNumber;
45
+ private static satNum;
46
+ private static classification;
47
+ private static intlDes;
48
+ private static intlDesYear;
49
+ private static intlDesLaunchNum;
50
+ private static intlDesLaunchPiece;
51
+ private static epochYear;
52
+ private static epochDay;
53
+ private static meanMoDev1;
54
+ private static meanMoDev2;
55
+ private static bstar;
56
+ private static ephemerisType;
57
+ private static elsetNum;
58
+ private static checksum;
59
+ private static inclination;
60
+ private static raan;
61
+ private static eccentricity;
62
+ private static argPerigee;
63
+ private static meanAnom;
64
+ private static meanMo;
65
+ private static revNum;
66
+ /**
67
+ * Parses the TLE into orbital data.
68
+ *
69
+ * If you want all of the data then use parseTleFull instead.
70
+ * @param {TleLine1} tleLine1 TLE line 1
71
+ * @param {TleLine2} tleLine2 TLE line 2
72
+ * @returns {TleData} Returns most commonly used orbital data from TLE
73
+ */
74
+ static parseTle(tleLine1: TleLine1, tleLine2: TleLine2): TleData;
75
+ /**
76
+ * Parses all of the data contained in the TLE.
77
+ *
78
+ * If you only want the most commonly used data then use parseTle instead.
79
+ * @param {TleLine1} tleLine1 The first line of the TLE to parse.
80
+ * @param {TleLine2} tleLine2 The second line of the TLE to parse.
81
+ * @returns {TleDataFull} Returns all of the data from the TLE.
82
+ */
83
+ static parseTleFull(tleLine1: TleLine1, tleLine2: TleLine2): TleDataFull;
84
+ /**
85
+ * Parse the first line of the TLE.
86
+ * @param {TleLine1} tleLine1 The first line of the TLE to parse.
87
+ * @returns {Line1Data} Returns the data from the first line of the TLE.
88
+ */
89
+ static parseLine1(tleLine1: TleLine1): Line1Data;
90
+ /**
91
+ * Parse the second line of the TLE.
92
+ * @param {TleLine2} tleLine2 The second line of the TLE to parse.
93
+ * @returns {Line2Data} Returns the data from the second line of the TLE.
94
+ */
95
+ static parseLine2(tleLine2: TleLine2): Line2Data;
96
+ /**
97
+ * This should always return a 1 or a 2.
98
+ * @param {string} tleLine The first line of the TLE to parse.
99
+ * @returns {number} The line number of the TLE.
100
+ */
101
+ static getLineNumber(tleLine: TleLine1 | TleLine2): 1 | 2;
102
+ /**
103
+ * See https://en.wikipedia.org/wiki/Satellite_Catalog_Number
104
+ *
105
+ * Range: 0 to 99999 or 26999.
106
+ *
107
+ * NOTE: To support Alpha-5, the first digit can be a letter.
108
+ * This will be converted to a number in order to expand the range to 26999.
109
+ *
110
+ * Example: 25544 or B1234 (e.g. Sputnik's rocket body was number 00001)
111
+ *
112
+ * @param {string} tleLine The first line of the TLE to parse.
113
+ * @returns {number} NORAD catalog number.
114
+ */
115
+ static getSatNum(tleLine: TleLine1 | TleLine2): number;
116
+ /**
117
+ * See https://en.wikipedia.org/wiki/Satellite_Catalog_Number
118
+ *
119
+ * Range: 0 to 99999 or 26999.
120
+ *
121
+ * NOTE: To support Alpha-5, the first digit can be a letter.
122
+ * This will NOT be converted to a number. Use getSatNum() for that.
123
+ *
124
+ * Example: 25544 or B1234 (e.g. Sputnik's rocket body was number 00001)
125
+ *
126
+ * @param {string} tleLine The first line of the TLE to parse.
127
+ * @returns {string} NORAD catalog number.
128
+ */
129
+ static getRawSatNum(tleLine: TleLine1 | TleLine2): string;
130
+ /**
131
+ * Satellite classification.
132
+ * * 'U' = unclassified
133
+ * * 'C' = confidential
134
+ * * 'S' = secret
135
+ *
136
+ * Example: 'U'
137
+ * @param {string} tleLine1 The first line of the TLE to parse.
138
+ * @returns {string} The classification.
139
+ */
140
+ static getClassification(tleLine1: TleLine1): string;
141
+ /**
142
+ * International Designator (COSPAR ID)
143
+ * See https://en.wikipedia.org/wiki/International_Designator
144
+ * @param {string} tleLine1 The first line of the TLE to parse.
145
+ * @returns {string} The International Designator.
146
+ */
147
+ static getIntlDes(tleLine1: TleLine1): string;
148
+ /**
149
+ * International Designator (COSPAR ID): Last 2 digits of launch year.
150
+ *
151
+ * Range: 00 to 99
152
+ *
153
+ * Example: 98
154
+ *
155
+ * @param {string} tleLine1 The first line of the TLE to parse.
156
+ * @returns {number} The year of the International Designator.
157
+ */
158
+ static getIntlDesYear(tleLine1: TleLine1): number;
159
+ /**
160
+ * International Designator (COSPAR ID): Launch number of the year.
161
+ *
162
+ * Range: 1 to 999
163
+ *
164
+ * Example: 67
165
+ *
166
+ * @param {string} tleLine1 The first line of the TLE to parse.
167
+ * @returns {number} The launch number of the International Designator.
168
+ */
169
+ static getIntlDesLaunchNum(tleLine1: string): number;
170
+ /**
171
+ * International Designator (COSPAR ID): Piece of the launch.
172
+ *
173
+ * Range: A to ZZZ
174
+ *
175
+ * Example: 'A'
176
+ *
177
+ * @param {string} tleLine1 The first line of the TLE to parse.
178
+ * @returns {string} The launch piece of the International Designator.
179
+ */
180
+ static getIntlDesLaunchPiece(tleLine1: TleLine1): string;
181
+ /**
182
+ * Year when the TLE was generated (TLE epoch), last two digits.
183
+ *
184
+ * Range: 00 to 99
185
+ *
186
+ * Example: 17
187
+ *
188
+ * @param {string} tleLine1 The first line of the TLE to parse.
189
+ * @returns {number} The year the TLE was generated.
190
+ */
191
+ static getEpochYear(tleLine1: TleLine1): number;
192
+ /**
193
+ * Year when the TLE was generated (TLE epoch), four digits.
194
+ *
195
+ * Range: 1957 to 2056
196
+ *
197
+ * Example: 2008
198
+ *
199
+ * @param {string} tleLine1 The first line of the TLE to parse.
200
+ * @returns {number} The year the TLE was generated.
201
+ */
202
+ static getEpochYearFull(tleLine1: TleLine1): number;
203
+ /**
204
+ * Fractional day of the year when the TLE was generated (TLE epoch).
205
+ *
206
+ * Range: 1 to 365.99999999
207
+ *
208
+ * Example: 206.18396726
209
+ *
210
+ * @param {string} tleLine1 The first line of the TLE to parse.
211
+ * @returns {number} The day of the year the TLE was generated.
212
+ */
213
+ static getEpochDay(tleLine1: string): number;
214
+ /**
215
+ * First Time Derivative of the Mean Motion divided by two. Defines how mean motion changes
216
+ * over time, so TLE propagators can still be used to make reasonable guesses when
217
+ * times are distant from the original TLE epoch.
218
+ *
219
+ * Units: Orbits / day ^ 2
220
+ *
221
+ * Example: 0.00001961
222
+ *
223
+ * @param {string} tleLine1 The first line of the TLE to parse.
224
+ * @returns {number} The first derivative of the mean motion.
225
+ */
226
+ static getMeanMoDev1(tleLine1: TleLine1): number;
227
+ /**
228
+ * Second Time Derivative of Mean Motion divided by six (decimal point assumed). Measures rate
229
+ * of change in the Mean Motion Dot so software can make reasonable guesses when times are
230
+ * distant from the original TLE epoch.
231
+ *
232
+ * Usually zero, unless the satellite is manuevering or in a decaying orbit.
233
+ *
234
+ * Units: Orbits / day ^ 3.
235
+ *
236
+ * Example: 0 ('00000-0' in the original TLE [= 0.00000 * 10 ^ 0])
237
+ *
238
+ * @param {string} tleLine1 The first line of the TLE to parse.
239
+ * @returns {number} The second derivative of the mean motion.
240
+ */
241
+ static getMeanMoDev2(tleLine1: string): number;
242
+ /**
243
+ * BSTAR drag term (decimal point assumed). Estimates the effects of
244
+ * atmospheric drag on the satellite's motion.
245
+ *
246
+ * Units: EarthRadii ^ -1
247
+ *
248
+ * Example: 0.000036771 ('36771-4' in the original TLE [= 0.36771 * 10 ^ -4])
249
+ *
250
+ * @param {string} tleLine1 The first line of the TLE to parse.
251
+ * @returns {number} The drag coefficient.
252
+ */
253
+ static getBstar(tleLine1: TleLine1): number;
254
+ /**
255
+ * Private value - used by United States Space Force to reference the orbit model used to
256
+ * generate the TLE. Will always be seen as zero externally (e.g. by "us", unless you are
257
+ * "them" - in which case, hello!).
258
+ *
259
+ * Example: 0
260
+ *
261
+ * @param {string} tleLine1 The first line of the TLE to parse.
262
+ * @returns {number} The ephemeris type.
263
+ */
264
+ static getEphemerisType(tleLine1: TleLine1): number;
265
+ /**
266
+ * TLE element set number, incremented for each new TLE generated. 999 seems to mean the TLE
267
+ * has maxed out.
268
+ *
269
+ * Range: Technically 1 to 9999, though in practice the maximum number seems to be 999.
270
+ *
271
+ * Example: 999
272
+ * @param {string} tleLine1 The first line of the TLE to parse.
273
+ * @returns {number} The element number.
274
+ */
275
+ static getElsetNum(tleLine1: TleLine1): number;
276
+ /**
277
+ * TLE line 1 checksum (modulo 10), for verifying the integrity of this line of the TLE.
278
+ *
279
+ * Range: 0 to 9
280
+ * Example: 3
281
+ *
282
+ * @param {string} tleLine1 The first line of the TLE to parse.
283
+ * @returns {number} The checksum value.
284
+ */
285
+ static getChecksum(tleLine1: TleLine1): number;
286
+ /**
287
+ * Inclination relative to the Earth's equatorial plane in degrees. 0 to 90 degrees is a
288
+ * prograde orbit and 90 to 180 degrees is a retrograde orbit.
289
+ *
290
+ * Units: degrees
291
+ *
292
+ * Range: 0 to 180
293
+ *
294
+ * Example: 51.6400
295
+ *
296
+ * @param {string} tleLine2 The second line of the TLE to parse.
297
+ * @returns {number} The inclination of the satellite.
298
+ */
299
+ static getInclination(tleLine2: TleLine2): number;
300
+ /**
301
+ * Right ascension of the ascending node in degrees. Essentially, this is the angle of the
302
+ * satellite as it crosses northward (ascending) across the Earth's equator (equatorial
303
+ * plane).
304
+ *
305
+ * Units: degrees
306
+ *
307
+ * Range: 0 to 359.9999
308
+ *
309
+ * Example: 208.9163
310
+ *
311
+ * @param {string} tleLine2 The second line of the TLE to parse.
312
+ * @returns {number} The right ascension of the satellite.
313
+ */
314
+ static getRaan(tleLine2: TleLine2): number;
315
+ /**
316
+ * Orbital eccentricity, decimal point assumed. All artificial Earth satellites have an
317
+ * eccentricity between 0 (perfect circle) and 1 (parabolic orbit).
318
+ *
319
+ * Range: 0 to 1
320
+ *
321
+ * Example: 0.0006317 (`0006317` in the original TLE)
322
+ *
323
+ * @param {string} tleLine2 The second line of the TLE to parse.
324
+ * @returns {number} The eccentricity of the satellite.
325
+ */
326
+ static getEccentricity(tleLine2: TleLine2): number;
327
+ /**
328
+ * Argument of perigee. See https://en.wikipedia.org/wiki/Argument_of_perigee
329
+ *
330
+ * Units: degrees
331
+ *
332
+ * Range: 0 to 359.9999
333
+ *
334
+ * Example: 69.9862
335
+ *
336
+ * @param {string} tleLine2 The second line of the TLE to parse.
337
+ * @returns {number} The argument of perigee in degrees.
338
+ */
339
+ static getArgOfPerigee(tleLine2: TleLine2): number;
340
+ /**
341
+ * Mean anomaly. Indicates where the satellite was located within its orbit at the time of the
342
+ * TLE epoch.
343
+ * See https://en.wikipedia.org/wiki/Mean_Anomaly
344
+ *
345
+ * Units: degrees
346
+ *
347
+ * Range: 0 to 359.9999
348
+ *
349
+ * Example: 25.2906
350
+ *
351
+ * @param {string} tleLine2 The second line of the TLE to parse.
352
+ * @returns {number} The mean anomaly of the satellite.
353
+ */
354
+ static getMeanAnomaly(tleLine2: TleLine2): number;
355
+ /**
356
+ * Revolutions around the Earth per day (mean motion).
357
+ * See https://en.wikipedia.org/wiki/Mean_Motion
358
+ *
359
+ * Range: 0 to 17 (theoretically)
360
+ * Example: 15.54225995
361
+ * @param {string} tleLine2 The second line of the TLE to parse.
362
+ * @returns {number} The mean motion of the satellite.
363
+ */
364
+ static getMeanMotion(tleLine2: TleLine2): number;
365
+ /**
366
+ * Total satellite revolutions when this TLE was generated. This number rolls over
367
+ * (e.g. 99999 -> 0).
368
+ *
369
+ * Range: 0 to 99999
370
+ *
371
+ * Example: 6766
372
+ *
373
+ * @param {string} tleLine2 The second line of the TLE to parse.
374
+ * @returns {number} The revolutions around the Earth per day (mean motion).
375
+ */
376
+ static getRevNum(tleLine2: TleLine2): number;
377
+ }
378
+ export {};