Astro-Coords

 view release on metacpan or  search on metacpan

lib/Astro/Coords/Calibration.pm  view on Meta::CPAN

package Astro::Coords::Calibration;

=head1 NAME

Astro::Coords::Calibration - calibrations that do not have coordinates

=head1 SYNOPSIS

  $c = new Astro::Coords::Calibration();

=head1 DESCRIPTION

Occasionally observations do not have any associated coordinates.  In
particular calibration observations such as DARKs and ARRAY TESTS do
not require the telescope to be in any particular location. This class
exists in order that these types of observation can be processed in
similar ways to other observations (from a scheduling viewpoint
calibration observations always are an available target).

=cut

use 5.006;
use strict;
use warnings;
use Carp;

our $VERSION = '0.23';

use base qw/ Astro::Coords::Fixed /;


=head1 METHODS

This class inherits from C<Astro::Coords::Fixed>.

=head2 Constructor

=over 4

=item B<new>

Simply instantiates an object with an Azimuth of 0.0 degrees and an
elevation of 90 degrees. The exact values do not matter.

A label can be associated with the calibration (for example, to
include the type).

  $c = new Astro::Coords::Calibration( name => 'DARK' );

=cut

sub new {
  my $proto = shift;
  my $class = ref($proto) || $proto;
  my %args = @_;

  my $self = $class->SUPER::new( az => 0.0, el => 90.0, units => 'deg' );
  $self->name( $args{name} ) if exists $args{name};

  return $self;
}

=back

=head2 General Methods

=over 4

=item B<type>

Return the coordinate type. In this case always return "CAL".

=cut

sub type {
  return "CAL";
}

=item B<array>

Returns a summary of the object in an 11 element array. All elements
are undefined except the first. This contains "CAL".

=cut

sub array {
  my $self = shift;
  return ($self->type,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef);
}

=item B<status>

Return a status string describing the current coordinates. For calibration
objects this is very simple.

=cut

sub status {
  my $self = shift;
  my $string;

  $string .= "Coordinate type:CAL\n";
  if (defined $self->telescope) {
    $string .= "Telescope:      " . $self->telescope->fullname . "\n";
    if ($self->isObservable) {
      $string .= "The target is currently observable\n";
    } else {
      $string .= "The target is not currently observable\n";
    }
  }

  return $string;

}

=item B<isObservable>



( run in 2.551 seconds using v1.01-cache-2.11-cpan-302cb4679cc )