This program is Copyright © 2005 by Jean-Marc Baillard and is used here by permission.
This program is supplied without representation or warranty of any kind. Jean-Marc Baillard and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.
-The following program calculates the times of rising, transit and setting
of a celestial body on a day D
and the geometric altitude at the moment of transit.
-The coordinates ( right ascension and declination ) must be obtained
independently on days D-1, D , D+1 ( 0h UT )
but first, we need a routine to compute the mean sidereal time
at Greenwich:
Mean Sidereal Time at Greenwich
Data Register: R00
Flag: /
Subroutine: "J0" or "J1" or "J2" ( cf "Julian
& Gregorian Calendars" for the HP-41" )
none if you have a Time module.
01 LBL "MST"
02 HR
03 STO Z
line 03 may be deleted if you replace line 05 by XEQ "J1" or XEQ "J2"
04 X<>Y
05 XEQ "J0" if you
have a Time module, lines 05 to 08 may be replaced by 1.012
DDAYS 24 * -
06 24
07 *
08 +
09 8766 E3
10 /
11 STO 00
this line stores the number of millenium since 2000/01/01 0h , but
is not really necessary here.
12 .26
13 %
14 24000.5134
15 +
16 *
17 6.6645
18 +
19 +
20 24
21 MOD
22 HMS
23 END
( 58 bytes / SIZE 001 )
STACK | INPUTS | OUTPUTS |
Y | YYYY.MNDD | / |
X | hh.mnss (UT) | HH.MNSS (MST) |
Example: Find the mean sidereal time at Greenwich on 2005/01/27 at 14h29m16s
2005.0127 ENTER^
14.2916 XEQ "MST"
>>>> MST = 22h57m08s
Rising-Transit-Setting
Data Registers: R00 and R07 thru R15 are used for temporary data storage. ( Registers R01 to R06 are to be initialized before executing "RTS" )
( on day D-1 ) ( on day D ) ( on day D+1 ) ( at 0h )
• R01 = RA(-1) • R03 = RA(0) •
R05 = RA(+1) RA =
right ascension ( hh.mnss )
• R02 = decl(-1) • R04 = decl(0) • R06 =
decl(+1) decl = declination
( ° . ' " )
Flags: Set Flag F00
for the Sun
Set Flag F02 for the Moon ( Clear these
2 flags for the other celestial bodies )
Subroutine: "MST"
01 LBL "RTS"
02 DEG
03 STO 12
04 RDN
05 STO 11
06 CLX
07 XEQ "MST"
08 RCL 03
09 X<>Y
10 HMS-
11 HR
12 RCL 11
13 HR
14 15
15 /
16 -
17 24
18 MOD
19 STO 13
20 .34
21 FS? 00
22 .5
23 FS? 02
24 -.073
25 HR
26 SIN
27 STO 00
28 2
29 FS? 02
30 3
31 STO 15
32 24.0657
33 STO 14
34 CLX
35 STO 08
36 STO 09
37 STO 10
38 LBL 01
39 RCL 08
40 STO 07
41 XEQ 02
42 STO 08
43 XEQ 03
44 ST- 08
45 RCL 10
46 STO 07
47 XEQ 02
48 STO 10
49 XEQ 03
50 ST+ 10
51 RCL 09
52 STO 07
53 XEQ 02
54 STO 09
55 DSE 15
56 GTO 01
57 XEQ 03
58 24
59 ST* 08
60 ST* 09
61 ST* 10
62 R^
63 ASIN
64 HMS
65 RCL 10
66 HMS
67 RCL 09
68 HMS
69 RCL 08
70 HMS
71 RTN
72 LBL 02
73 RCL 01
74 HR
75 RCL 05
76 HR
77 RCL 03
78 HR
79 XEQ 04
80 RCL 13
81 +
82 RCL 14
83 /
84 RTN
85 LBL 03
86 RCL 02
87 HR
88 RCL 06
89 HR
90 RCL 04
91 HR
92 XEQ 04
93 RCL 04
94 HR
95 +
96 ENTER^
97 SIN
98 RCL 12
99 HR
100 SIN
101 *
102 STO Z
103 RCL 00
104 +
105 CHS
106 X<>Y
107 COS
108 RCL 12
109 HR
110 COS
111 *
112 ST+ T
113 /
114 SF 25
115 ACOS
116 RCL 14
117 /
118 15
119 /
120 FC?C 25
121 CLX
122 RTN
123 LBL 04
124 ST- Z
125 -
126 STO Z
127 X<>Y
128 ST- Z
129 +
130 RCL 07
131 *
132 +
133 RCL 07
134 *
135 2
136 /
137 END
( 199 bytes / SIZE 016 )
STACK | INPUTS | OUTPUTS |
T | / | h = altitude* ( ° . ' " ) |
Z | Date ( YYYY.MNDD ) | setting(UT) (hh.mnss) |
Y | Longitude ( ° . ' " ) | transit(UT) (hh.mnss) |
X | latitude ( ° . ' " ) | rising (UT) (hh.mnss) |
* where h = the geometric altitude of the center of the body at the time of transit.
Example1: Find the times of rising, transit and setting of the Sun at Seattle ( 122°19'51"W ; 47°36'23"N ) on 2005/01/27
-First, we find the right ascension and declination of the Sun on 2005/01/26
, 2005/01/27 , 2005/01/28 at 0h UT ( cf "Astronomical Ephemeris for
the HP-41" )
and we store these values into R01 thru R06:
20.3404 STO 01
20.3813 STO 03 20.4221
STO 05
-18.4416 STO 02
-18.2900 STO 04 -18.1324 STO
06
then, SF 00 CF 02
2005.0127
ENTER^
-122.1951 ENTER^
47.3623 XEQ "RTS" >>>> Rising
= 15h41m39s (UT) ( execution time = 34 seconds
)
RDN Transit = 20h22m12s (UT)
RDN Setting = 25h03m17s (UT) ( i-e
1h03m17s on 2005/01/28 )
RDN altitude of the Sun
at the time of transit = 24°07'48"
Note: For the Moon, CF 00 SF 02 , execution time = 47 seconds
Example2: Same questions for Sirius. The right ascension and declination are 6h45m23s and -16°43'18" for this date.
6.4523
STO 01 STO 03 STO 05
the coordinates may be regarded as constant.
-16.4318 STO 02
STO 04 STO 06
then, CF 00 CF 02
2005.0127 ENTER^ ( or
2005.0127 RCL 11 RCL 12 XEQ
"RTS" )
-122.1951 ENTER^
47.3623 XEQ "RTS" >>>> Rising
= 1h42m05s (UT) ( execution time = 34 seconds
)
RDN Transit = 6h28m09s (UT)
RDN Setting = 11h14m14s (UT)
RDN
altitude of Sirius at the time of transit = 25°40'19"
Note: If the body is circumpolar, there will
be no rising and setting: the star will remain above ( or below ) the horizon.
In this
case however, "RTS" yields ( approximately ) the same values in X, Y, Z
registers
-For example, with the pole star ( RA = 2h37m39s ; Decl = 89°17'10"
) "RTS" gives X = Y = Z = 2h21m06s
but since T = altitude of the star at the instant of transit
= 48°19'13"
we can deduce that X and Z are meaningless results.
Remarks:
-The longitudes are measured positively Eastward from the meridian of
Greenwich ( otherwise, replace line 16 by + instead of - ).
-The time of transit is ( almost ) always between 0h and 24h
but the time of rising may be negative ( day D-1 ) ( press 24 HMS+
)
and the time of setting greator than 24 ( day D+1 ).
-3 iterations are performed for the Moon, 2 in the other cases ( lines
28 to 31 ).One would be enough if the coordinates are constant.
-A quadratic interpolation formula is used.
-Line 25, register X contains a small angle -h0 that
takes the refraction into account ( and the parallax for the Moon ).
If you are situated at an altitude A ( in
meters ) above sea level and/or if the horizon is limited by mountains,
add to -h0 the correction:
arccos (a/(a+A)) - arctan H/d
where a = 6,378,137 m = the radius of the Earth
H = height of the mountain
d = distance mountain-observer.
( Add this term after line 25 )
-In fact, the refraction also depends on the air temperature and pressure
( cf "Astronomical Refraction for the HP-41" )
and rising and setting times are accurate to 1 minute only.
Reference:
Jean Meeus , "Astronomical Algorithms" - Willmann-Bell - ISBN
0-943396-35-2
Go back to the HP-41 software library
Go back to the general software library
Go
back to the main exhibit hall