The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Astro::Telescope - class for obtaining telescope information

SYNOPSIS

  use Astro::Telescope;

  $tel = new Astro::Telescope( 'UKIRT' );

  $latitude = $tel->lat;
  $longitude = $tel->long;
  $altitude = $tel->alt;

  %limits = $tel->limits;

  @telescopes = Astro::Telescope->telNames();

DESCRIPTION

A class for handling properties of individual telescopes such as longitude, latitude, height and observational limits.

METHODS

Constructor

new

Create a new telescope object. Takes the telescope abbreviation as the single argument.

  $tel = new Astro::Telescope( 'VLA' );

An argument must be supplied. Returns undef if the telescope is not recognized.

If more than one argument is supplied the assumption is that the user is supplying telescope details. In that case, "Name" and "Long" must be supplied, and either the geodetic latitude and altitude ("Lat" and "Alt" -- but if "Alt" is not supplied it will default to zero and this class will issue a warning), the geocentric latitude and distance ("GeocLat" and "GeocDist"), or the parallax coefficients ("Parallax") must be supplied. Latitudes and longitudes must be given in radians, altitude and distance in metres, and the parallax constants in units of Earth radii.

  $tel = new Astro::Telescope('telescope');
  $tel = new Astro::Telescope(Name => 'JCMT', Long => $long, Lat => $lat );

Accessor Methods

name

Returns the abbreviated name of the telescope. This is the same as that given to the constructor (although it will be upper-cased).

The object can be reconfigured to a new telescope by supplying a new abbreviation to this method.

  $tel->name('JCMT');

The object will not change state if the name is not known.

fullname

Returns the full name of the telescope. For example, if the abbreviated name is "JCMT" this will return "JCMT 15 metre".

obscode

Returns or sets the IAU observatory code as listed at http://cfa-www.harvard.edu/iau/lists/ObsCodes.html. The object will not change state if the observatory code is not known.

long

Longitude of the telescope (east +ve). By default this is in radians.

An argument of "d" or "s" can be supplied to retrieve the value in decimal degrees or sexagesimal string format respectively.

 $string = $tel->long("s");
lat

Geodetic latitude of the telescope. By default this is in radians.

An argument of "d" or "s" can be supplied to retrieve the value in decimal degrees or sexagesimal string format respectively.

  $deg = $tel->lat("d");
alt

Altitude of the telescope in metres above mean sea level.

parallax

Return the parallax constants, rho*sin(phi') and rho*cos(phi'), where rho is the geocentric radius in Earth radii and phi' is the geocentric latitude. Returned as a hash where 'Par_C' is rho*sin(phi') and 'Par_S' is rho*cos(phi').

  @parallax = $tel->parallax;
geoc_lat

Return the geocentric latitude. By default this is in radians.

An argument of "d" or "s" can be supplied to retrieve the value in decimal degrees or sexagesimal string format respectively.

  $deg = $tel->geoc_lat("d");
geoc_dist

Return the distance from the centre of the Earth. By default this is in metres.

  $geoc_dist = $tel->geoc_dist;
obsgeo

Return the cartesian coordinates of the observatory. These are the form required for specifying coordinates in the FITS OBSGEO-X, OBSGEO-Y and OBSGEO-Z header items.

  ($x, $y, $z) = $tel->obsgeo;

Values are returned in metres.

limits

Return the telescope limits.

  %limits = $tel->limits;

The limits are returned as a hash with the following keys:

type

Specifies the way in which the limits are specified. Effectively the telescope mount. Values of "AZEL" (for altaz telescopes) and "HADEC" (for equatorial telescopes) are currently supported.

el

Elevation limit of the telescope. Value is a hash with keys max and min. Units are in radians. Only used if type is AZEL.

ha

Hour angle limit of the telescope. Value is a hash with keys max and min. Units are in radians. Only used if type is HADEC.

dec

Declination limit of the telescope. Value is a hash with keys max and min. Units are in radians. Only used if type is HADEC.

Only some telescopes have limits defined (please send patches with new limits if you know them). If limits are not available for this telescope limits corresponding to "above the horizon" are returned.

If limits have been explicitly associated with this object using the setlimits method then those limits will be returned.

setlimits

This method allows limits for this telescope object to be set explicitly. The contents of the limits hash must be those described by the limits method and will be returned by the limits method). Limits set in this way will override built-in limits.

  $tel->setlimits( %limits );

Limits will be cleared if the object is reconfigured (eg by setting the obscode).

Class Methods

telNames

Obtain a sorted list of all supported telescope names.

  @names = Astro::Telescope->telNames;

Currently only returns the PAL names, and only if Astro::PAL is available. If it is not available, return an empty list.

REQUIREMENTS

The list of telescope properties is currently obtained from those provided by PAL (Astro::PAL) and also from the Minor Planet Center (http://www.cfa.harvard.edu/iau/lists/ObsCodes.html).

AUTHORS

Tim Jenness <t.jenness@jach.hawaii.edu>, Brad Cavanagh <b.cavanagh@jach.hawaii.edu>

COPYRIGHT

Copyright (C) 2007, 2008, 2010, 2012 Science and Technology Facilities Council. Copyright (C) 1998-2005 Particle Physics and Astronomy Research Council. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.