Astro-Montenbruck

 view release on metacpan or  search on metacpan

script/rst_almanac.pl  view on Meta::CPAN

        $rst_func->(
            $pla,
            on_event   => sub {
                my ($evt, $jd_evt) = @_;
                $report{$evt} = jd2str($jd_evt, $tz, format => '%H:%M')
            },
            on_noevent => sub {
                my ($evt, $state) = @_;
                $report{$evt} = $state;
            }
        );            
        say sprintf(
            '%-12s rise: %s, transit: %s, set: %s',
            $pla, 
            map {$report{$_}} @RS_EVENTS)
    } 
    say('');     
}


__END__

=pod

=encoding UTF-8

=head1 NAME

rst_almanac — calculate rise, set and transit times of Sun, Moon and the planets.


=head1 SYNOPSIS

  rst_almanac [options]

=head1 OPTIONS

=over 4

=item B<--help>

Prints a brief help message and exits.

=item B<--man>

Prints the manual page and exits.

=item B<--start>

Start date, in B<YYYY-DD-MM> format, current date by default.

=item B<--days>

Number of days to process, B<30> by default

=item B<--timezone>

Time zone name, e.g.: C<EST>, C<UTC>, C<Europe/Berlin> etc. 
or I<offset from Greenwich> in format B<+HHMM> / B<-HHMM>, like C<+0300>.

    --timezone=CET # Central European Time
    --timezone=EST # Eastern Standard Time
    --timezone=UTC # Universal Coordinated Time
    --timezone=GMT # Greenwich Mean Time, same as the UTC
    --timezone=+0300 # UTC + 3h (eastward from Greenwich)
    --timezone="Europe/Moscow"

By default, local timezone by default.

Please, note: Windows platform does not recognize some time zone names, C<MSK> for instance.
In such cases use I<offset from Greenwich> format, as described above.


=item B<--place>

The observer's location. Contains 2 elements, space separated. 

=over

=item * 

latitude in C<DD(N|S)MM> format, B<N> for North, B<S> for South.

=item * 

longitude in C<DDD(W|E)MM> format, B<W> for West, B<E> for East.

=back

E.g.: C<--place=51N28 0W0> for I<Greenwich, UK> (the default).

B<Decimal numbers> are also supported. In that case

=over

=item * 

The latitude always goes first

=item * 

Negative numbers represent I<South> latitude and I<East> longitudes. 

=back

C<--place=55.75 -37.58> for I<Moscow, Russian Federation>.
C<--place=40.73 73.935> for I<New-York, NY, USA>.

=back


=head1 DESCRIPTION

Calculate rise, set and transit times of Sun, Moon and the planets for given range of days


=head2 EXAMPLES

    perl ./script/rst_almanac.pl --place=56N26 37E09 --days=7
    perl ./script/rst_almanac.pl --place=56N26 37E09 --start=2021-01-01 --days=365
    



( run in 0.490 second using v1.01-cache-2.11-cpan-e1769b4cff6 )