Astro::Observations is a perl module which provides a way to accumulate a
list of observations desired for an observation session.
use Astro::Observations;
$obs = Astro::Observations->new( $observation_type, %attr );
($status, @incomplete ) = $obs->is_complete;
($status, @invalid ) = $obs->is_valid;
$obs->x( $value );
$value = $obs->x;
$obs->clear_x;
($status, $hour_angle) = $obs->get_hour_angle;
($status, $declination) = $obs->declination;
($status, $time) = $obs->call_transit_function( $obs );
Hmmm....
The following methods are available across all observation types.
- new
-
OBJREF = Astro::Observations->new( SCALAR )
-
OBJREF = Astro::Observations->new( SCALAR, HASH )
-
The first form of new takes only a SCALAR value that identifies which of the
supported observation types is desired for this
instance.
The second form takes an additional argument of a HASH, which specifies
attributes and their values.
- is_complete
-
SCALAR = $obs->is_complete
-
(SCALAR, ARRAY) = $obs->is_complete
-
Determines if all required elements are defined. Does not check for
validity of the required elements.
When called with a SCALAR as the return type, returns a 1 or 0
whether the object is complete or not. When an array is the return type,
an ARRAY of SCALARS returned in addition to the validity SCALAR. The ARRAY
entries are the attributes which are required but not defined.
- is_valid
-
SCALAR = $obs->is_valid
-
(SCALAR, ARRAY) = $obs->is_valid
-
Determines if all required elements are valid. Will implicitly call
is_complete before checking for validity. Otherwise, return
values are the same as is_complete. Validity is determined
by the derived classes, rather than this class.
- get_hour_angle
-
(SCALAR, SCALAR) = $obs->get_hour_angle
-
(SCALAR, SCALAR) = $obs->get_hour_angle( OBJREF )
-
Returns the status of the operation and the hour angle of the observation in
question. The status is 1/0 for success/failure, and units are degrees
West of meridian. The first form takes no arguments and returns the result
for the current time. The second form takes a DateTime::Precise reference and
returns the result for the specified time.
Note the the time should be in Universal Time.
- get_declination
-
(SCALAR, SCALAR) = $obs->get_declination
-
(SCALAR, SCALAR) = $obs->get_declination( SCALAR )
-
Returns the status of the operation and the declination of the observation in
question. The status is 1/0 for success/failure, and units are degrees
North of equator. The first form takes no arguments and returns the result
for the current time. The second form takes a DateTime::Precise reference and
returns the result for the specified time.
Note the the time should be in Universal Time.
- call_transit_function
-
(SCALAR, SCALAR) = $obs->call_transit_function( OBJREF )
-
(SCALAR, SCALAR) = $obs->call_transit_function( OBJREF, OBJREF )
-
Calls the transit function to calculate the telescope transit time between
two objects. The first parameter is the second object (the first object being
the object the call was made with), and the second object (if present) is of
type DateTime::Precise, which indicates the time the transit is to take place.
The time is potentially required as some Observation types specify a hour
angle observation location, rather than a right ascension. If required and
not specified, the current time will be used.
Note the the time should be in Universal Time.
All attributes have three accessor methods associated with them. Listed below
are these three methods. Unless specifically noted, all attributes take and
return a SCALAR type.
- read
-
SCALAR = $obj->x
-
Returns the current value of attribute x.
- write
-
$obj->x( SCALAR )
-
Sets and returns the value given for attribute x. If the new value is undef,
the attribute will be unchanged and the current value will be returned.
- clear
-
$obj->clear_x
-
Sets value of attribute x to undef. No return value.
These attributes are shared by all objects in the given ?scope?, and are
all required for an object to be considered complete and
valid. These attributes need only be set once, typically on
the first instatiation of the class.
- transit_function
-
This attribute takes a subroutine reference. The function given
needs to accept four SCALAR's, and returns a SCALAR. The four input
values are two sets of hour angle/declination pairs, where hour angle is
degrees West of meridian, and declination is degrees North of equator. The
single return value should be the time required in seconds to transit the
telescope between the first and second locations. Note that to call this
function, use call_transit_function.
- longitude
-
- latitude
-
The longitude and latitude location of the observing telescope.
- hour_angle_min
-
- hour_angle_max
-
The minimum and maximum hour angle that the telescope is capable of reaching,
specified in degrees West of meridian.
- declination_min
-
- declination_max
-
The minimum and maximum declination angle that the telescope is capable of
reaching, specified in degrees North of equator.
These attributes are more normal, in that they are unique for each observation
instantiation. As indicated, they are all required.
- exp_length
-
The exposure length in seconds of the given object.
- image_type
-
The image type, case insensitive, chosen from the following types:
dark
-
Takes a dark picture, with the shutter closed.
object
-
Takes a normal picture, with the shutter open.
bias
-
Takes a bias picture, with the shutter closed. Because of the nature of bias
pictures (minimum exposure), the exposure length is ignored, but
exp_time still needs to be a valid number, like 0. The reason exp_time needs
to be set is I'm lazy and didn't want to put special cases into is_complete
and is_valid for the bias picture type. This will likely change in the future.
- Simple
-
Simple type observations
Robert Creager <AstroObservations at LogicalChaos.org<gt>