line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Astro::Montenbruck::Time::Sidereal; |
2
|
4
|
|
|
4
|
|
88835
|
use strict; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
125
|
|
3
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
89
|
|
4
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
546
|
use Readonly; |
|
4
|
|
|
|
|
3383
|
|
|
4
|
|
|
|
|
165
|
|
6
|
4
|
|
|
4
|
|
21
|
use Exporter qw/import/; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
124
|
|
7
|
4
|
|
|
4
|
|
387
|
use Astro::Montenbruck::MathUtils qw/reduce_deg frac/; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
234
|
|
8
|
4
|
|
|
4
|
|
380
|
use Astro::Montenbruck::Time qw/jd_cent/; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
168
|
|
9
|
4
|
|
|
4
|
|
388
|
use Astro::Montenbruck::NutEqu qw/deltas obliquity/; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
1109
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT = qw/ramc lmst/; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = 0.01; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Readonly::Scalar our $SOLAR_TO_SIDEREAL => 1.002737909350795; |
16
|
|
|
|
|
|
|
# Difference in between Sidereal and Solar hour (the former is shorter) |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub ramc { |
19
|
657
|
|
|
657
|
1
|
1407
|
my ( $jd, $lambda ) = @_; |
20
|
657
|
|
|
|
|
1938
|
my $t = jd_cent($jd); |
21
|
|
|
|
|
|
|
|
22
|
657
|
|
|
|
|
1719
|
my ($dpsi) = deltas($t); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# Correction for apparent S.T. |
25
|
657
|
|
|
|
|
1589
|
my $corr = $dpsi * cos( obliquity($t) ) / 3600; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Mean Local S.T. |
28
|
657
|
|
|
|
|
3295
|
my $result = |
29
|
|
|
|
|
|
|
280.46061837 + 360.98564736629 * ( $jd - 2451545 ) + 0.000387933 * $t * $t |
30
|
|
|
|
|
|
|
- $t**3 / 38710000 + $corr; |
31
|
|
|
|
|
|
|
|
32
|
657
|
|
|
|
|
979
|
$result -= $lambda; |
33
|
657
|
|
|
|
|
1518
|
reduce_deg($result); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub lmst { |
37
|
0
|
|
|
0
|
1
|
|
my ($mjd, $lambda) = @_; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my $mj0 = int($mjd); |
40
|
0
|
|
|
|
|
|
my $ut = ($mjd - $mj0) * 24; |
41
|
0
|
|
|
|
|
|
my $t = ($mj0 - 51544.5) / 36525.0; |
42
|
0
|
|
|
|
|
|
my $gmst = 6.697374558 + 1.0027379093 * $ut + (8640184.812866 + (0.093104 - 6.2E-6 * $t) * $t) * $t / 3600.0; |
43
|
0
|
|
|
|
|
|
my $lmst = 24.0 * frac( ($gmst - $lambda / 15.0) / 24.0 ); |
44
|
0
|
0
|
|
|
|
|
$lmst += 24.0 if $lmst < 0; |
45
|
0
|
|
|
|
|
|
$lmst |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
__END__ |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=pod |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=encoding UTF-8 |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 NAME |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Astro::Montenbruck::Time::Sidereal - Sidereal time related calculations. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 VERSION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Version 0.01 |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 DESCRIPTION |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Sidereal time related calculations. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 EXPORT |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=over |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item * L</ramc($jd, $lambda)> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=back |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 ramc($jd, $lambda) |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Right Ascension of the Meridian |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head3 Arguments |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=over |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item * B<$jd> — Standard Julian Date. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=item * B<$lambda> — geographic longitude in degrees, negative for East |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=back |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 lmst($mjd, $lambda) |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Local Mean Sidereal Time |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head3 Arguments |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=over |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item * B<$mjd> — Modified Julian Date. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item * B<$lambda> — geographic longitude in degrees, negative for East |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=back |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head3 Returns |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Right Ascension of Meridian, arc-degrees |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=cut |