-
Notifications
You must be signed in to change notification settings - Fork 3
/
aladin_finder.html
200 lines (164 loc) · 5.77 KB
/
aladin_finder.html
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
<!DOCTYPE HTML>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<script type='text/javascript' src='https://code.jquery.com/jquery-1.9.1.min.js' charset='utf-8'></script>
<script type='text/javascript' src='https://aladin.u-strasbg.fr/AladinLite/api/v2/latest/aladin.min.js' charset='utf-8'>
</script>
<script type='text/javascript' src='vizier_mirrors.js' charset='utf-8'></script>
<!-- Functions for Aladin Lite finder interface. -->
<script type='text/javascript' src='aladin-tess.js' charset='utf-8'></script>
<script type='text/javascript' charset='utf-8'>
var timeout = null;
function setCoords() {
document.getElementById('ra').value = '';
document.getElementById('dec').value = '';
document.getElementById('coord-message').innerHTML='';
let target = document.getElementById('name').value;
// Don't try to match unless there's a non-whitespace char:
if (target.match(/\S/)) {
clearTimeout(timeout);
// Wait 2/3 second for typing to stop:
timeout = setTimeout(resolveCoords, 667);
}
}
function resolveFailed() {
m = document.getElementById('coord-message');
m.innerHTML='<span style="color:red"><i>Could not resolve</i></span>';
}
function resolveCoords() {
target = document.getElementById('name').value;
ra_input = document.getElementById('ra');
dec_input = document.getElementById('dec');
depth_input = document.getElementById('depth');
mag_input = document.getElementById('mag');
m = document.getElementById('coord-message');
m.innerHTML='<i>Resolving...</i>';
// If it's a TIC or TOI name, try to resolve it locally
// from the local TOI list:
// For TIC sources only, strip a trailing .01 or
// other number if present; otherwise the name
// won't resolve through Simbad (though it would
// be OK locally:
if (target.match(/^TIC/)) {
target = target.replace(/\.\d+$/, '');
}
if (target.match(/^(TIC|TOI)/i)) {
// Try to resolve locally:
var url = 'tess_transit_depth.cgi?name=' + target;
$.get(url,
success=function(data) {
mydata = data;
if (data.status) {
ra_input.value = data.RA;
dec_input.value = data.Dec;
m.innerHTML = '';
depth_input.value = data.depth;
mag_input.value = data.Tmag;
} else {
// TIC or TOI not found, try Sesame:
resolveSesame(target);
}
}
// Chain to Sesame if call fails:
).fail(function(jqXHR, textStatus, errorThrown) {
alert("Failed to call tess_transit_depth, trying Sesame.");
console.log("Status, error: ", textStatus, errorThrown);
resolveSesame(target);
});
} else {
// Try to resolve non-TIC / non-TOI with Sesame:
resolveSesame(target);
}
}
var sesame_data;
function resolveSesame(target) {
ra_input = document.getElementById('ra');
dec_input = document.getElementById('dec');
m = document.getElementById('coord-message');
Sesame.getTargetRADec(target,
function(d) {
sesame_data = d
ra_input.value = (d.ra).toPrecision(7);
dec_input.value = (d.dec).toPrecision(7);
m.innerHTML='';
},
resolveFailed,
);
}
$('document').ready(function() {
i = document.getElementById('name');
i.addEventListener('keyup', setCoords);
});
</script>
<style type="text/css">
input.fov-box {
width: 2.5em;
height: 1.5em;
text-align: right;
}
</style>
<title>Aladin Finding Chart</title>
<link rel="stylesheet" href="page_style.css" type="text/css">
</head>
<body>
<h2>Aladin Lite finding charts</h2>
<p>
This form allows you to use <a href="https://aladin.u-strasbg.fr/AladinLite/">
Aladin Lite</a> to explore a given
astronomical target, by specifying either the coordinates, or an
object name to be resolved.
</p>
<FORM METHOD="GET" ACTION="aladin.html">
<p>
Target name:
<input type="text" size="15" id="name"
name="name" style="text-align:center" />
<i> (Will be resolved on entry by <a href="https://cds.u-strasbg.fr/cgi-bin/Sesame">Sesame</a>.)</i>
</p>
<p>
<label for="ra">RA (decimal degrees or hh:mm:ss, J2000):</label>
<INPUT TYPE="text" id="ra" name="ra" value=' '>
<span id='coord-message'></span><br />
Dec (decimal degrees or dd:mm:ss, J2000): <INPUT TYPE="text" id="dec" name="dec">
</p>
<p>
<INPUT TYPE="submit" VALUE="Submit">
</p>
<hr>
<h3> Optional:</h3>
<p> For TESS targets, enter the target magnitude (if known) and depth of transit to show stars that could blend in TESS images to mimic the on-source transit: <br/>
<INPUT TYPE="text" id="depth" name="depth"> ppt<br/>
<INPUT TYPE="text" id="mag" name="mag"> mag <br/>
If the target T magnitude is not provided it will be determined from the TIC if the input source has a TIC number, but the depth field is required for this (optional) feature to work.
</p>
<p>
<input type="checkbox" name="showFov" value=1>
Show detector outline on finding chart <br/>
Width: <INPUT NAME="fovWidth" class="fov-box" /> '
Height: <INPUT NAME="fovHeight" class="fov-box"/> '
PA: <INPUT NAME="fovPA" class="fov-box" /> °
<br/>
</p>
<p>
<INPUT TYPE="submit" VALUE="Submit">
</p>
</FORM>
<p>
This page was created by <a
href="https://astro.swarthmore.edu/~jensen/">Eric Jensen</a>. This
tool is part of <a
href="https://astro.swarthmore.edu/~jensen/tapir.html">the Tapir
package</a> for planning astronomical observations; the <a
href="https://github.com/elnjensen/Tapir">source code</a> is
freely available. You can also make <a
href="airmass.cgi">airmass plots</a>, or <a href="transits.cgi">plan
transiting exoplanet observations</a>.
</p>
<p>
Feedback welcome! Send <a
href="mailto:ejensen1\@swarthmore.edu?Subject=Feedback on finding chart form"
>here</a>.
</p>
</body>
</html>