Astro::SLA - Perl interface to SLAlib positional astronomy library
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');
This modules provides a Perl interface to either the C or Fortran versions 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.
There are 3 distinct groups of routines that can be imported into the namespace via tags:
Each group will be discussed in turn.
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).
PDL
The implemented routines are:
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 supplied by this module (note that they are implemented via the constant pragma):
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.
Return current LST (in radians) and MJD (days) Longitude should be negative if degrees west and in radians.
($lst, $mjd) = lstnow($long);
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.
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)
Tim Jenness >t.jenness@jach.hawaii.edu<
This module has been tested with the Starlink Fortran library v2.4-8 (released September 2001) and 2.4-11 (released spring 2003) and the April 2002 and 2003 releases of the C library. If you are working with orbital elements you need a version of the library released sometime in 2002.
You must have either the C version of the library or the Starlink Fortran version of the library in order to build this module.
The Fortran version of SLALIB is currently available from Starlink under the Starlink Software Licence (effectively meaning free for non-commercial use). You can download it from Starlink (http://www.starlink.rl.ac.uk) using the Starlink Software Store (http://www.starlink.rl.ac.uk/Software/software_store.htm). Specifically: http://www.starlink.rl.ac.uk/cgi-store/storeform1?SLA Starlink have approved the release of this library using a GPL licence but the package has not yet been made available.
The SLALIB library (C version) is proprietary. Please contact Patrick Wallace (ptw@tpsoft.demon.co.uk) if you would like to obtain a copy.
This module is copyright (C) 1998-2003 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.
To install Astro::SLA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Astro::SLA
CPAN shell
perl -MCPAN -e shell install Astro::SLA
For more information on module installation, please visit the detailed CPAN module installation guide.