Astro::Telescope(3pm)
π Astro::Telescope(3pm) β the perl one, from User Contributed Perl Documentation
okay bestie, settle in, because this page is literally the entire personality of a telescope in one Perl class π (and yes, Astro::Telescope is the actual module name, 3pm just means it's a Perl manpage, iykyk)
β¨ NAME β¨
Astro::Telescope β a 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();
like, that's it. that's the whole vibe. πΈ
π DESCRIPTION π
So this is a class that handles the properties of individual telescopes β the stuff like longitude, latitude, height and observational limits. no cap, that's the whole job. π«Ά
π METHODS π
π Constructor
newβ creates a shiny new telescope object β¨. It takes the telescope abbreviation as the single argument.
$tel = new Astro::Telescope( 'VLA' );
An argument must be supplied β it's not optional, bestie. And it returns undef if the telescope is not recognized. π
Now, if you supply more than one argument, the assumption is that you, the user, are supplying the telescope details yourself. In that case, Name and Long must be supplied, plus one of these three options:
- the geodetic latitude and altitude (
LatandAltβ but ngl, ifAltis not supplied it defaults to zero and this class will issue a warning π) - the geocentric latitude and distance (
GeocLatandGeocDist) - the parallax coefficients (
Parallax)
The units, and this is important so listen up: 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. It's the same as whatever you gave the constructor (although it will be upper-cased, because we're shouting it π£).
And plot twist: the object can be reconfigured to a whole 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. so don't try it. π«
fullnameβ returns the full name of the telescope. For example, if the abbreviated name isJCMTthis will returnJCMT 15 metre. iconic. β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, and yes that means positive east π ). By default this is in radians.
You can supply an argument of d or s 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β returns the parallax constants,rho*sin(phi')andrho*cos(phi'), whererhois the geocentric radius in Earth radii andphi'is the geocentric latitude. Returned as a hash where'Par_C'isrho*sin(phi')and'Par_S'isrho*cos(phi'). yes, the C/S order is the opposite of how they're listed, and that's just how it is, don't @ me π
@parallax = $tel->parallax;
geoc_latβ returns 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β returns the distance from the centre of the Earth. By default this is in metres. π§ββοΈ
$geoc_dist = $tel->geoc_dist;
obsgeoβ returns the cartesian coordinates of the observatory. These are exactly the form required for specifying coordinates in the FITSOBSGEO-X,OBSGEO-YandOBSGEO-Zheader items. π₯
($x, $y, $z) = $tel->obsgeo;
Values are returned in metres.
limitsβ returns the telescope limits. π§
%limits = $tel->limits;
The limits come back as a hash with these keys:
typeβ specifies the way in which the limits are specified. Effectively the telescope mount. Values ofAZEL(for altaz telescopes) andHADEC(for equatorial telescopes) are currently supported.elβ elevation limit of the telescope. Value is a hash with keysmaxandmin. Units are in radians. Only used iftypeisAZEL.haβ hour angle limit of the telescope. Value is a hash with keysmaxandmin. Units are in radians. Only used iftypeisHADEC.decβ declination limit of the telescope. Value is a hash with keysmaxandmin. Units are in radians. Only used iftypeisHADEC.
Only some telescopes have limits defined β and, direct quote energy, 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.
But wait, there's more: if limits have been explicitly associated with this object using the setlimits method, then those limits will be returned. main character limits only. π
setlimitsβ this method lets you set limits for this telescope object explicitly. The contents of the limits hash must be those described by thelimitsmethod (and they will then be returned by thelimitsmethod). Limits set this way override the built-in limits. π
$tel->setlimits( %limits );
β οΈ Limits will be cleared if the object is reconfigured (e.g. by setting the obscode). so like, set them last, bestie π
π Class Methods
telNamesβ obtain a sorted list of all supported telescope names. π
@names = Astro::Telescope->telNames;
Currently it only returns the PAL names, and only if Astro::PAL is available. If it is not available, you get an empty list back. that's it, no drama. π«Ά
π 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.
and that's the whole page, bestie β¨ β brought to you by perl v5.42.2, dated 2026-02-15, and archived forever under Astro::Telescope(3pm). go point a telescope at something pretty for me ππ
π¦ where this page comes from
- alpine 3.24: perl-astro-telescope-doc 0.71-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms