-
Notifications
You must be signed in to change notification settings - Fork 0
/
TimeSearch.pro
197 lines (142 loc) · 6.24 KB
/
TimeSearch.pro
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
pro TimeSearch
;;;;;;;;;;;;;;;;;;;;;;;
;
; This code is intended to provide a user with a list of objects in the sky above
; when a given date and time are supplied.
;
;
; Uses some example code from Harris Geospatial IDL Documentation
;
; Written By: Brian Barker
; Last Update: 3-17-2021
;
;
;;;;;;;;;;;;;;;;;;;;;;;
; User Inputs
repeat begin
print,""
print,"Is The Observation Date During Daylight Savings Time? "
read,time_mode,prompt="|1 = Yes| |0 = No| "
print,""
endrep until (time_mode le 1) && (time_mode ge 0)
if time_mode eq 0 then begin
read,MST,prompt="What Is The Hour Of Observation In 24-hr Format? "
print,""
HAms = MST - 12
; Find RAms
repeat begin
repeat begin
print,"How Would You Like To Calculate Right Ascension Of The Mean Sun?"
read,search_mode,prompt="|1 = Using Day Of The Julian Calendar| |2 = Using Days Since Vernal Equinox| "
print,""
endrep until search_mode le 2 && search_mode ge 1 ; The beginning question repeats until one of the available choices is picked
; If search_mode 1 is picked do this
if search_mode eq 1 then begin
read,t,prompt="What Day Of The Julian Calendar Would You Like To Use? "
print,""
RA = 18.62 + (.0657 * t)
if RA gt 24 then begin
new_RA = RA - 24
print,"Right Ascension Of The Mean Sun On This Day Is: ", (new_RA)
print,""
RAms = new_RA
endif
if RA le 24 then begin
print,"Right Ascension Of The Mean Sun On This Day Is: ", RA
print,""
RAms = RA
endif
endif
; If search_mode 2 is picked, do this
if search_mode eq 2 then begin
read,tv,prompt="How Many Days Since The Vernal Equinox? "
print,""
RA = 0.0 + (24.0/365.0) * tv
if RA gt 24 then begin
new_RA = RA - 24
print,"Right Ascension Of The Mean Sun On This Day Is: ", (new_RA)
print,""
RAms = new_RA
endif
if RA le 24 then begin
print,"Right Ascension Of The Mean Sun On This Day Is: ", RA
print,""
RAms = RA
endif
endif
print,"Would You Like To Calculate A New RA?"
read,end_RASun,prompt="|1 = Yes| |0 = No| "
print,""
endrep until end_RASun eq 0
LST = RAms + HAms
print,"The Local Sidereal Time Is: ",LST
print,""
RA_w = LST - 6
RA_e = LST + 6
print,"Looking South At This Time, Sources With An RA Hour Between The Following Two Values Will Be Visible. "
print,"RA To The East ",floor(RA_e)
print,"RA To The West ",floor(RA_w)
endif
if time_mode eq 1 then begin
read,MST,prompt="What Is The Hour Of Observation In 24-hr Format? "
print,""
DST = MST + 1
HAms = DST - 13
; Find RAms
repeat begin
repeat begin
print,"How Would You Like To Calculate Right Ascension Of The Mean Sun?"
read,search_mode,prompt="|1 = Using Day Of The Julian Calendar| |2 = Using Days Since Vernal Equinox| "
print,""
endrep until search_mode le 2 && search_mode ge 1 ; The beginning question repeats until one of the available choices is picked
; If search_mode 1 is picked do this
if search_mode eq 1 then begin
read,t,prompt="What Day Of The Julian Calendar Would You Like To Use? "
print,""
RA = 18.62 + (.0657 * t)
if RA gt 24 then begin
new_RA = RA - 24
print,"Right Ascension Of The Mean Sun On This Day Is: ", (new_RA)
print,""
RAms = new_RA
endif
if RA le 24 then begin
print,"Right Ascension Of The Mean Sun On This Day Is: ", RA
print,""
RAms = RA
endif
endif
; If search_mode 2 is picked, do this
if search_mode eq 2 then begin
read,tv,prompt="How Many Days Since The Vernal Equinox? "
print,""
RA = 0.0 + (24.0/365.0) * tv
if RA gt 24 then begin
new_RA = RA - 24
print,"Right Ascension Of The Mean Sun On This Day Is: ", (new_RA)
print,""
RAms = new_RA
endif
if RA le 24 then begin
print,"Right Ascension Of The Mean Sun On This Day Is: ", RA
print,""
RAms = RA
endif
endif
print,"Would You Like To Calculate A New RA?"
read,end_RASun,prompt="|1 = Yes| |0 = No| "
print,""
endrep until end_RASun eq 0
print,HAms
LST = RAms + HAms
print,"The Local Sidereal Time Is: ",LST
print,""
RA_w = LST - 6
RA_e = LST + 6
print,"Looking South At This Time, Sources With An RA Hour Between The Following Two Values Will Be Visible. "
print,""
print,"RA To The East ",RA_e
print,"RA To The West ",RA_w
print,""
endif
end