| 1 | package Astro::Montenbruck::Time::Sidereal; | ||||||||||
| 2 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 4 | ▶ | use Readonly; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 4 | ▶ | use Exporter qw/import/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 4 | ▶ | use Astro::Montenbruck::MathUtils qw/reduce_deg frac/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 4 | ▶ | use Astro::Montenbruck::Time qw/jd_cent/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 4 | ▶ | use Astro::Montenbruck::NutEqu qw/deltas obliquity/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 4 | our @EXPORT = qw/ramc lmst/; | |||||||||
| 12 | |||||||||||
| 13 | 4 | our $VERSION = 0.01; | |||||||||
| 14 | |||||||||||
| 15 | 4 | Readonly::Scalar our $SOLAR_TO_SIDEREAL => 1.002737909350795; | |||||||||
| 16 | # Difference in between Sidereal and Solar hour (the former is shorter) | ||||||||||
| 17 | |||||||||||
| 18 | 657 | ▶ | sub ramc { | ||||||||
|
Subroutine
ramc: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 19 | 657 | my ( $jd, $lambda ) = @_; | |||||||||
| 20 | 657 | my $t = jd_cent($jd); | |||||||||
| 21 | |||||||||||
| 22 | 657 | my ($dpsi) = deltas($t); | |||||||||
| 23 | |||||||||||
| 24 | # Correction for apparent S.T. | ||||||||||
| 25 | 657 | my $corr = $dpsi * cos( obliquity($t) ) / 3600; | |||||||||
| 26 | |||||||||||
| 27 | # Mean Local S.T. | ||||||||||
| 28 | 657 | my $result = | |||||||||
| 29 | 280.46061837 + 360.98564736629 * ( $jd - 2451545 ) + 0.000387933 * $t * $t | ||||||||||
| 30 | - $t**3 / 38710000 + $corr; | ||||||||||
| 31 | |||||||||||
| 32 | 657 | $result -= $lambda; | |||||||||
| 33 | 657 | reduce_deg($result); | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | sub lmst { | ||||||||
|
Subroutine
lmst: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 37 | 0 | 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 | ▶ | $lmst += 24.0 if $lmst < 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | 0 | $lmst | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | |||||||||||
| 49 | 4 | 1; | |||||||||
| 50 | __END__ | ||||||||||