Astro/SolarParallax.pm

filter: Statementstmt 40.7% 11 / 27 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 41.0% 16 / 39 CC 2 SCAR 10.4
CC
2
Cov
37%
new
6.0
AU
2.0
BEGIN
1.0
CRAP 2.8
« Geo/Coordinates.pm ↑ Summary
1 package Astro::SolarParallax;
2  
3 #use 5.008003;
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Math::Trig;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = '0.04';
9  
10  
11 =head1 NAME
12  
13 Astro::SolarParallax - Find the Solar Parallax from Venus Transit
14  
15 =head1 SYNOPSIS
16  
17 use Astro::SolarParallax::Observer;
18 use Astro::SolarParallax;
19 use Geo::Coordinates;
20 my $obs1 = new Geo::Coordinates;
21 my $obs2 = new Geo::Coordinates;
22 $obs1->latitude(78.20); # Longyearbyen
23 $obs1->longitude(15.82);
24 $obs2->latitude(13.7307); # Bangkok
25 $obs2->longitude(100.521);
26 my $observer1 = Astro::SolarParallax::Observer->new($obs1);
27 my $observer2 = Astro::SolarParallax::Observer->new($obs2);
28 # Longyearbyen
29 $observer1->contacttime(1, "07:17:47");
30 $observer1->contacttime(4, "13:21:00");
31 # Bangkok
32 $observer2->contacttime(1, "07:13:07");
33 $observer2->contacttime(4, "13:20:36");
34 my $measurement = Astro::SolarParallax->new($observer1, $observer2);
35 print $measurement->AU(1,4);
36  
37  
38 =head1 DESCRIPTION
39  
40 This module is intended to be used to compute the solar parallax from planetary transits. Specifically, in the current implementation, it makes use of a method developed by F. Mignard, and is limited to the transit of Venus on 2004-06-08.
41  
42 It has a object oriented interface.
43  
44 =over
45  
46 =item C<new($obs1, $obs2)>
47  
48 This is the constructor of this class, it takes as argument two observers, that is, two objects of the L<Astro::SolarParallax::Observer> class.
49  
50 =cut
51  
52 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
53 0 my $that = shift;
54 0 my $obs1 = shift;
55 0 my $obs2 = shift;
56 0 ▶ my $class = ref($that) || $that;
Condition0%0/3
ref $that || $that
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $that || $that
ref $that $that
Truth table0%0/3
A || B
A= ref $thatB= $that
ABresult
1X1
011
000
57 0 my $self = {
58 OBS1 => $obs1,
59 OBS2 => $obs2,
60 };
61  
62 0 bless($self, $class);
63 0 return $self;
64 }
65  
66 =item C<AU(@contacts)>
67  
68 This method will return the distance to the sun in kilometers, based on the measurements done by the two observers given to the constructor. It takes as argument and array containing the number of the contact points, in ascending order.
69  
70 The constraints in the L<Astro::SolarParallax::Observer> apply.
71  
72 =cut
73  
74  
75 0 ▶sub AU {
Subroutine AU: not called CC=1 SCAR=6.9
Pod documented
76 0 my $self = shift;
77 0 my @contacts = @_;
78 0 my $deltatref = ${$self}{'OBS2'}->deltatref(@contacts)
79 0 - ${$self}{'OBS1'}->deltatref(@contacts);
80 0 my $deltatobs = ${$self}{'OBS2'}->deltatobs(@contacts)
81 0 - ${$self}{'OBS1'}->deltatobs(@contacts);
82 0 return (149.60 * 1000000 * $deltatref->seconds / $deltatobs->seconds);
83 }
84  
85  
86 1 1;
87 __END__
« Geo/Coordinates.pm ↑ Summary