Astro-Montenbruck

 view release on metacpan or  search on metacpan

script/moon_almanac.pl  view on Meta::CPAN

    say sprintf( 'Date : %s', sprintf('%d-%02d-%02d', @date) );
    say '';

    my %rst = rise_set_transit(@date, $lat, $lon, $tz);
    say sprintf( "Rise: %s\nTransit: %s\nSet: %s",
        map { $rst{$_} } @RS_EVENTS );
    say '';
    my ($mo, $su) = sun_moon_positions($jd);
    say sprintf('Sun longitude: %6.2f', $su);  
    say sprintf('Moon longitude: %6.2f', $mo);  
    say '';

    my ($phase, $deg, $days) = moon_phase(moon => $mo, sun => $su);
    say sprintf("Phase: %s\nAge: %5.2f deg. = %d days", $phase, $deg, $days);  
    say "\n---\n" 
}



__END__

=pod

=encoding UTF-8

=head1 NAME

moon_almanac — Computes rise, set of the Moon, its position and lunar phase circumstances for a range of dates

=head1 SYNOPSIS

  $ moon_almanac [OPTIONS]

=head1 OPTIONS

=over 4

=item B<--help>

Prints a brief help message and exits.

=item B<--start>

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

  --start=2019-06-08 # calendar date

=item B<--days>

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

=item B<--step>

Step between successive cevents, in days, B<7> 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, a local timezone.

Please, note: Windows platform may not recognize some time zone names, like C<MSK>.
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

B<moon> Computes rise, set of the Moon, its position and lunar phase circumstances for a range of dates
 
krushi astro-montenbruck (master) $ perl script/moon_almanac.pl --start=2021-01-01 --days=2 --step=14
Lunar Calendar
Place: 51N28, 000W00

Date : 2021-01-01



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