File Coverage

lib/Astro/Montenbruck/RiseSet/Constants.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Astro::Montenbruck::RiseSet::Constants;
2              
3 3     3   715 use strict;
  3         14  
  3         76  
4 3     3   12 use warnings;
  3         6  
  3         132  
5              
6             our @ISA = qw/Exporter/;
7             our $VERSION = 0.02;
8              
9 3     3   15 use Readonly;
  3         5  
  3         1165  
10              
11             my @events = qw/$EVT_RISE $EVT_SET $EVT_TRANSIT @RS_EVENTS/;
12             my @states = qw/$STATE_CIRCUMPOLAR $STATE_NEVER_RISES/;
13             my @twilight = qw/$TWILIGHT_CIVIL $TWILIGHT_ASTRO $TWILIGHT_NAUTICAL %TWILIGHT_TITLE/;
14             my @alts = qw/$H0_SUN $H0_MOO $H0_PLA %H0_TWL/;
15              
16             our %EXPORT_TAGS = (
17             events => \@events,
18             states => \@states,
19             twilight => \@twilight,
20             altitudes => \@alts,
21             all => [ @events, @states, @twilight, @alts ]
22             );
23             our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
24              
25             Readonly our $EVT_RISE => 'rise';
26             Readonly our $EVT_SET => 'set';
27             Readonly our $EVT_TRANSIT => 'transit';
28             Readonly::Array our @RS_EVENTS => ( $EVT_RISE, $EVT_TRANSIT, $EVT_SET );
29              
30             Readonly our $STATE_CIRCUMPOLAR => 'circumpolar';
31             Readonly our $STATE_NEVER_RISES => 'never rises';
32              
33             Readonly our $TWILIGHT_CIVIL => 'civil';
34             Readonly our $TWILIGHT_ASTRO => 'astronomical';
35             Readonly our $TWILIGHT_NAUTICAL => 'nautical';
36              
37             Readonly our $H0_SUN => -50 / 60;
38             Readonly our $H0_MOO => 8 / 60;
39             Readonly our $H0_PLA => -34 / 60;
40              
41             Readonly::Hash our %H0_TWL => (
42             $TWILIGHT_CIVIL => -6,
43             $TWILIGHT_ASTRO => -18,
44             $TWILIGHT_NAUTICAL => -12
45             );
46              
47             Readonly::Hash our %TWILIGHT_TITLE => (
48             $EVT_RISE => 'Dawn',
49             $EVT_SET => 'Dusk',
50             );
51              
52             1;
53              
54             __END__
55              
56             =pod
57              
58             =encoding UTF-8
59              
60             =head1 NAME
61              
62             Astro::Montenbruck::RiseSet::Constants — rise/set constants
63              
64             =head1 SYNOPSIS
65              
66             use Astro::Montenbruck::RiseSet::Constants qw/:all/;
67              
68             =head1 VERSION
69              
70             Version 0.01
71              
72             =head1 DESCRIPTION
73              
74             Constants used across rise/set modules.
75              
76             =head1 EXPORT
77              
78             =head2 CONSTANTS
79              
80             =head3 EVENTS
81              
82             =over
83              
84             =item * C<$EVT_RISE> — rise
85              
86             =item * C<$EVT_SET> — set
87              
88             =item * C<$EVT_TRANSIT> — transit (upper culmination)
89              
90             =item * C<@RS_EVENTS> — array containing all the constants above
91              
92             =back
93              
94             =head3 STATES
95              
96             =over
97              
98             =item * C<$STATE_CIRCUMPOLAR> — always above the horizon
99              
100             =item * C<$STATE_NEVER_RISES> — always below the horizon
101              
102             =back
103              
104             =head3 TYPES OF TWILIGHT
105              
106             =over
107              
108             =item * C<$TWILIGHT_CIVIL> — civil
109              
110             =item * C<$TWILIGHT_ASTRO> — astronomical
111              
112             =item * C<$TWILIGHT_NAUTICAL> — nautical
113              
114             =back
115              
116             =head3 STANDARD ALTITUDES
117              
118             =over
119              
120             =item * C<$H0_SUN> — Sun
121              
122             =item * C<$H0_MOO> — Moon
123              
124             =item * C<$H0_PLA> — Planets and stars
125              
126             =item * C<%H0_TWL> — For twilight types. Keys are L</TYPES OF TWILIGHT>
127              
128             =back
129              
130             =head2 TAGS
131              
132             =over
133              
134             =item * C<:events> — C<$EVT_RISE>, C<$EVT_SET>, C<$EVT_TRANSIT>, C<@RS_EVENTS>
135              
136             =item * C<:states> — C<$STATE_CIRCUMPOLAR>, C<$STATE_NEVER_RISES>
137              
138             =item * C<:twilight> — C<$TWILIGHT_CIVIL>, C<$TWILIGHT_ASTRO>, C<$TWILIGHT_NAUTICAL>
139              
140             =item * C<:altitudes> — C<$H0_SUN>, C<$H0_MOO>, C<$H0_PLA>, C<%H0_TWL>
141              
142             =item * C<:all> — all of the above
143              
144             =back
145              
146             =head1 AUTHOR
147              
148             Sergey Krushinsky, C<< <krushi at cpan.org> >>
149              
150             =head1 COPYRIGHT AND LICENSE
151              
152             Copyright (C) 2010-2022 by Sergey Krushinsky
153              
154             This library is free software; you can redistribute it and/or modify
155             it under the same terms as Perl itself.
156              
157             =cut