-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle.js
4783 lines (4280 loc) · 136 KB
/
bundle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
const TLEJS = require('tle.js');
const tlejs = new TLEJS();
mapboxgl.accessToken = 'pk.eyJ1IjoidGhlc25la3lzbmVrIiwiYSI6ImNqZHc2ZzExcDBpMDQycXM0Nm5nZGNlanMifQ.K9Mxb2Dkl_6cyspBwga1XA';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/thesnekysnek/cjy1l50bh0xg71coetzys6s16'
});
var socket = io();
var stations = []
var tle = []
var observations = []
var getJSON = function (url, callback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'json';
xhr.onload = function () {
var status = xhr.status;
if (status === 200) {
callback(null, xhr.response);
} else {
callback(status, xhr.response);
}
};
xhr.send();
};
map.on('load', function () {
// When a click event occurs on a feature in the places layer, open a popup at the
// location of the feature, with description HTML from its properties.
map.on('click', 'points', function (e) {
var coordinates = e.features[0].geometry.coordinates.slice();
var description = e.features[0].properties.description;
// Ensure that if the map is zoomed out such that multiple
// copies of the feature are visible, the popup appears
// over the copy being pointed to.
while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {
coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;
}
new mapboxgl.Popup()
.setLngLat(coordinates)
.setHTML(description)
.addTo(map);
});
// Change the cursor to a pointer when the mouse is over the places layer.
map.on('mouseenter', 'points', function () {
map.getCanvas().style.cursor = 'pointer';
});
// Change it back to a pointer when it leaves.
map.on('mouseleave', 'points', function () {
map.getCanvas().style.cursor = '';
});
//Stations
getJSON('stations.json', function (err, data) {
stations = data
var mapS = []
for (let i = 0; i < stations.length; i++) {
const s = stations[i];
mapS.push({
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [s.lng, s.lat]
},
"properties": {
"color": "255,0,0",
"description": "<strong>" + s.name + "</strong>"
}
})
}
map.addLayer({
"id": "points",
"type": "symbol",
"type": "circle",
"paint": {
"circle-radius": 4,
"circle-color": "#007cbf"
},
"source": {
"type": "geojson",
"data": {
"type": "FeatureCollection",
"features": mapS
}
}
});
});
//TLE
getJSON('tle.json', function (err, data) {
tle = data
});
//Observations
getJSON('observations.json', function (err, data) {
var sats = []
observations = data
for (let i = 0; i < data.length; i++) {
const o = data[i];
if(sats.includes(o.norad_cat_id)){
sats.push(o.norad_cat_id)
}
}
});
})
function showSats() {
var data = []
for (let i = 0; i < sats.length; i++) {
const s = sats[i];
var loc = tlejs.getLatLon(tle[sats[i]])
data.push({"type": "Point",
"coordinates": [
loc.lng,
loc.lat
]})
}
}
},{"tle.js":20}],2:[function(require,module,exports){
/*!
* satellite-js v3.0.1
* (c) 2013 Shashwat Kandadai and UCSC
* https://github.com/shashwatak/satellite-js
* License: MIT
*/
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.x2o3 = exports.j3oj2 = exports.j4 = exports.j3 = exports.j2 = exports.tumin = exports.vkmpersec = exports.xke = exports.earthRadius = exports.mu = exports.minutesPerDay = exports.rad2deg = exports.deg2rad = exports.twoPi = exports.pi = void 0;
var pi = Math.PI;
exports.pi = pi;
var twoPi = pi * 2;
exports.twoPi = twoPi;
var deg2rad = pi / 180.0;
exports.deg2rad = deg2rad;
var rad2deg = 180 / pi;
exports.rad2deg = rad2deg;
var minutesPerDay = 1440.0;
exports.minutesPerDay = minutesPerDay;
var mu = 398600.5; // in km3 / s2
exports.mu = mu;
var earthRadius = 6378.137; // in km
exports.earthRadius = earthRadius;
var xke = 60.0 / Math.sqrt(earthRadius * earthRadius * earthRadius / mu);
exports.xke = xke;
var vkmpersec = earthRadius * xke / 60.0;
exports.vkmpersec = vkmpersec;
var tumin = 1.0 / xke;
exports.tumin = tumin;
var j2 = 0.00108262998905;
exports.j2 = j2;
var j3 = -0.00000253215306;
exports.j3 = j3;
var j4 = -0.00000161098761;
exports.j4 = j4;
var j3oj2 = j3 / j2;
exports.j3oj2 = j3oj2;
var x2o3 = 2.0 / 3.0;
exports.x2o3 = x2o3;
},{}],3:[function(require,module,exports){
/*!
* satellite-js v3.0.1
* (c) 2013 Shashwat Kandadai and UCSC
* https://github.com/shashwatak/satellite-js
* License: MIT
*/
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = dopplerFactor;
function dopplerFactor(location, position, velocity) {
var currentRange = Math.sqrt(Math.pow(position.x - location.x, 2) + Math.pow(position.y - location.y, 2) + Math.pow(position.z - location.z, 2));
var nextPos = {
x: position.x + velocity.x,
y: position.y + velocity.y,
z: position.z + velocity.z
};
var nextRange = Math.sqrt(Math.pow(nextPos.x - location.x, 2) + Math.pow(nextPos.y - location.y, 2) + Math.pow(nextPos.z - location.z, 2));
var rangeRate = nextRange - currentRange;
function sign(value) {
return value >= 0 ? 1 : -1;
}
rangeRate *= sign(rangeRate);
var c = 299792.458; // Speed of light in km/s
return 1 + rangeRate / c;
}
},{}],4:[function(require,module,exports){
/*!
* satellite-js v3.0.1
* (c) 2013 Shashwat Kandadai and UCSC
* https://github.com/shashwatak/satellite-js
* License: MIT
*/
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.days2mdhms = days2mdhms;
exports.jday = jday;
exports.invjday = invjday;
/* -----------------------------------------------------------------------------
*
* procedure days2mdhms
*
* this procedure converts the day of the year, days, to the equivalent month
* day, hour, minute and second.
*
* algorithm : set up array for the number of days per month
* find leap year - use 1900 because 2000 is a leap year
* loop through a temp value while the value is < the days
* perform int conversions to the correct day and month
* convert remainder into h m s using type conversions
*
* author : david vallado 719-573-2600 1 mar 2001
*
* inputs description range / units
* year - year 1900 .. 2100
* days - julian day of the year 0.0 .. 366.0
*
* outputs :
* mon - month 1 .. 12
* day - day 1 .. 28,29,30,31
* hr - hour 0 .. 23
* min - minute 0 .. 59
* sec - second 0.0 .. 59.999
*
* locals :
* dayofyr - day of year
* temp - temporary extended values
* inttemp - temporary int value
* i - index
* lmonth[12] - int array containing the number of days per month
*
* coupling :
* none.
* --------------------------------------------------------------------------- */
function days2mdhms(year, days) {
var lmonth = [31, year % 4 === 0 ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var dayofyr = Math.floor(days); // ----------------- find month and day of month ----------------
var i = 1;
var inttemp = 0;
while (dayofyr > inttemp + lmonth[i - 1] && i < 12) {
inttemp += lmonth[i - 1];
i += 1;
}
var mon = i;
var day = dayofyr - inttemp; // ----------------- find hours minutes and seconds -------------
var temp = (days - dayofyr) * 24.0;
var hr = Math.floor(temp);
temp = (temp - hr) * 60.0;
var minute = Math.floor(temp);
var sec = (temp - minute) * 60.0;
return {
mon: mon,
day: day,
hr: hr,
minute: minute,
sec: sec
};
}
/* -----------------------------------------------------------------------------
*
* procedure jday
*
* this procedure finds the julian date given the year, month, day, and time.
* the julian date is defined by each elapsed day since noon, jan 1, 4713 bc.
*
* algorithm : calculate the answer in one step for efficiency
*
* author : david vallado 719-573-2600 1 mar 2001
*
* inputs description range / units
* year - year 1900 .. 2100
* mon - month 1 .. 12
* day - day 1 .. 28,29,30,31
* hr - universal time hour 0 .. 23
* min - universal time min 0 .. 59
* sec - universal time sec 0.0 .. 59.999
*
* outputs :
* jd - julian date days from 4713 bc
*
* locals :
* none.
*
* coupling :
* none.
*
* references :
* vallado 2007, 189, alg 14, ex 3-14
*
* --------------------------------------------------------------------------- */
function jdayInternal(year, mon, day, hr, minute, sec) {
var msec = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
return 367.0 * year - Math.floor(7 * (year + Math.floor((mon + 9) / 12.0)) * 0.25) + Math.floor(275 * mon / 9.0) + day + 1721013.5 + ((msec / 60000 + sec / 60.0 + minute) / 60.0 + hr) / 24.0 // ut in days
// # - 0.5*sgn(100.0*year + mon - 190002.5) + 0.5;
;
}
function jday(year, mon, day, hr, minute, sec, msec) {
if (year instanceof Date) {
var date = year;
return jdayInternal(date.getUTCFullYear(), date.getUTCMonth() + 1, // Note, this function requires months in range 1-12.
date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
}
return jdayInternal(year, mon, day, hr, minute, sec, msec);
}
/* -----------------------------------------------------------------------------
*
* procedure invjday
*
* this procedure finds the year, month, day, hour, minute and second
* given the julian date. tu can be ut1, tdt, tdb, etc.
*
* algorithm : set up starting values
* find leap year - use 1900 because 2000 is a leap year
* find the elapsed days through the year in a loop
* call routine to find each individual value
*
* author : david vallado 719-573-2600 1 mar 2001
*
* inputs description range / units
* jd - julian date days from 4713 bc
*
* outputs :
* year - year 1900 .. 2100
* mon - month 1 .. 12
* day - day 1 .. 28,29,30,31
* hr - hour 0 .. 23
* min - minute 0 .. 59
* sec - second 0.0 .. 59.999
*
* locals :
* days - day of year plus fractional
* portion of a day days
* tu - julian centuries from 0 h
* jan 0, 1900
* temp - temporary double values
* leapyrs - number of leap years from 1900
*
* coupling :
* days2mdhms - finds month, day, hour, minute and second given days and year
*
* references :
* vallado 2007, 208, alg 22, ex 3-13
* --------------------------------------------------------------------------- */
function invjday(jd, asArray) {
// --------------- find year and days of the year -
var temp = jd - 2415019.5;
var tu = temp / 365.25;
var year = 1900 + Math.floor(tu);
var leapyrs = Math.floor((year - 1901) * 0.25); // optional nudge by 8.64x10-7 sec to get even outputs
var days = temp - ((year - 1900) * 365.0 + leapyrs) + 0.00000000001; // ------------ check for case of beginning of a year -----------
if (days < 1.0) {
year -= 1;
leapyrs = Math.floor((year - 1901) * 0.25);
days = temp - ((year - 1900) * 365.0 + leapyrs);
} // ----------------- find remaing data -------------------------
var mdhms = days2mdhms(year, days);
var mon = mdhms.mon,
day = mdhms.day,
hr = mdhms.hr,
minute = mdhms.minute;
var sec = mdhms.sec - 0.00000086400;
if (asArray) {
return [year, mon, day, hr, minute, Math.floor(sec)];
}
return new Date(Date.UTC(year, mon - 1, day, hr, minute, Math.floor(sec)));
}
},{}],5:[function(require,module,exports){
/*!
* satellite-js v3.0.1
* (c) 2013 Shashwat Kandadai and UCSC
* https://github.com/shashwatak/satellite-js
* License: MIT
*/
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "jday", {
enumerable: true,
get: function get() {
return _ext.jday;
}
});
Object.defineProperty(exports, "invjday", {
enumerable: true,
get: function get() {
return _ext.invjday;
}
});
Object.defineProperty(exports, "twoline2satrec", {
enumerable: true,
get: function get() {
return _io.default;
}
});
Object.defineProperty(exports, "propagate", {
enumerable: true,
get: function get() {
return _propagation.propagate;
}
});
Object.defineProperty(exports, "sgp4", {
enumerable: true,
get: function get() {
return _propagation.sgp4;
}
});
Object.defineProperty(exports, "gstime", {
enumerable: true,
get: function get() {
return _propagation.gstime;
}
});
Object.defineProperty(exports, "dopplerFactor", {
enumerable: true,
get: function get() {
return _dopplerFactor.default;
}
});
Object.defineProperty(exports, "radiansToDegrees", {
enumerable: true,
get: function get() {
return _transforms.radiansToDegrees;
}
});
Object.defineProperty(exports, "degreesToRadians", {
enumerable: true,
get: function get() {
return _transforms.degreesToRadians;
}
});
Object.defineProperty(exports, "degreesLat", {
enumerable: true,
get: function get() {
return _transforms.degreesLat;
}
});
Object.defineProperty(exports, "degreesLong", {
enumerable: true,
get: function get() {
return _transforms.degreesLong;
}
});
Object.defineProperty(exports, "radiansLat", {
enumerable: true,
get: function get() {
return _transforms.radiansLat;
}
});
Object.defineProperty(exports, "radiansLong", {
enumerable: true,
get: function get() {
return _transforms.radiansLong;
}
});
Object.defineProperty(exports, "geodeticToEcf", {
enumerable: true,
get: function get() {
return _transforms.geodeticToEcf;
}
});
Object.defineProperty(exports, "eciToGeodetic", {
enumerable: true,
get: function get() {
return _transforms.eciToGeodetic;
}
});
Object.defineProperty(exports, "eciToEcf", {
enumerable: true,
get: function get() {
return _transforms.eciToEcf;
}
});
Object.defineProperty(exports, "ecfToEci", {
enumerable: true,
get: function get() {
return _transforms.ecfToEci;
}
});
Object.defineProperty(exports, "ecfToLookAngles", {
enumerable: true,
get: function get() {
return _transforms.ecfToLookAngles;
}
});
exports.constants = void 0;
var constants = _interopRequireWildcard(require("./constants"));
exports.constants = constants;
var _ext = require("./ext");
var _io = _interopRequireDefault(require("./io"));
var _propagation = require("./propagation");
var _dopplerFactor = _interopRequireDefault(require("./dopplerFactor"));
var _transforms = require("./transforms");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
},{"./constants":2,"./dopplerFactor":3,"./ext":4,"./io":6,"./propagation":7,"./transforms":17}],6:[function(require,module,exports){
/*!
* satellite-js v3.0.1
* (c) 2013 Shashwat Kandadai and UCSC
* https://github.com/shashwatak/satellite-js
* License: MIT
*/
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = twoline2satrec;
var _constants = require("./constants");
var _ext = require("./ext");
var _sgp4init = _interopRequireDefault(require("./propagation/sgp4init"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/* -----------------------------------------------------------------------------
*
* function twoline2rv
*
* this function converts the two line element set character string data to
* variables and initializes the sgp4 variables. several intermediate varaibles
* and quantities are determined. note that the result is a structure so multiple
* satellites can be processed simultaneously without having to reinitialize. the
* verification mode is an important option that permits quick checks of any
* changes to the underlying technical theory. this option works using a
* modified tle file in which the start, stop, and delta time values are
* included at the end of the second line of data. this only works with the
* verification mode. the catalog mode simply propagates from -1440 to 1440 min
* from epoch and is useful when performing entire catalog runs.
*
* author : david vallado 719-573-2600 1 mar 2001
*
* inputs :
* longstr1 - first line of the tle
* longstr2 - second line of the tle
* typerun - type of run verification 'v', catalog 'c',
* manual 'm'
* typeinput - type of manual input mfe 'm', epoch 'e', dayofyr 'd'
* opsmode - mode of operation afspc or improved 'a', 'i'
* whichconst - which set of constants to use 72, 84
*
* outputs :
* satrec - structure containing all the sgp4 satellite information
*
* coupling :
* getgravconst-
* days2mdhms - conversion of days to month, day, hour, minute, second
* jday - convert day month year hour minute second into julian date
* sgp4init - initialize the sgp4 variables
*
* references :
* norad spacetrack report #3
* vallado, crawford, hujsak, kelso 2006
--------------------------------------------------------------------------- */
/**
* Return a Satellite imported from two lines of TLE data.
*
* Provide the two TLE lines as strings `longstr1` and `longstr2`,
* and select which standard set of gravitational constants you want
* by providing `gravity_constants`:
*
* `sgp4.propagation.wgs72` - Standard WGS 72 model
* `sgp4.propagation.wgs84` - More recent WGS 84 model
* `sgp4.propagation.wgs72old` - Legacy support for old SGP4 behavior
*
* Normally, computations are made using letious recent improvements
* to the algorithm. If you want to turn some of these off and go
* back into "afspc" mode, then set `afspc_mode` to `True`.
*/
function twoline2satrec(longstr1, longstr2) {
var opsmode = 'i';
var xpdotp = 1440.0 / (2.0 * _constants.pi); // 229.1831180523293;
var year = 0;
var satrec = {};
satrec.error = 0;
satrec.satnum = longstr1.substring(2, 7);
satrec.epochyr = parseInt(longstr1.substring(18, 20), 10);
satrec.epochdays = parseFloat(longstr1.substring(20, 32));
satrec.ndot = parseFloat(longstr1.substring(33, 43));
satrec.nddot = parseFloat(".".concat(parseInt(longstr1.substring(44, 50), 10), "E").concat(longstr1.substring(50, 52)));
satrec.bstar = parseFloat("".concat(longstr1.substring(53, 54), ".").concat(parseInt(longstr1.substring(54, 59), 10), "E").concat(longstr1.substring(59, 61))); // satrec.satnum = longstr2.substring(2, 7);
satrec.inclo = parseFloat(longstr2.substring(8, 16));
satrec.nodeo = parseFloat(longstr2.substring(17, 25));
satrec.ecco = parseFloat(".".concat(longstr2.substring(26, 33)));
satrec.argpo = parseFloat(longstr2.substring(34, 42));
satrec.mo = parseFloat(longstr2.substring(43, 51));
satrec.no = parseFloat(longstr2.substring(52, 63)); // ---- find no, ndot, nddot ----
satrec.no /= xpdotp; // rad/min
// satrec.nddot= satrec.nddot * Math.pow(10.0, nexp);
// satrec.bstar= satrec.bstar * Math.pow(10.0, ibexp);
// ---- convert to sgp4 units ----
satrec.a = Math.pow(satrec.no * _constants.tumin, -2.0 / 3.0);
satrec.ndot /= xpdotp * 1440.0; // ? * minperday
satrec.nddot /= xpdotp * 1440.0 * 1440; // ---- find standard orbital elements ----
satrec.inclo *= _constants.deg2rad;
satrec.nodeo *= _constants.deg2rad;
satrec.argpo *= _constants.deg2rad;
satrec.mo *= _constants.deg2rad;
satrec.alta = satrec.a * (1.0 + satrec.ecco) - 1.0;
satrec.altp = satrec.a * (1.0 - satrec.ecco) - 1.0; // ----------------------------------------------------------------
// find sgp4epoch time of element set
// remember that sgp4 uses units of days from 0 jan 1950 (sgp4epoch)
// and minutes from the epoch (time)
// ----------------------------------------------------------------
// ---------------- temp fix for years from 1957-2056 -------------------
// --------- correct fix will occur when year is 4-digit in tle ---------
if (satrec.epochyr < 57) {
year = satrec.epochyr + 2000;
} else {
year = satrec.epochyr + 1900;
}
var mdhmsResult = (0, _ext.days2mdhms)(year, satrec.epochdays);
var mon = mdhmsResult.mon,
day = mdhmsResult.day,
hr = mdhmsResult.hr,
minute = mdhmsResult.minute,
sec = mdhmsResult.sec;
satrec.jdsatepoch = (0, _ext.jday)(year, mon, day, hr, minute, sec); // ---------------- initialize the orbit at sgp4epoch -------------------
(0, _sgp4init.default)(satrec, {
opsmode: opsmode,
satn: satrec.satnum,
epoch: satrec.jdsatepoch - 2433281.5,
xbstar: satrec.bstar,
xecco: satrec.ecco,
xargpo: satrec.argpo,
xinclo: satrec.inclo,
xmo: satrec.mo,
xno: satrec.no,
xnodeo: satrec.nodeo
});
return satrec;
}
},{"./constants":2,"./ext":4,"./propagation/sgp4init":16}],7:[function(require,module,exports){
/*!
* satellite-js v3.0.1
* (c) 2013 Shashwat Kandadai and UCSC
* https://github.com/shashwatak/satellite-js
* License: MIT
*/
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "propagate", {
enumerable: true,
get: function get() {
return _propagate.default;
}
});
Object.defineProperty(exports, "sgp4", {
enumerable: true,
get: function get() {
return _sgp.default;
}
});
Object.defineProperty(exports, "gstime", {
enumerable: true,
get: function get() {
return _gstime.default;
}
});
var _propagate = _interopRequireDefault(require("./propagation/propagate"));
var _sgp = _interopRequireDefault(require("./propagation/sgp4"));
var _gstime = _interopRequireDefault(require("./propagation/gstime"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
},{"./propagation/gstime":12,"./propagation/propagate":14,"./propagation/sgp4":15}],8:[function(require,module,exports){
/*!
* satellite-js v3.0.1
* (c) 2013 Shashwat Kandadai and UCSC
* https://github.com/shashwatak/satellite-js
* License: MIT
*/
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = dpper;
var _constants = require("../constants");
/* -----------------------------------------------------------------------------
*
* procedure dpper
*
* this procedure provides deep space long period periodic contributions
* to the mean elements. by design, these periodics are zero at epoch.
* this used to be dscom which included initialization, but it's really a
* recurring function.
*
* author : david vallado 719-573-2600 28 jun 2005
*
* inputs :
* e3 -
* ee2 -
* peo -
* pgho -
* pho -
* pinco -
* plo -
* se2 , se3 , sgh2, sgh3, sgh4, sh2, sh3, si2, si3, sl2, sl3, sl4 -
* t -
* xh2, xh3, xi2, xi3, xl2, xl3, xl4 -
* zmol -
* zmos -
* ep - eccentricity 0.0 - 1.0
* inclo - inclination - needed for lyddane modification
* nodep - right ascension of ascending node
* argpp - argument of perigee
* mp - mean anomaly
*
* outputs :
* ep - eccentricity 0.0 - 1.0
* inclp - inclination
* nodep - right ascension of ascending node
* argpp - argument of perigee
* mp - mean anomaly
*
* locals :
* alfdp -
* betdp -
* cosip , sinip , cosop , sinop ,
* dalf -
* dbet -
* dls -
* f2, f3 -
* pe -
* pgh -
* ph -
* pinc -
* pl -
* sel , ses , sghl , sghs , shl , shs , sil , sinzf , sis ,
* sll , sls
* xls -
* xnoh -
* zf -
* zm -
*
* coupling :
* none.
*
* references :
* hoots, roehrich, norad spacetrack report #3 1980
* hoots, norad spacetrack report #6 1986
* hoots, schumacher and glover 2004
* vallado, crawford, hujsak, kelso 2006
----------------------------------------------------------------------------*/
function dpper(satrec, options) {
var e3 = satrec.e3,
ee2 = satrec.ee2,
peo = satrec.peo,
pgho = satrec.pgho,
pho = satrec.pho,
pinco = satrec.pinco,
plo = satrec.plo,
se2 = satrec.se2,
se3 = satrec.se3,
sgh2 = satrec.sgh2,
sgh3 = satrec.sgh3,
sgh4 = satrec.sgh4,
sh2 = satrec.sh2,
sh3 = satrec.sh3,
si2 = satrec.si2,
si3 = satrec.si3,
sl2 = satrec.sl2,
sl3 = satrec.sl3,
sl4 = satrec.sl4,
t = satrec.t,
xgh2 = satrec.xgh2,
xgh3 = satrec.xgh3,
xgh4 = satrec.xgh4,
xh2 = satrec.xh2,
xh3 = satrec.xh3,
xi2 = satrec.xi2,
xi3 = satrec.xi3,
xl2 = satrec.xl2,
xl3 = satrec.xl3,
xl4 = satrec.xl4,
zmol = satrec.zmol,
zmos = satrec.zmos;
var init = options.init,
opsmode = options.opsmode;
var ep = options.ep,
inclp = options.inclp,
nodep = options.nodep,
argpp = options.argpp,
mp = options.mp; // Copy satellite attributes into local variables for convenience
// and symmetry in writing formulae.
var alfdp;
var betdp;
var cosip;
var sinip;
var cosop;
var sinop;
var dalf;
var dbet;
var dls;
var f2;
var f3;
var pe;
var pgh;
var ph;
var pinc;
var pl;
var sinzf;
var xls;
var xnoh;
var zf;
var zm; // ---------------------- constants -----------------------------
var zns = 1.19459e-5;
var zes = 0.01675;
var znl = 1.5835218e-4;
var zel = 0.05490; // --------------- calculate time varying periodics -----------
zm = zmos + zns * t; // be sure that the initial call has time set to zero
if (init === 'y') {
zm = zmos;
}
zf = zm + 2.0 * zes * Math.sin(zm);
sinzf = Math.sin(zf);
f2 = 0.5 * sinzf * sinzf - 0.25;
f3 = -0.5 * sinzf * Math.cos(zf);
var ses = se2 * f2 + se3 * f3;
var sis = si2 * f2 + si3 * f3;
var sls = sl2 * f2 + sl3 * f3 + sl4 * sinzf;
var sghs = sgh2 * f2 + sgh3 * f3 + sgh4 * sinzf;
var shs = sh2 * f2 + sh3 * f3;
zm = zmol + znl * t;
if (init === 'y') {
zm = zmol;
}
zf = zm + 2.0 * zel * Math.sin(zm);
sinzf = Math.sin(zf);
f2 = 0.5 * sinzf * sinzf - 0.25;
f3 = -0.5 * sinzf * Math.cos(zf);
var sel = ee2 * f2 + e3 * f3;
var sil = xi2 * f2 + xi3 * f3;
var sll = xl2 * f2 + xl3 * f3 + xl4 * sinzf;
var sghl = xgh2 * f2 + xgh3 * f3 + xgh4 * sinzf;
var shll = xh2 * f2 + xh3 * f3;
pe = ses + sel;
pinc = sis + sil;
pl = sls + sll;
pgh = sghs + sghl;
ph = shs + shll;
if (init === 'n') {
pe -= peo;
pinc -= pinco;
pl -= plo;
pgh -= pgho;
ph -= pho;
inclp += pinc;
ep += pe;
sinip = Math.sin(inclp);
cosip = Math.cos(inclp);
/* ----------------- apply periodics directly ------------ */
// sgp4fix for lyddane choice
// strn3 used original inclination - this is technically feasible
// gsfc used perturbed inclination - also technically feasible
// probably best to readjust the 0.2 limit value and limit discontinuity
// 0.2 rad = 11.45916 deg
// use next line for original strn3 approach and original inclination
// if (inclo >= 0.2)
// use next line for gsfc version and perturbed inclination
if (inclp >= 0.2) {
ph /= sinip;
pgh -= cosip * ph;
argpp += pgh;
nodep += ph;
mp += pl;
} else {
// ---- apply periodics with lyddane modification ----
sinop = Math.sin(nodep);
cosop = Math.cos(nodep);
alfdp = sinip * sinop;
betdp = sinip * cosop;
dalf = ph * cosop + pinc * cosip * sinop;
dbet = -ph * sinop + pinc * cosip * cosop;
alfdp += dalf;
betdp += dbet;
nodep %= _constants.twoPi; // sgp4fix for afspc written intrinsic functions
// nodep used without a trigonometric function ahead
if (nodep < 0.0 && opsmode === 'a') {
nodep += _constants.twoPi;
}
xls = mp + argpp + cosip * nodep;
dls = pl + pgh - pinc * nodep * sinip;
xls += dls;
xnoh = nodep;
nodep = Math.atan2(alfdp, betdp); // sgp4fix for afspc written intrinsic functions
// nodep used without a trigonometric function ahead
if (nodep < 0.0 && opsmode === 'a') {
nodep += _constants.twoPi;
}
if (Math.abs(xnoh - nodep) > _constants.pi) {
if (nodep < xnoh) {
nodep += _constants.twoPi;
} else {
nodep -= _constants.twoPi;
}
}
mp += pl;
argpp = xls - mp - cosip * nodep;
}
}
return {
ep: ep,
inclp: inclp,
nodep: nodep,