Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
dt_ctrl
Commits
43f3e15b
Commit
43f3e15b
authored
Sep 12, 2021
by
Tammo Jan Dijkema
Browse files
Merge branch 'simbad_lookup' into 'jeroen'
Add SIMBAD lookup to J2000 page See merge request
!13
parents
916ff6cc
c0ccbb0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
console/js/j2000.js
View file @
43f3e15b
...
...
@@ -133,6 +133,7 @@ function j2000(element_name) {
this
.
button_preset_2
=
new
dt_ui_button
(
element_name
+
"
_preset_2
"
);
this
.
button_preset_3
=
new
dt_ui_button
(
element_name
+
"
_preset_3
"
);
this
.
button_preset_4
=
new
dt_ui_button
(
element_name
+
"
_preset_4
"
);
this
.
button_query
=
new
dt_ui_button
(
element_name
+
"
_query
"
);
this
.
window
.
add
([
this
.
elem_filler
,
this
.
lbl_ra
,
this
.
lbl_dec
,
...
...
@@ -142,7 +143,7 @@ function j2000(element_name) {
this
.
button_enabled
,
this
.
button_dt_model_enabled
,
this
.
button_refraction
,
this
.
button_track
,
this
.
button_copy_pos
,
this
.
button_copy_sp
,
this
.
button_preset_0
,
this
.
button_preset_1
,
this
.
button_preset_2
,
this
.
button_preset_3
,
this
.
button_preset_4
]);
this
.
button_preset_3
,
this
.
button_preset_4
,
this
.
button_query
]);
this
.
lbl_ra
.
text_set
(
"
Right ascension
"
);
this
.
lbl_dec
.
text_set
(
"
Declination
"
);
...
...
@@ -167,13 +168,14 @@ function j2000(element_name) {
this
.
button_preset_2
.
text_set
(
"
PSR B0329+54
"
);
this
.
button_preset_3
.
text_set
(
"
Crab (M1)
"
);
this
.
button_preset_4
.
text_set
(
"
Orion (M42)
"
);
this
.
button_query
.
text_set
(
"
Search...
"
);
this
.
window
.
resize_equal
([
this
.
elem_filler
,
this
.
lbl_ra
,
this
.
lbl_dec
,
this
.
lbl_pos_cur
,
this
.
val_ra_cur
,
this
.
val_dec_cur
,
this
.
lbl_sp_cur
,
this
.
val_ra_sp
,
this
.
val_dec_sp
,
this
.
lbl_sp_new
,
this
.
txt_ra_sp
,
this
.
txt_dec_sp
]);
this
.
window
.
align_vertical
([
this
.
elem_filler
,
this
.
lbl_pos_cur
,
this
.
lbl_sp_cur
,
this
.
lbl_sp_new
],
5
);
...
...
@@ -210,13 +212,13 @@ function j2000(element_name) {
this
.
window
.
resize_equal
([
this
.
button_preset_0
,
this
.
button_preset_1
,
this
.
button_preset_2
,
this
.
button_preset_3
,
this
.
button_preset_4
]);
this
.
button_preset_3
,
this
.
button_preset_4
,
this
.
button_query
]);
this
.
window
.
align_horizontal
([
this
.
lbl_dec
,
this
.
button_preset_0
],
10
);
this
.
window
.
align_vertical
([
this
.
button_preset_0
,
this
.
button_preset_1
,
this
.
button_preset_2
,
this
.
button_preset_3
,
this
.
button_preset_4
]);
this
.
button_preset_3
,
this
.
button_preset_4
,
this
.
button_query
]);
/*
block behaviour.
...
...
@@ -299,16 +301,37 @@ function j2000(element_name) {
this
.
txt_dec_sp
.
value_set
(
dec
);
}
this
.
button_preset_0
.
onclick
=
function
()
{
this
.
button_preset_0
.
onclick
=
function
()
{
j2000_this
.
new_sp_set
(
'
23h23m26.0
'
,
'
058d48m00.0
'
);
}
this
.
button_preset_1
.
onclick
=
function
()
{
this
.
button_preset_1
.
onclick
=
function
()
{
j2000_this
.
new_sp_set
(
'
19h59m28.3565
'
,
'
40d40m02.099
'
);
}
this
.
button_preset_2
.
onclick
=
function
()
{
this
.
button_preset_2
.
onclick
=
function
()
{
j2000_this
.
new_sp_set
(
'
03h32m59.4
'
,
'
054d34m43.6
'
);
}
this
.
button_preset_3
.
onclick
=
function
()
{
j2000_this
.
new_sp_set
(
'
05h34m31.9
'
,
'
22d00m52.2
'
);
}
this
.
button_preset_4
.
onclick
=
function
()
{
j2000_this
.
new_sp_set
(
'
05h35m17.31
'
,
'
-5d23m28.0
'
);
}
this
.
button_query
.
onclick
=
function
()
{
var
name
=
prompt
(
"
Enter name of source to look up coordinates
\n
"
+
"
(prepend
\"
PSR
\"
for pulsars):
"
,
""
);
if
(
name
===
null
)
{
return
;
}
var
xmlhttp
=
new
XMLHttpRequest
();
var
lookup_url
=
"
http://cdsweb.u-strasbg.fr/cgi-bin/nph-sesame/SIMBAD?
"
;
xmlhttp
.
open
(
"
GET
"
,
lookup_url
+
encodeURIComponent
(
name
),
true
);
var
pattern
=
/%J .* =
([\+
-
\d]
+
)
(\d
+
)
([\d\.]
+
)
*
([\+
-
\d]
+
)
(\d
+
)
([\.\d]
+
)
/
;
xmlhttp
.
onload
=
function
(
e
)
{
var
matches
=
pattern
.
exec
(
xmlhttp
.
responseText
);
if
(
matches
)
{
j2000_this
.
new_sp_set
(
matches
[
1
]
+
'
h
'
+
matches
[
2
]
+
'
m
'
+
matches
[
3
],
matches
[
4
]
+
'
d
'
+
matches
[
5
]
+
'
m
'
+
matches
[
6
]);
}
else
{
alert
(
"
Query '
"
+
name
+
"
' did not give a result in SIMBAD
"
);
}
}
xmlhttp
.
send
();
}
this
.
copy_position
=
function
()
{
j2000_this
.
new_sp_set
(
j2000_this
.
ra_cur
,
j2000_this
.
dec_cur
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment