NAME
Astro::SolarParallax::Observer - Class for observer data for Solar Parallax measurements
SYNOPSIS
use Astro::SolarParallax::Observer;
use Geo::Coordinates;
my $obs1 = new Geo::Coordinates;
$obs1->latitude(78.20); # Longyearbyen
$obs1->longitude(15.82);
my $observer1 = Astro::SolarParallax::Observer->new($obs1);
# Longyearbyen
$observer1->contacttime(1, "07:17:47");
$observer1->contacttime(4, "13:21:00");
DESCRIPTION
This class is used to set and retrieve data about a single observer of a Transit of Venus. You may use it to set things like the observer's position on Earth and the observed contact times.
METHODS
new($coords)
-
This is the constructor of this class.
As you use it to create a new observer, you should set the coordinates of observers, by giving it a Geo::Coordinates object.
contacttime($number, [$time, [$format]])
-
This method is used to set or retrieve the time of a contact.
The first parameter
$number
is an integer representing the number of the contact point (first contact, second contact, etc). If only$number
is given, the method will return a Time::Piece object with the contact time for this contact.To set the time of a contact, supply a second parameter
$time
. It may be a Time::Piece object (preferred), or just a string. If it is a string, you may supply a third$format
parameter, which gives the time format of the string. The time format follows thestrptime
of your Operating System. It defaults to%T
, for example "15:09:23". Internally, the time is represented by a Time::Piece object.If you do not supply a full date and timezone, just make sure you're using the same date and timezone. But then, you might want to supply it all, just to be sure...
deltatobs(@contacts)
-
This computes the observed duration from a contact to the other for this observer, given the number of the contact in the array
@contacts
as the parameter. In Mignard's paper, Eqs. (79) and (80) are examples of this.In the present implementation, only two contacts can be used, and the array should be in ascending order.
It will return a Time::Seconds object.
deltatref(@contacts)
-
Identical to the
deltatobs
, except it computes the reference duration. In Mignard's paper, Eqs. (76) and (77) are examples of this.At present, only the combination of contacts 1 and 4, and 2 and 3 are supported.
The following note is of little interest to a user, but a programmer interested in the details of the implementation may note that the constants of Mignard's Table 10 are hardcoded in this method. This is slightly inelegant, and may change if the class is expanded to support more contacts.
BUGS/TODO
This is the initial release. While it should be considered an alpha, the author do not expect any very substantial non-backwards compatible changes in the API of this class. The internals may, however, change significantly.
For now, it only supports the combination of two contact points, and only 1 and 4, and 2 and 3. I'm not sure it is meaningful to change this, but I'll give it a try if it is.
SEE ALSO
Astro::SolarParallax, Time::Piece, strptime. For the meaning of "contact points", see http://www.astronomy.no/venus080604/contactpoints.html
REFERENCES
F. Mignard: "The solar parallax with the transit of Venus", version 3, 2004-02-26. http://www.obs-azur.fr/cerga/mignard/TRANSITS/venus_contact.pdf
AUTHOR
Kjetil Kjernsmo, kjetilk@cpan.org
COPYRIGHT AND LICENSE
Copyright (C) 2004 by Kjetil Kjernsmo
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.