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::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:

        slaFk45z slaDtf2r slaDaf2r slaDr2af slaDr2tf
        slaPreces slaEqeqx slaCldj slaDe2h slaDh2e
        slaDat slaGmst slaDjcl slaDd2tf slaAddet
        slaAfin slaAirmas slaAmp slaAmpqk slaAop
        slaAoppa slaAoppat slaAopqk slaAtmdsp slaAv2m
        slaCaldj slaCalyd slaClyd slaDafin slaDav2m
        slaDbear slaDbjin slaDc62s slaDcc2s slaDcmpf
        slaDcs2c slaDeuler slaDfltin slaDimxv slaDjcal
        slaDm2av slaDmoon slaDmxm slaDmxv slaDpav
        slaDrange slaDranrm slaDs2c6 slaDs2tp slaDsep
        slaDtf2d slaDtp2s slaDtp2v slaDtps2c slaDtpv2c
        slaDtt slaDv2tp slaDvdv slaDvn slaDvn slaEarth
        slaEcmat slaEcor slaEg50 slaEpb slaEpb2d
        slaEpco slaEpj slaEpj2d slaEqecl slaEqgal
        slaEtrms slaEvp slaFk425 sla524 slaFk54z
        slaGaleq slaGalsup slaGe50 slaGeoc slaGmsta
        slaImxv slaInvf slaKbj slaMap
        slaMappa slaMapqk slaMapqkz slaMoon slaNut
        slaNutc slaOap slaOapqk slaObs slaPa slaPcd
        slaPda2h slaPdq2h slaPlanet slaPlanel slaPlante
        slaPm slaPolmo slaPrebn slaPrec
        slaPrecl slaPrenut slaPvobs slaRcc slaRdplan
        slaRefco slaRefcoq slaRefv slaRefz slaRverot
        slaRvgalc slaRvlg slaRvlsrd slaRvlsrk slaS2tp
        slaSubet slaSupgal slaUnpcd 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
15/(2*pi) - hours to degrees * radians to turns

Extra functions (using the 'funcs' tag)

($lst, $mjd) = lstnow_tel($tel);

Return current LST (in radians) and MJD for a given telescope. The telescope identifiers should match those present in slaObs.

($lst, $mjd) = lstnow($long);

Return current LST (in radians) and MJD (days) Longitude should be negative if degrees west and in radians.

($lst, $mjd) = ut2lst(yy, mn, dd, hh, mm, ss, long)

Given the UT time, calculate the Modified Julian date and the local sidereal time (radians) for the specified longitude.

Longitude should be negative if degrees west and in radians.

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 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 copyrighted by Patrick Wallace (ptw@star.rl.ac.uk). Please contact him if you would like a copy of the library.