NAME
Astro::SLA - perl interface to SLAlib positional astronomy library
SYNOPSIS
use SLA;
use SLA qw(:constants :sla);
slaFk45z($ra, $dec, 1950.0, $ra2000, $dec2000);
slaCldj($yy, $mn, $dd, $mjd, $status);
($lst, $mjd) = lstnow($long);
($lst, $mjd) = ut2lst_tel($yy,$mn,$dd,$hh,$mm,$ss,'JCMT');
DESCRIPTION
This modules provides a perl interface to the C version of the SLALIB astrometry library written by Pat Wallace.
In general the single precision routines have not been implemented since perl can work in double precision.
The SLALIB constants (as provided in slamac.h) are available.
In addition small utility subroutines are provided that do useful tasks (from the author's point of view) - specifically routines for calculating the Local Sidereal Time. It may be that this part of the module should be moved into an accompanying module -- Astro::SLA::Extras.
Routines
There are 3 distinct groups of routines that can be imported into the namespace via tags:
- sla - import just the SLALIB routines
- constants - import the SLALIB constants
- funcs - import the extra routines
Each group will be discussed in turn.
sla
All the double precision SLA routines are implemented except for slaPxy, slaDmat, slaSvd, slaSvdcov, slaSvdsol (I may do these some other time -- although they should be done in PDL
).
The implemented routines are:
sla524 slaAddet slaAfin slaAirmas slaAmp slaAmpqk slaAop
slaAoppa slaAoppat slaAopqk slaAtmdsp slaAv2m slaBear
slaCaf2r slaCaldj slaCalyd slaCc2s slaCc62s slaCd2tf
slaCldj slaClyd slaCr2af slaCr2tf slaCs2c6 slaDaf2r
slaDafin slaDat slaDav2m slaDbear slaDbjin slaDc62s
slaDcc2s slaDcmpf slaDcs2c slaDd2tf slaDe2h slaDeuler
slaDfltin slaDh2e slaDimxv slaDjcal slaDjcl slaDm2av
slaDmoon slaDmxm slaDmxv slaDpav slaDr2af slaDr2tf
slaDrange slaDranrm slaDs2c6 slaDs2tp slaDsep slaDtf2d
slaDtf2r slaDtp2s slaDtp2v slaDtps2c slaDtpv2c slaDtt
slaDv2tp slaDvdv slaDvn slaDvxv slaE2h slaEarth slaEcleq
slaEcmat slaEcor slaEg50 slaEpb slaEpb2d slaEpco slaEpj
slaEpj2d slaEqecl slaEqeqx slaEqgal slaEtrms slaEuler
slaEvp slaFk425 slaFk45z slaFk54z slaFloatin slaGaleq
slaGalsup slaGe50 slaGeoc slaGmst slaGmsta slaGresid slaH2e
slaImxv slaInvf slaKbj slaM2av slaMap slaMappa slaMapqk
slaMapqkz slaMoon slaMxm slaMxv slaNut slaNutc slaOap
slaOapqk slaObs slaPa slaPav slaPcd slaPda2h slaPdq2h
slaPlanel slaPlanet slaPlante slaPm slaPolmo slaPrebn
slaPrec slaPreces slaPrecl slaPrenut slaPvobs slaRandom
slaRange slaRanorm slaRcc slaRdplan slaRefco slaRefcoq
slaRefv slaRefz slaRverot slaRvgalc slaRvlg slaRvlsrd
slaRvlsrk slaS2tp slaSep slaSubet slaSupgal slaTp2s slaTp2v
slaTps2c slaTpv2c slaUnpcd slaV2tp slaVdv slaVxv slaWait
slaXy2xy slaZd
Also, slaGresid and slaRandom are not in the C library (although they are in the Fortran version). slaWait is implemented using the perl 'select(ready file descriptors)' command.
In general single precision routines are simply aliases of the double precision equivalents.
For more information on the SLALIB routines consult the Starlink documentation (Starlink User Note 67 (SUN/67)). This document is available from the Starlink web site (http://star-www.rl.ac.uk/) [SUN67 avialable from: http://star-www.rl.ac.uk/cgi-bin/htxserver/sun67.htx/sun67.html]]
Constants
Constants supplied by this module (note that they are implemented via the constant pragma):
- DPI - Pi
- D2PI - 2 * Pi
- D1B2PI - 1 / (2 * Pi)
- D4PI - 4 * Pi
- D1B4PI - 1 / (4 * Pi)
- DPISQ - Pi ** 2 (Pi squared)
- DSQRPI - sqrt(Pi)
- DPIBY2 - Pi / 2: 90 degrees in radians
- DD2R - Pi / 180: degrees to radians
- DR2D - 180/Pi: radians to degrees
- DAS2R - pi/(180*3600): arcseconds to radians
- DR2AS - 180*3600/pi: radians to arcseconds
- DH2R - pi/12: hours to radians
- DR2H - 12/pi: radians to hours
- DS2R - pi / (12*3600): seconds of time to radians
- DR2S - 12*3600/pi: radians to seconds of time
- D15B2PI - 15/(2*pi): hours to degrees * radians to turns
Extra functions (using the 'funcs' tag)
- lstnow_tel
-
Return current LST (in radians) and MJD for a given telescope. The telescope identifiers should match those present in slaObs. The supplied telescope name is converted to upper case.
($lst, $mjd) = lstnow_tel($tel);
Aborts if telescope name is unknown.
- lstnow
-
Return current LST (in radians) and MJD (days) Longitude should be negative if degrees west and in radians.
($lst, $mjd) = lstnow($long);
- ut2lst
-
Given the UT time, calculate the Modified Julian date and the local sidereal time (radians) for the specified longitude.
($lst, $mjd) = ut2lst(yy, mn, dd, hh, mm, ss, long)
Longitude should be negative if degrees west and in radians.
- ut2lst_tel
-
Given the UT time, calculate the Modified Julian date and the local sidereal time (radians) for the specified telescope.
($lst, $mjd) = ut2lst_tel(yy, mn, dd, hh, mm, ss, tel)
AUTHOR
Tim Jenness (t.jenness@jach.hawaii.edu)
REQUIREMENTS
This module has been tested with the May 1998 release of SLALIB. The C version of the library is required for this module to be built.
COPYRIGHT
This module is copyright (C) 1998,1999 Tim Jenness and PPARC. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The SLALIB library (C version) is proprietary. Please contact Patrick Wallace (ptw@tpsoft.demon.co.uk) if you would like to obtain a copy.