forked from Stellarium/stellarium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransit_of_venus.ssc
211 lines (180 loc) · 5.64 KB
/
transit_of_venus.ssc
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
//
// Name: Transit of Venus
// License: Public Domain
// Author: Peter Hickey
// With thanks to Barrykgerdes and daggerstab for their contributions
// Description: Transit of Venus as seen from Sydney Australia, 6th June 2012.
//
//
// The following two functions were copied from a script by Schdefon
function blockText(textArray)
{
var fontSize = 30;
var lineSep = fontSize * 1.5;
y = 250 + (lineSep*textArray.length);
ids = new Array();
for(i=0; i<textArray.length; i++)
{
ids[i] = LabelMgr.labelScreen(textArray[i], 30, y, false, fontSize, "#ff0000");
y = y - lineSep;
}
for(i=0; i<ids.length; i++)
{
LabelMgr.setLabelShow(ids[i], true);
core.wait(0.15);
}
return ids;
}
function clearLabels(ids)
{
for(i=0; i<ids.length; i++)
{
LabelMgr.setLabelShow(ids[i], false);
core.wait(0.15);
}
core.wait(1);
for(i=0; i<ids.length; i++)
{
LabelMgr.deleteLabel(ids[i]);
}
}
// Save the current location, if it's from the default list
location = core.getObserverLocation();
// Set up the display and the location to Sydney, Australia
core.moveToAltAzi(10, 90, 3);
StelMovementMgr.zoomTo(180, 5);
core.setDate("2012:06:05T21:06:50","utc");
core.setObserverLocation("Sydney, Australia");
ids = blockText(Array("NEVER look directly at the Sun!"));
core.wait(5);
clearLabels(ids);
core.clear("natural");
core.selectObjectByName("Sun", false);
ids = blockText(Array("Sydney Australia",
"2012-06-06", "Sunrise"));
core.wait(5);
//Advance an hour
core.setDate("2012:06:05T22:08:00","utc");
// Select Venus and Zoom to a suitable size to display and track
core.selectObjectByName("Venus", true);
StelMovementMgr.setFlagTracking(true);
StelMovementMgr.zoomTo(1.04, 5);
clearLabels(ids);
ids = blockText(Array("just below the Sun.",
"The planet Venus"));
core.wait(5);
//Turn off Landscape, Atmosphere and Fog
LandscapeMgr.setFlagLandscape(false);
LandscapeMgr.setFlagAtmosphere(false);
LandscapeMgr.setFlagFog(false);
clearLabels(ids);
ids = blockText(Array("Dobsonian Telescope","as seen through a","Sydney Australia",
"2012-06-06", "Transit of Venus"));
// Set display to a suitable size for viewing the Sun
StelMovementMgr.zoomTo(0.875, 5);
core.selectObjectByName("Sun", false);
StelMovementMgr.setFlagTracking(true);
core.wait(5);
// Quicken up the display 60 times
core.setTimeRate(60);
core.waitFor("2012:06:05T22:10:00", "utc");
clearLabels(ids);
ids = blockText(Array("First Contact approx 8:12 a.m."));
core.wait(15);
core.waitFor("2012:06:05T22:30:00", "utc");
clearLabels(ids);
ids = blockText(Array("Second Contact approx 8:30 a.m."));
core.wait(15);
//Speed up for remainder of Transit until third contact
clearLabels(ids);
ids = blockText(Array("for approximately 6 hours.",
"across the face of the Sun","Venus continues to transit"));
core.setTimeRate(800);
core.wait(25);
core.setTimeRate(60);
//Prepare for third contact
core.waitFor("2012:06:06T4:24:00","utc");
clearLabels(ids);
ids = blockText(Array("Third Contact approx 2:20 p.m."));
core.wait(10);
core.waitFor("2012:06:06T4:44:00", "utc");
clearLabels(ids);
ids = blockText(Array("Fourth Contact approx 2:39 p.m."));
core.wait(5);
clearLabels(ids);
ids = blockText(Array("than a century away. ",
"The next Transit of Venus is more "));
core.wait(5);
clearLabels(ids);
// View Transit in Equatorial Mode
core.setDate("2012:06:05T21:06:50","utc");
core.setObserverLocation("Sydney, Australia");
core.setMountMode("equatorial");
ids = blockText(Array("NEVER look directly at the Sun!"));
core.wait(5);
clearLabels(ids);
ids = blockText(Array("just above the Sun.",
"The planet Venus"));
core.wait(5);
clearLabels(ids);
ids = blockText(Array("Equatorial Telescope","as seen through an","Sydney Australia",
"2012-06-06", "Transit of Venus"));
core.selectObjectByName("Sun",false);
core.wait(5);
clearLabels(ids);
//Advance an hour
core.setDate("2012:06:05T22:08:00","utc");
core.setMountMode("equatorial");
// Set display to a suitable size for viewing the Sun
StelMovementMgr.zoomTo(0.875, 5);
core.selectObjectByName("Sun", false);
StelMovementMgr.setFlagTracking(true);
core.wait(3);
// Quicken up the display 60 times
core.setTimeRate(60);
core.waitFor("2012:06:05T22:10:00", "utc");
core.setMountMode("equatorial");
clearLabels(ids);
ids = blockText(Array("First Contact approx 8:12 a.m."));
core.wait(15);
core.waitFor("2012:06:05T22:30:00", "utc");
core.setMountMode("equatorial");
clearLabels(ids);
ids = blockText(Array("Second Contact approx 8:30 a.m."));
core.wait(15);
//Speed up for remainder of Transit until third contact
clearLabels(ids);
ids = blockText(Array("for approximately 6 hours.",
"across the face of the Sun","Venus continues to transit"));
core.setTimeRate(800);
core.wait(25);
core.setTimeRate(60);
//Prepare for third contact
core.waitFor("2012:06:06T4:24:00","utc");
core.setMountMode("equatorial");
clearLabels(ids);
ids = blockText(Array("Third Contact approx 2:20 p.m."));
core.wait(15);
core.waitFor("2012:06:06T4:44:00", "utc");
core.setMountMode("equatorial");
clearLabels(ids);
ids = blockText(Array("Fourth Contact approx 2:39 p.m."));
core.wait(10);
clearLabels(ids);
ids = blockText(Array("than a century away. ",
"The next Transit of Venus is more "));
core.wait(5);
clearLabels(ids);
ids = blockText(Array("Returning to current time and date."));
core.setTimeRate(1);
StelMovementMgr.setFlagTracking(false);
StelMovementMgr.zoomTo(180, 5);
core.moveToAltAzi(10, 180, 3);
core.wait(3);
//Restore the original location
core.setObserverLocation(location);
core.setDate("now");
core.clear("natural");
LandscapeMgr.setFlagLandscape(true);
LandscapeMgr.setFlagAtmosphere(true);
clearLabels(ids);