NAME
Astro::Coords::Equatorial - Manipulate equatorial coordinates
SYNOPSIS
$c = new Astro::Coords::Equatorial( ra => '05:22:56',
dec => '-26:20:40.4',
type => 'B1950'
units=> 'sexagesimal');
DESCRIPTION
This class is used by Astro::Coords
for handling coordinates specified in a fixed astronomical coordinate frame.
METHODS
Constructor
- new
-
Instantiate a new object using the supplied options.
$c = new Astro::Coords::Equatorial( ra => dec => long => lat => type => units => );
ra
anddec
are used for HMSDeg systems (eg type=J2000). Long and Lat are used for degdeg systems (eg where type=galactic).type
can be "galactic", "j2000", "b1950", and "supergalactic". Theunits
can be specified as "sexagesimal" (when using colon or space-separated strings), "degrees" or "radians". The default is determined from context.All coordinates are converted to FK5 J2000.
Currently the FK4 1950 to FK5 J2000 assumes no parallax or proper motion correction.
Usually called via
Astro::Coords
.
Accessor Methods
- ra
-
Retrieve the Right Ascension (FK5 J2000). Default is to return it in radians.
The optional hash arguments can have the following keys:
- format
-
The required formatting for the declination:
radians - (the default) degrees - decimal sexagesimal - a string (hours/minutes/seconds) hours - decimal hours array - a ref to an array containing hour/min/sec
- dec
-
Retrieve the declination (FK5 J2000). Default is to return it in radians.
$dec = $c->dec( format => "sexagesimal" );
The optional hash arguments can have the following keys:
- format
-
The required formatting for the declination:
radians - (the default) degrees - decimal sexagesimal - a string (degrees/minutes/seconds) array - a ref to an array containing sign/degrees/min/sec
General Methods
- array
-
Return back 11 element array with first 3 elements being the coordinate type (RADEC) and the ra/dec coordinates in J2000 (radians).
This method returns a standardised set of elements across all types of coordinates.
- glong
-
Return Galactic longitude. Arguments are similar to those specified for "dec".
$glong = $c->glong( format => "s" );
- glat
-
Return Galactic latitude. Arguments are similar to those specified for "dec".
$glat = $c->glat( format => "s" );
- sglong
-
Return SuperGalactic longitude. Arguments are similar to those specified for "dec".
$sglong = $c->sglong( format => "s" );
- sglat
-
Return SuperGalactic latitude. Arguments are similar to those specified for "dec".
$glat = $c->sglat( format => "s" );
- type
-
Returns the generic type associated with the coordinate system. For this class the answer is always "RADEC".
This is used to aid construction of summary tables when using mixed coordinates.
- stringify
-
A string representation of the object.
Returns RA and Dec (J2000) in string format.
Private Methods
- _glonglat
-
Calculate Galactic longitude and latitude.
($long, $lat) = $c->_glonglat;
- _sglonglat
-
Calculate Super Galactic longitude and latitude.
($slong, $slat) = $c->_sglonglat;
- _apparent
-
Return the apparent RA and Dec (in radians) for the current coordinates and time.
- _cvt_torad
-
Convert from the supplied units to radians. The following units are supported:
sexagesimal - A string of format either dd:mm:ss or "dd mm ss" degrees - decimal degrees radians - radians hours - decimal hours
If units are not supplied (undef) default is to assume "sexagesimal" if the supplied string contains spaces or colons, "degrees" if the supplied number is greater than 2*PI (6.28), and "radians" for all other values.
$radians = Astro::Coords::Equatorial->_cvt_torad("sexagesimal", "5:22:63")
An optional final argument can be used to indicate that the supplied string is in hours rather than degrees. This is only used when units is set to "sexagesimal".
Returns undef on error.
NOTES
Usually called via Astro::Coords
.
REQUIREMENTS
Astro::SLA
is used for all internal astrometric calculations.
AUTHOR
Tim Jenness <t.jenness@jach.hawaii.edu>
COPYRIGHT
Copyright (C) 2001 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.