-
Notifications
You must be signed in to change notification settings - Fork 3
/
finding_charts.cgi
executable file
·201 lines (159 loc) · 4.89 KB
/
finding_charts.cgi
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
#!/usr/bin/perl
use CGI;
use CGI::Cookie;
use warnings;
use strict;
# See if they have cookies set for default values of observatory
# coordinates and other parameters:
my %cookies = CGI::Cookie->fetch;
# Declare the settings variables that we'll use:
my ($field_height, $field_width, $detector_height, $detector_width,
$show_detector, $detector_on_string, $detector_off_string,
$invert, $invert_string, $no_invert_string,
);
if (defined $cookies{'field_height'}) {
$field_height = $cookies{'field_height'}->value;
}
if (not defined $field_height) {
$field_height = '';
}
if (defined $cookies{'field_width'}) {
$field_width = $cookies{'field_width'}->value;
}
if (not defined $field_width) {
$field_width = '';
}
if (defined $cookies{'detector_height'}) {
$detector_height = $cookies{'detector_height'}->value;
}
if (not defined $detector_height) {
$detector_height = '';
}
if (defined $cookies{'detector_width'}) {
$detector_width = $cookies{'detector_width'}->value;
}
if (not defined $detector_width) {
$detector_width = '';
}
if (defined $cookies{'show_detector'}) {
$show_detector = $cookies{'show_detector'}->value;
}
if (not defined $show_detector) {
$show_detector = '';
}
if ($show_detector) {
$detector_on_string = "Checked";
$detector_off_string = "";
} else {
$detector_off_string = "Checked";
$detector_on_string = "";
}
if (defined $cookies{'invert'}) {
$invert = $cookies{'invert'}->value;
}
if (not defined $invert) {
$invert = 0;
}
if ($invert) {
$invert_string = "Checked";
$no_invert_string = "";
} else {
$no_invert_string = "Checked";
$invert_string = "";
}
my $q = CGI->new();
print $q->header;
print << "END_1";
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Annotated Finding Charts</title>
<link rel="stylesheet" href="page_style.css" type="text/css">
</head>
<body>
<h2>Make annotated finding charts</h2>
<p>
This form allows you to make annotated finding charts for a given
astronomical target, by specifying either the coordinates, or an
object name to be resolved by Simbad or NED. The finding charts use
data from <a
href="https://gsss.stsci.edu/SkySurveys/SkySurveys.htm">the Digitized
Sky Survey</a>, and they are annotated with the object coordinates, a
1-arcminute circle in the center for scale, and the object name if
provided, as in <a href="finding_charts/HD_209458_b.jpg">this
example</a>.
</p>
<FORM METHOD="GET" ACTION="create_finding_chart.cgi">
END_1
# Now print the rest of the form:
print << "END_3";
<p>
Target name:
<input type="text" size="15"
name="target" style="text-align:center" />
<i> (Will be resolved by Simbad/NED if no coordinates given
below. Otherwise, it is used as a label for the
plot but not for coordinates.)</i>
</p>
<p>
RA (J2000): <INPUT TYPE="text" name="ra"><br />
Dec (J2000): <INPUT TYPE="text" name="dec">
</p>
<h3>Optional:</h3>
<p>
Field width (arcmin): <INPUT TYPE="text" name="field_width" size="2"
value="$field_width">
<i>Default: 40 arcmin. Max: 75 arcmin.</i><br />
Field height (arcmin): <INPUT TYPE="text" name="field_height" size="2"
value="$field_height">
<i>Default: same as width. Max: 75 arcmin.</i><br />
</p>
<p>
Show outline of detector (with size specified below):<br />
<INPUT TYPE="radio" NAME="show_detector" VALUE="1" $detector_on_string
/> Show
/ <INPUT TYPE="radio" NAME="show_detector" VALUE="0"
$detector_off_string /> Don\'t show <br />
</p>
<p>
Detector width (arcmin): <INPUT TYPE="text" name="detector_width" size="2"
value="$detector_width">
<br />
Detector height (arcmin): <INPUT TYPE="text" name="detector_height" size="2"
value="$detector_height">
<i>Default: same as width.</i><br />
</p>
<p>
<INPUT TYPE="radio" NAME="invert" VALUE="0" $no_invert_string
/> Dark background (black sky, white stars) <br />
<INPUT TYPE="radio" NAME="invert" VALUE="1"
$invert_string /> White background (white sky, black stars;
better for printing)
</p>
<p>
<INPUT TYPE="submit" VALUE="Submit">
</p>
</FORM>
<p> The finding charts provided here make use of images from the Digitized Sky
Survey, which are subject to the copyright in <a
href="https://archive.stsci.edu/dss/copyright.html">this copyright summary</a>.
Please consider <a
href="https://archive.stsci.edu/dss/acknowledging.html">acknowledging</a> their
use in your work. </p>
<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.
</p>
<p>
Feedback welcome! Send <a
href="mailto:ejensen1\@swarthmore.edu?Subject=Feedback on finding chart form"
>here</a>.
</p>
</body>
</html>
END_3