forked from dankocevski/LightCurveRepository
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
6373 lines (4786 loc) · 270 KB
/
index.html
File metadata and controls
6373 lines (4786 loc) · 270 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fermi LAT Light Curve Repository</title>
<script type="text/javascript" charset="UTF-8" src="./js/d3.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="./js/d3.geo.projection.min.js"></script>
<!-- <script type="text/javascript" src="./js/celestial.min.js"></script> -->
<script type="text/javascript" charset="UTF-8" src="./js/celestial.js"></script>
<script type="text/javascript" charset="UTF-8" src="./js/astro.js"></script>
<!-- <script language="javascript" type="text/javascript" src="./js/astro.dates.js"></script> -->
<script type="text/javascript" charset="UTF-8" src="./js/astro.coords.js"></script>
<script type="text/javascript" charset="UTF-8" src="./js/ephemeris.js"></script>
<!-- jQuery -->
<script type="text/javascript" charset="UTF-8" src="./js/jquery-1.12.0.min.js"></script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> -->
<!-- Chart.js -->
<script type="text/javascript" charset="UTF-8" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script>
<!-- Bootstrap compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- Bootstrap compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Bootstrap Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Reset css -->
<link rel="stylesheet" hrmouseef="./css/reset.css" type="text/css" />
<!-- NASA theme -->
<link rel="stylesheet" href="./css/NASA.css">
<!-- Celestial.js theme -->
<link rel="stylesheet" href="./css/celestial.css">
<!-- Highcharts CDN -->
<!-- <script src="https://code.highcharts.com/highcharts.src.js"></script> -->
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/stock/modules/data.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<script src="https://code.highcharts.com/stock/modules/export-data.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<!--Plugin CSS file with desired skin-->
<!-- <link rel="stylesheet" href="./css/ion.rangeSlider.css"/> -->
<link rel="stylesheet" href="./css/ion.rangeSliderNX.css"/>
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ion-rangeslider/2.3.1/css/ion.rangeSlider.min.css"/> -->
<!--Plugin JavaScript file-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/ion-rangeslider/2.3.1/js/ion.rangeSlider.min.js"></script>
<!-- Moment.js -->
<script charset="UTF-8" src="./js/moment.js"></script>
<!-- -->
</head>
<!-- custom css -->
<style type="text/css">
#celestial-map {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Old versions of Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera and Firefox */
overflow-x: hidden;
overflow-y: hidden;
}
/* The red selection circle */
#selection {
border: solid;
border-radius: 15px;
border-width: 1px;
/*border-color: red;*/
border-color: rgba(57, 66, 100, .80);
background-color: rgba(57, 66, 100, .80);
opacity: 0.25;
position: absolute;
height: 15px;
width: 15px;
top: 100px;
visibility: hidden;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
pointer-events: none;
}
#selection_locked {
border: solid;
border-radius: 15px;
border-width: 1px;
border-color: red;
background-color: red;
/* border-color: rgba(57, 66, 100, .80);
background-color: rgba(57, 66, 100, .80);*/
opacity: 0.25;
position: absolute;
height: 15px;
width: 15px;
top: 100px;
visibility: hidden;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
pointer-events: none;
}
/* The selection tool tip */
#tooltip_map {
border: solid;
border-radius: 5px;
background-color: rgba(240,240,240,.95);
border: 2px solid rgba(0, 0, 0, .9);
position: absolute;
width: auto;
height: auto;
top: 100px;
box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.5) inset;
text-align: left;
color: #000;
padding: 10px 10px 10px 10px;
font-size: 14px;
line-height: 125%;
visibility: hidden;
overflow-x: hidden;
overflow-y: hidden;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.row-small-gutter>* {
padding-left: 4px;
padding-right: 4px;
}
.row-small-gutter-2>* {
padding: 0px 2px 0px 2px;
}
.input-group-addon {
min-width:85px;
text-align:left;
}
text {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
hr {
margin-top: 1rem;
margin-bottom: 1rem;
margin-left:10px;
margin-right:10px;
border: 0;
border-top: 1px solid rgba(0, 0, 0, 0.2);
}
.custom-header {
margin: 0px 0px 0px 10px;
margin-left:10px;
}
#data_table {
background-image:"./img/loading_apple.gif";}
}
.material-switch > input[type="checkbox"] {
display: none;
}
.material-switch > label {
cursor: pointer;
height: 0px;
position: relative;
width: 40px;
}
.material-switch > label::before {
background: rgb(0, 0, 0);
box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.5);
border-radius: 8px;
content: '';
height: 16px;
margin-top: -8px;
position:absolute;
opacity: 0.3;
transition: all 0.4s ease-in-out;
width: 40px;
}
.material-switch > label::after {
background: rgb(255, 255, 255);
border-radius: 16px;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
content: '';
height: 24px;
left: -4px;
margin-top: -8px;
position: absolute;
top: -4px;
transition: all 0.3s ease-in-out;
width: 24px;
}
.material-switch > input[type]:checked + label::before {
background: inherit;
opacity: 0.5;
}
.material-switch > input[type="checkbox"]:checked + label::after {
background: inherit;
left: 20px;
}
/* The switch - the box around the slider */
.switch {
position: relative;
display: inline-block;
width: 45px;
height: 26px;
}
/* Hide default HTML checkbox */
.switch input {
opacity: 0;
width: 0;
height: 0;
}
/* The slider */
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 20px;
width: 20px;
left: 3px;
bottom: 3px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider.primary {
background-color: #2c6c9f;
}
/*input:focus + .slider.primary {
box-shadow: 0 0 1px #2196F3;
}
*/
input:checked + .slider.green {
/*background-color: #5fb35f;*/
background-color: rgb(57,142,68, 1);
}
input:checked + .slider.orange {
/*background-color: #f8a139;*/
background-color: rgb(215,120,18, 1)
}
input:checked + .slider.red {
background-color: #d74b49;
}
input:checked + .slider.blue {
background-color: #48aec9;
}
input:checked + .slider:before {
-webkit-transform: translateX(19px);
-ms-transform: translateX(19px);
transform: translateX(19px);
}
/* Rounded sliders */
.slider.round {
border-radius: 17px;
}
.slider.round:before {
border-radius: 50%;
}
#timeline {
display: none;
}
.hidden {
position: absolute !important;
top: -9999px !important;
left: -9999px !important;
}
.customSlider {
-webkit-appearance: none;
width: 100%;
height: 15px;
border-radius: 5px;
background: transparent;
outline: none;
opacity: 0.7;
-webkit-transition: .2s;
transition: opacity .2s;
visibility: hidden;
}
.customSlider::-webkit-slider-thumb {
/* -webkit-appearance: none;
appearance: none;
width: 25px;
height: 25px;
border-radius: 50%;
background: #04AA6D;
cursor: pointer;*/
top: 35px;
width: 16px;
height: 18px;
background-color: transparent;
/*background-color: "#2c6c9f";*/
}
.customSlider::-moz-range-thumb {
width: 25px;
height: 25px;
border-radius: 50%;
background: #04AA6D;
cursor: pointer;
}
#mydiv {
position: absolute;
z-index: 9;
background-color: #f1f1f1;
text-align: center;
border: 1px solid #d3d3d3;
}
#mydivheader {
padding: 10px;
cursor: move;
z-index: 10;
background-color: #2196F3;
color: #fff;
}
</style>
<body>
<script type="text/javascript" charset="UTF-8">
var canvas;
var selection;
var tooltip_map;
var scale_initial;
var json_reticale;
var showReticale;
var search_coordinates;
var data_FGL;
var data_FGL_unsorted;
var URL
var classifications;
var occurrences;
var colors;
var search_ra;
var search_dec;
var pointStyle;
var labelStyle;
var data_FGL_original;
var date_to;
var date_from;
var previousRowElement;
var previousRowBackgroundColor;
var MET_start;
var MET_stop;
var sun_coordinates;
var MET_current;
var MJD_current;
var date_string_current;
var data_2FAV_subset;
var magicWord;
var passphrase;
var search_radius = 0;
var search_keyword = ''
var radians2degrees = 57.2958
var deg2rad = 2*Math.PI/360.
var isMouseDown = false;
var isMapAnimating = false;
var palette = ['#0d47a1','#007E33', '#FF8800','#CC0000','#9933CC','#0d47a1','#00C851','#ffbb33','#ff4444','#aa66cc','#00695c','#2BBBAD','#3F729B']
var shouldDisplayDistance = false;
var perform_search = false;
var catalog = '3FGL';
var show_FGL = true;
var show_2FAV = false;
var show_2FLGC = false;
var show_IceCube = false;
var show_tooltip = true;
var always_show_errors = false;
var marker_size_varindex = true;
var show_only_variable_4FGL_sources = true;
var insideToolTip = true
var startingTableRow = 0
var maxNumberOfTableRows = 100;
var currentTablePage = 1
var paginations = {}
var tableRowSelectors = {}
var row_selector_has_changed = false;
var showSun = true
var showMoon = false
var user_double_clicked = false
var lock_selection = false
var variability_index_cut = 21.67;
var mouseDown = false
var showSkyActivity = true;
var data_sky_activity;
var shouldUpdateSkyActivity = false;
var overlaysActive = false;
var MET_sundate;
var MJD_sundate;
var Signif_Avg = []
var TSs = []
var months = {'1':'Jan', '2':'Feb', '3':'Mar', '4':'Apr', '5':'May', '6':'Jun', '7':'Jul', '8':'Aug', '9':'Sep', '10':'Oct', '11':'Nov', '12':'Dec'}
// var months = {'1':'January', '2':'Feburary', '3':'March', '4':'April', '5':'May', '6':'June', '7':'July', '8':'August', '9':'September', '10':'October', '11':'November', '12':'December'}
var angles = [0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310,315,320,325,330,335,340,345,350,355]
// D3-Celestial sky map. Copyright 2015 Olaf Frohn https://github.com/ofrohn, see LICENSE
var config = {
width: 0, // Default width, 0 = full parent width; height is determined by projection
projection: "aitoff", // Map projection used: airy, aitoff, armadillo, august, azimuthalEqualArea, azimuthalEquidistant, baker, berghaus, boggs, bonne, bromley, collignon, craig, craster, cylindricalEqualArea, cylindricalStereographic, eckert1, eckert2, eckert3, eckert4, eckert5, eckert6, eisenlohr, equirectangular, fahey, foucaut, ginzburg4, ginzburg5, ginzburg6, ginzburg8, ginzburg9, gringorten, hammer, hatano, healpix, hill, homolosine, kavrayskiy7, lagrange, larrivee, laskowski, loximuthal, mercator, miller, mollweide, mtFlatPolarParabolic, mtFlatPolarQuartic, mtFlatPolarSinusoidal, naturalEarth, nellHammer, orthographic, patterson, polyconic, rectangularPolyconic, robinson, sinusoidal, stereographic, times, twoPointEquidistant, vanDerGrinten, vanDerGrinten2, vanDerGrinten3, vanDerGrinten4, wagner4, wagner6, wagner7, wiechel, winkel3
transform: "galactic", // Coordinate transformation: equatorial (default), ecliptic, galactic, supergalactic
center: [0,0], // Initial center coordinates in equatorial transformation [hours, degrees, degrees],
// otherwise [degrees, degrees, degrees], 3rd parameter is orientation, null = default center
zoomlevel: 1,
zoomextend: 40,
orientationfixed: true, // Keep orientation angle the same as center[2]
background: { fill: "#ffffff", stroke: "#000000", opacity: 1 }, // Background style
// background: { fill: "cornflowerblue", stroke: "#ffffff", opacity: 0.5 }, // Background style
adaptable: true, // Sizes are increased with higher zoom-levels
interactive: true, // Enable zooming and rotation with mousewheel and dragging
form: false, // Display settings form
location: false, // Display location settings
controls: true, // Display zoom controls
lang: "", // Language for names, so far only for constellations: de: german, es: spanish
// Default:en or empty string for english
container: "celestial-map", // ID of parent element, e.g. div
datapath: "./data/", // Path/URL to data files, empty = subfolder 'data'
stars: {
show: false, // Show stars
limit: 6, // Show only stars brighter than limit magnitude
color: "#000000",
colors: false,
// colors: "#ffffff", // Show stars in spectral colors, if not use "color"
style: { fill: "#000000", opacity: 1 }, // Default style for stars
names: true, // Show star names (Bayer, Flamsteed, Variable star, Gliese, whichever applies first)
proper: true, // Show proper name (if present)
desig: false, // Show all names, including Draper and Hipparcos
namelimit: -99, // Show only names for stars brighter than namelimit
// namestyle: { fill: "#ddddbb", font: "11px Georgia, Times, 'Times Roman', serif", align: "left", baseline: "top" },
// propernamestyle: { fill: "#ddddbb", font: "11px Georgia, Times, 'Times Roman', serif", align: "right", baseline: "bottom" },
namestyle: { fill: "#000000", font: "14px Helvetica, Arial, 'Helvetica Neue', sans-serif", align: "left", baseline: "top" },
propernamestyle: { fill: "#000000", font: "14px Helvetica, Arial, 'Helvetica Neue', sans-serif", align: "right", baseline: "bottom" },
propernamelimit: -99, // Show proper names for stars brighter than propernamelimit
size: 7, // Maximum size (radius) of star circle in pixels
exponent: -2, // Scale exponent for star size, larger = more linear
data: 'stars.6.json' // Data source for stellar data
//data: 'stars.8.json' // Alternative deeper data source for stellar data
},
dsos: {
show: false, // Show Deep Space Objects
limit: 6, // Show only DSOs brighter than limit magnitude
names: true, // Show DSO names
desig: true, // Show short DSO names
namelimit: 4, // Show only names for DSOs brighter than namelimit
color: "#000000",
colors: false,
namestyle: { fill: "#000000", font: "14px Helvetica, Arial, serif", align: "left", baseline: "top" },
size: null, // Optional seperate scale size for DSOs, null = stars.size
exponent: 1.4, // Scale exponent for DSO size, larger = more non-linear
data: 'dsos.bright.json', // Data source for DSOs
//data: 'dsos.6.json' // Alternative broader data source for DSOs
//data: 'dsos.14.json' // Alternative deeper data source for DSOs
symbols: { //DSO symbol styles
gg: {shape: "circle", fill: "#000000"}, // Galaxy cluster
g: {shape: "ellipse", fill: "#000000"}, // Generic galaxy
s: {shape: "ellipse", fill: "#000000"}, // Spiral galaxy
s0: {shape: "ellipse", fill: "#000000"}, // Lenticular galaxy
sd: {shape: "ellipse", fill: "#000000"}, // Dwarf galaxy
e: {shape: "ellipse", fill: "#000000"}, // Elliptical galaxy
i: {shape: "ellipse", fill: "#000000"}, // Irregular galaxy
oc: {shape: "circle", fill: "#000000", stroke: "#000000", width: 1.5}, // Open cluster
gc: {shape: "circle", fill: "#000000"}, // Globular cluster
en: {shape: "square", fill: "#000000"}, // Emission nebula
bn: {shape: "square", fill: "#000000", stroke: "#000000", width: 2}, // Generic bright nebula
sfr:{shape: "square", fill: "#000000", stroke: "#000000", width: 2}, // Star forming region
rn: {shape: "square", fill: "#000000"}, // Reflection nebula
pn: {shape: "diamond", fill: "#000000"}, // Planetary nebula
snr:{shape: "diamond", fill: "#000000"}, // Supernova remnant
dn: {shape: "square", fill: "#000000", stroke: "#000000", width: 2}, // Dark nebula grey
pos:{shape: "marker", fill: "#000000", stroke: "#000000", width: 1.5} // Generic marker
}
},
constellations: {
show: false, // Show constellations
names: true, // Show constellation names
desig: true, // Show short constellation names (3 letter designations)
namestyle: { fill:"#39645b", align: "center", baseline: "middle", opacity:0.8,
font: ["bold 14px Helvetica, Arial, sans-serif", // Different fonts for brighter &
"bold 12px Helvetica, Arial, sans-serif", // sdarker constellations
"bold 11px Helvetica, Arial, sans-serif"]},
lines: true, // Show constellation lines
linestyle: { stroke: "#cc6666", width: 1, opacity: 0.6 }, // purple: #9966cc
bounds: false, // Show constellation boundaries
boundstyle: { stroke: "#643942", width: 0.5, opacity: 0.8, dash: [2, 4] }
},
mw: {
show: false, // Show Milky Way as filled polygons
style: { fill: "#000000", opacity: "0.15" }
},
lines: {
// graticule: { show: true, stroke: "#cccccc", width: 0.6, opacity: 0.8, // Show graticule lines
graticule: { show: true, stroke: "#C0C0C0", width: 1, opacity: 1, // Show graticule lines
// grid values: "outline", "center", or [lat,...] specific position
lon: {pos: ["center"], fill: "darkgray", font: "14px Helvetica, Arial, 'Helvetica Neue', sans-serif"},
// grid values: "outline", "center", or [lon,...] specific position
lat: {pos: ["180"], fill: "darkgray", font: "14px Helvetica, Arial, 'Helvetica Neue', sans-serif"}},
equatorial: { show: true, stroke: "#66cccc", width: 1.3, opacity: 0.7 }, // Show equatorial plane
ecliptic: { show: true, stroke: "#66cc66", width: 1.3, opacity: 0.7 }, // Show ecliptic plane
galactic: { show: true, stroke: "#cc6666", width: 1.3, opacity: 0.7 }, // Show galactic plane
supergalactic: { show: false, stroke: "#cc66cc", width: 1.3, opacity: 0.7 } // Show supergalactic plane
}
};
var lineStyle = {
stroke:"#000000",
fill: "rgba(255, 204, 204, 0.4)",
width: 3
}
var pointStyle_active = {
stroke: "rgba(57, 66, 100, .80)",
fill: "rgba(57, 66, 100, .80)"
// stroke: "green",
// fill: "green"
};
var pointStyle_gray = {
stroke: "rgba(128, 128, 128, .5)",
fill: "rgba(128, 128, 128, .5)"
// stroke: "green",
// fill: "green"
};
var pointStyle_hidden = {
stroke: "rgba(128, 128, 128, .1)",
fill: "rgba(128, 128, 128, .1)"
// stroke: "green",
// fill: "green"
};
var reticaleCenterStyle = {
stroke: "darkred",
// stroke: "rgba(139, 0, 0, 0.6)",
width: 0.6,
opacity: 0.9,
};
var reticaleCircleStyle = {
stroke: "darkred",
// fill: "darkred",
width: 0.8,
opacity: 0.8,
};
var reticaleCircleStyleThin = {
stroke: "darkred",
// fill: "darkred",
width: 0.2,
opacity: 0.8,
};
var style_2FAV = {
stroke: "#d74b49",
fill: "#d74b49",
width: 0.8,
opacity: 0.8,
};
var style_2FAV_circles = {
stroke: "rgb(215,75,73, 1)",
fill: "rgb(215,75,73, 0.75)",
// width: 0.5,
// opacity: 0.6,
};
var style_2FAV_errors = {
stroke: "rgb(215,75,73, 0.5)",
fill: "rgb(215,75,73, 0.75)"
// width: 0.8,
// opacity: 0.6,
};
var style_2FLGC = {
stroke: "rgb(57,142,68, 1)",
fill: "rgb(57,142,68, 0.75)"
};
var style_2FLGC_error = {
stroke: "rgb(57,142,68, 0.75)",
fill: "rgb(57,142,68, 0.75)"
};
var style_IceCube = {
stroke: "rgb(215,120,18, 1)",
fill: "rgb(215,120,18, 0.75)"
};
var style_IceCube_error = {
stroke: "rgb(215,120,18, 0.75)",
fill: "rgb(215,120,18, 0.75)"
};
var textStyle = {
fill:"red",
font: "normal 14px Helvetica, Arial, sans-serif",
align: "left",
baseline: "bottom"
};
var labelStyle_active = {
fill:"black",
font: "normal 14px Helvetica, Arial, sans-serif",
align: "left",
baseline: "bottom"
};
var labelStyle_gray = {
fill:"rgba(128, 128, 128, .5)",
font: "normal 14px Helvetica, Arial, sans-serif",
align: "left",
baseline: "bottom"
};
var labelStyle_hidden = {
fill:"rgba(128, 128, 128, .1)",
font: "normal 14px Helvetica, Arial, sans-serif",
align: "left",
baseline: "bottom"
};
var sunStyle = {
stroke: "rgba(230, 172, 0, 1)",
fill: "rgba(230, 172, 0, 0.8)"
// stroke: "green",
// fill: "green"
};
var moonStyle = {
stroke: "rgba(128, 128, 128, 1)",
fill: "rgba(128, 128, 128, 0.8)"
// stroke: "green",
// fill: "green"
};
// Define some global variables
var PROXIMITY_LIMIT = 1700;
var points
// Set cookie data
function setCookieData(name, value, expiration_days) {
var date = new Date();
date.setTime(date.getTime() + (expiration_days*24*60*60*1000));
var expires = "expires="+ date.toUTCString();
document.cookie = name + "=" + value + ";" + expires + ";path=/";
}
// Get the cookie data. Return the value if found, return empty string if not
function getCookieData(name) {
var name_mod = name + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name_mod) == 0) {
return c.substring(name_mod.length, c.length);
}
}
return null;
}
// Simple linear distance function
function distance(p1, p2) {
var d1 = p2[0] - p1[0],
d2 = p2[1] - p1[1];
return Math.sqrt(d1 * d1 + d2 * d2);
}
// Convert radians to degrees
function rad2deg (rad) {
var sign2 = "";
if ( rad < 0.0 ) { sign2 = "-"; rad = 0.0 - rad; }
var hh = rad * toDegrees;
hh = hh + 0.00005; // rounding
var h = Math.floor(hh);
hh = hh - h; // fraction
hh = hh * 10;
var f1 = Math.floor (hh); // Crude but easy way to get leading zeroes in fraction
hh = hh - f1;
hh = hh * 10;
var f2 = Math.floor (hh);
hh = hh - f2;
hh = hh * 10;
var f3 = Math.floor (hh);
hh = hh - f3;
hh = hh * 10;
var f4 = Math.floor (hh);
ret = sign2 + h + "." +f1+f2+f3+f4;
return ret;
}
// Convert RA and Dec to galactic coordinates
function calculateGalacticCoordinates(ra, dec) {
// Adopted from http://www.robertmartinayers.org/tools/coordinates.html
// Copyright Robert Martin Ayers, 2009, 2011, 2014. All rights reserved.
// Define some constants
pi = 3.1415926536
toDegrees = 180.0/pi;
degrees2arcseconds = 3600.;
hours2degrees = 360/24.
// From J2000 to "galactic coordinates"
// Spherical Astronomy by Green, equation 14.55, page 355
var JtoG = new Array (
-0.054876, -0.873437, -0.483835,
0.494109, -0.444830, 0.746982,
-0.867666, -0.198076, 0.455984 );
var radec = new Array (99.0, 99.0);
// Converting the user supplied ra and dec from degrees to arcseconds
globalJRA = parseFloat(ra) * degrees2arcseconds;
globalJDec = parseFloat(dec) * degrees2arcseconds;
var radec1 = new Array ( (globalJRA/3600.0) / toDegrees,
(globalJDec/3600.0) / toDegrees );
radec = radec1;
matrix = JtoG;
var r0 = new Array (
Math.cos(radec[0]) * Math.cos(radec[1]),
Math.sin(radec[0]) * Math.cos(radec[1]),
Math.sin(radec[1]) );
var s0 = new Array (
r0[0]*matrix[0] + r0[1]*matrix[1] + r0[2]*matrix[2],
r0[0]*matrix[3] + r0[1]*matrix[4] + r0[2]*matrix[5],
r0[0]*matrix[6] + r0[1]*matrix[7] + r0[2]*matrix[8] );
var r = Math.sqrt ( s0[0]*s0[0] + s0[1]*s0[1] + s0[2]*s0[2] );
var result = new Array ( 0.0, 0.0 );
result[1] = Math.asin ( s0[2]/r ); // New dec in range -90.0 -- +90.0
// or use sin^2 + cos^2 = 1.0
var cosaa = ( (s0[0]/r) / Math.cos(result[1] ) );
var sinaa = ( (s0[1]/r) / Math.cos(result[1] ) );
result[0] = Math.atan2 (sinaa,cosaa);
if ( result[0] < 0.0 ) {
result[0] = result[0] + pi + pi;
}
gall = parseFloat(rad2deg(result[0]));
galb = parseFloat(rad2deg(result[1]));
return [gall, galb]
}
function angularDistance(lat1, lon1, lat2, lon2) {
const φ1 = lat1 * Math.PI/180; // φ, λ in radians
const φ2 = lat2 * Math.PI/180;
const Δφ = (lat2-lat1) * Math.PI/180;
const Δλ = (lon2-lon1) * Math.PI/180;
const a = Math.sin(Δφ/2) * Math.sin(Δφ/2) +
Math.cos(φ1) * Math.cos(φ2) *
Math.sin(Δλ/2) * Math.sin(Δλ/2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
const d = c * 57.2958; // in degrees
return d
}
function hms2decimaldegrees(hms) {
degrees = (hms / 24.0) * 360.
}
function calculateSunPosition(dateObj) {
var observers_longitude = 139.74;
var observers_latitude = 35.65;
var ephem = new Ephemeris();
var jd = ephem.JulianDay(dateObj);
var sun = ephem.Sun(dateObj);
var sun_longitude = sun.longitude;
var sun_distance = sun.distance;
var sun_ra = sun.ra;
var sun_dec = sun.dec;
var sun_eci = ephem.to_eci(sun_ra,sun_dec,sun_distance);
var sun_horizontal = ephem.to_horizontal(dateObj,observers_longitude,observers_latitude,sun_ra,sun_dec);
// return both ra and dec in decimal degrees
sun_ra = (sun_ra / 24.0) * 360.
return [sun_ra, sun_dec]
}
function calculateMoonPosition(dateObj) {
var observers_longitude = 139.74;
var observers_latitude = 35.65;
var ephem = new Ephemeris();
var moon = ephem.Moon(dateObj);
var moon_longitude = moon.longitude;
var moon_latitude = moon.latitude;
var moon_distance = moon.distance;
var moon_ra = moon.ra;
var moon_dec = moon.dec;
var moon_eci = ephem.to_eci(moon_ra,moon_dec,moon_distance);
var moon_horizontal = ephem.to_horizontal(dateObj,observers_longitude,observers_latitude,moon_ra,moon_dec);
// return both ra and dec in decimal degrees
moon_ra = (moon_ra / 24.0) * 360.
return [moon_ra, moon_dec]
}
function sourceIncludesKeyword(sourceRecord, search_keyword) {
// Check to see if the search keyword exists in any of the string value, otherwise skip this row
try {
if (search_keyword.length > 0) {
if (sourceRecord['Source_Name'].toLowerCase().includes(search_keyword) || sourceRecord['CLASS1'].toLowerCase().includes(search_keyword) || sourceRecord['ASSOC1'].toLowerCase().includes(search_keyword) || sourceRecord['SpectrumType'].toLowerCase().includes(search_keyword)) {
return true;
} else {
return false
}
}
} catch(error) {
// Do nothing for now
}
}
function redraw() {
var m = Celestial.metrics(), // Get the current map size in pixels
// empty quadtree, will be used for proximity check
quadtree = d3.geom.quadtree().extent([[-1, -1], [m.width + 1, m. height + 1]])([]);
map_width = m.width;
map_height = m.height;
// Save all the points currently on the canvas
points = [];
// Display the 3FGL data
if (typeof data_FGL !== 'undefined' && show_FGL === true) {
// console.log('Rendering ' + data_FGL.length + ' 4FGL Sources...')
// console.log(arguments.callee.caller.toString())
Signif_Avg = []
TSs = []
for (i=0; i<data_FGL.length; i++) {
var coordinates;
var source = data_FGL[i];
if (config.transform.includes('equatorial')) {
coordinates = [source.RAJ2000, source.DEJ2000]
} else if (config.transform.includes('galactic')) {
coordinates = [source.GLON, source.GLAT]
}
// If point is visible (this doesn't work automatically for points)
if (Celestial.clip(coordinates)) {
var point = Celestial.mapProjection(coordinates);
if (point[0] >= 0 && point[0] <= map_width && point[1] >= 0 && point[1] <= map_height) {
// Determine what color this source should be
if (perform_search === true) {
// Position search only
if (search_keyword.length == 0) {
if (search_radius > 0) {
if (source.distance <= search_radius) {
pointStyle = pointStyle_active
labelStyle = labelStyle_active
source['active'] = true
} else {
pointStyle = pointStyle_gray
labelStyle = labelStyle_gray
source['active'] = true
}
} else {
pointStyle = pointStyle_active
labelStyle = labelStyle_active
source['active'] = true
}
}
// Keyword search only
if (search_keyword.length > 0 && search_radius == 0) {
if (sourceIncludesKeyword(source, search_keyword) === true) {
pointStyle = pointStyle_active
labelStyle = labelStyle_active
source['active'] = true
} else {
pointStyle = pointStyle_hidden
labelStyle = labelStyle_hidden
source['active'] = false
}
}
// Position and keyword search
if (search_keyword.length > 0 && search_radius > 0) {
if (sourceIncludesKeyword(source, search_keyword) === true && source.distance <= search_radius) {
pointStyle = pointStyle_active
labelStyle = labelStyle_active
source['active'] = true
} else {
pointStyle = pointStyle_gray
labelStyle = labelStyle_gray
source['active'] = true
}
}
} else {
pointStyle = pointStyle_active
labelStyle = labelStyle_active
source['active'] = true
}