Tim Jenness > Astro-PAL > Astro::PAL

Download:
Astro-PAL-1.05.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 1.05   Source  

NAME ^

Astro::PAL - Perl interface to Starlink PAL positional astronomy library

SYNOPSIS ^

  use PAL;
  use PAL qw(:constants :pal);

  ($ra2000, $dec2000) = palFk45z($ra, $dec, 1950.0);
  ($mjd, $status) = palCldj($yy, $mn, $dd);

  ($lst, $mjd) = lstnow($long);
  ($lst, $mjd) = ut2lst_tel($yy,$mn,$dd,$hh,$mm,$ss,'JCMT');

DESCRIPTION ^

This modules provides a Perl interface to either the Starlink PAL positional astronomy library.

Return values are returned on the stack rather than being modified in place.

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.

Routines ^

There are 3 distinct groups of routines that can be imported into the namespace via tags:

pal - import just the PAL routines
constants - import the PAL constants
funcs - import the extra routines

Each group will be discussed in turn.

PAL

The PAL routines directly match the C API with the caveat that returned values are returned on the perl argument stack rather than being modified directly in the call arguments. Arguments are never modified. This differs from the Astro::SLA wrapper around the SLALIB library.

For example,

  ($xi, $eta, $j) = palDst2p( $ra, $dec, $raz, $decz );
  @pv = palDmoon( $date );
  ($nstrt, $fd, $j) = palDafin( $time, $nstrt );

If a routine returns an array as well as a status the status value is returned first:

 ($j, @iymsf) = palDjcal( $ndp, $djm );

If a routine returns multiple arrays they are returned as references:

 ($dvb, $dpb, $dvh, $dph) = palEvp( $date, $deqx );
 @dvbarr = @$dvb;

Routines that take vectors or matrices should be given references to arrays:

 @rmatn = palNut( $djtt );
 @mposr = palDmxv( \@rmatn, \@mpos );

palObs is special in that it returns an empty list if the return status is bad. Additionally, palObs is called with a single argument and the behaviour depends on whether the argument looks like an integer or a string.

 ($ident, $name, $w, $p, $h) = palObs( 27 );
 ($ident, $name, $w, $p, $h) = palObs( "JCMT" );

See the PAL or SLALIB documentation for details of the functions themselves.

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
D15B2P - 15/(2*pi): hours to degrees * radians to turns

Extra functions

These are exportable using the 'funcs' tag or used directly through the Astro::PAL namespace.

They directly match the Astro::SLA equivalents.

lstnow_tel

Return current LST (in radians) and MJD for a given telescope. The telescope identifiers should match those present in palObs. 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 (UTC) 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 >tjenness@cpan.org<

REQUIREMENTS ^

The PAL library is available from Starlink.

COPYRIGHT ^

Copyright (C) 2012 Tim Jenness and the Science and Technology Facilities Council.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place,Suite 330, Boston, MA 02111-1307, USA

syntax highlighting: