The following table lists PAL/SLA functions that have direct replacements in SOFA. Whilst these routines are implemented in the PAL library using SOFA new code should probably call SOFA directly.
SLA/PAL SOFA
palCldj iauCal2jd
palDbear iauPas
palDaf2r iauAf2a
palDav2m iauRv2m
palDcc2s iauC2s
palDcs2c iauS2c
palDd2tf iauD2tf
palDimxv iauTrxp
palDm2av iauRm2v
palDjcl iauJd2cal
palDmxm iauRxr
palDmxv iauRxp
palDpav iauPap
palDr2af iauA2af
palDr2tf iauA2tf
palDranrm iauAnp
palDsep iauSeps
palDsepv iauSepp
palDtf2d iauTf2d
palDtf2r iauTf2a
palDvdv iauPdp
palDvn iauPn
palDvxv iauPxp
palEpb iauEpb
palEpb2d iauEpb2d
palEpj iauEpj
palEpj2d iauEpj2jd
palEqeqx iauEe06a
palFk5hz iauFk5hz also calls iauEpj2jd
palGmst iauGmst06
palGmsta iauGmst06
palHfk5z iauHfk5z also calls iauEpj2jd
palRefcoq iauRefco
palCldj
Gregorian Calendar to Modified Julian Date
Gregorian calendar to Modified Julian Date.
palCldj( int iy, int im, int id, double djm, int
j );
iy = int (Given)
Year in Gregorian calendar
im = int (Given)
Month in Gregorian calendar
id = int (Given)
Day in Gregorian calendar
djm = double
(Returned)
Modified Julian Date (JD-2400000.5) for 0 hrs
j = int
(Returned)
status: 0 = OK, 1 = bad year (MJD not computed),
2 = bad month (MJD not computed), 3 = bad day (MJD computed).
Uses eraCal2jd(). See SOFA/ERFA documentation for details.
palDbear
Bearing (position angle) of one point on a sphere relative to another
Bearing (position angle) of one point in a sphere relative to another.
pa = palDbear( double a1, double b1, double a2, double b2 );
a1 = double (Given)
Longitude of point A (e.g. RA) in radians.
a2 = double (Given)
Latitude of point A (e.g. Dec) in radians.
b1 = double (Given)
Longitude of point B in radians.
b2 = double (Given)
Latitude of point B in radians.
The result is the bearing (position angle), in radians, of point
A2,B2 as seen from point A1,B1. It is in the range
/- pi. If
A2,B2 is due east of A1,B1 the bearing is
pi/2. Zero is returned
if the two points are coincident.
Uses eraPas(). See SOFA/ERFA documentation for details.
palDaf2r
Convert degrees, arcminutes, arcseconds to radians
Convert degrees, arcminutes, arcseconds to radians.
palDaf2r( int ideg, int iamin, double asec, double
rad, int
j );
ideg = int (Given)
Degrees.
iamin = int (Given)
Arcminutes.
iasec = double (Given)
Arcseconds.
rad = double
(Returned)
Angle in radians.
j = int
(Returned)
Status: 0 = OK, 1 = "ideg" out of range 0-359,
2 = "iamin" outside of range 0-59,
2 = "asec" outside range 0-59.99999
Uses eraAf2a(). See SOFA/ERFA documentation for details.
palDav2m
Form the rotation matrix corresponding to a given axial vector
A rotation matrix describes a rotation about some arbitrary axis,
called the Euler axis. The "axial vector" supplied to this routine
has the same direction as the Euler axis, and its magnitude is the
amount of rotation in radians.
palDav2m( double axvec[3], double rmat[3][3] );
axvec = double [3] (Given)
Axial vector (radians)
rmat = double [3][3] (Returned)
Rotation matrix.
Uses eraRv2m(). See SOFA/ERFA documentation for details.
palDcc2s
Cartesian to spherical coordinates
The spherical coordinates are longitude (
ve anticlockwise looking
from the
ve latitude pole) and latitude. The Cartesian coordinates
are right handed, with the x axis at zero longitude and latitude, and
the z axis at the
ve latitude pole.
palDcc2s( double v[3], double
a, double
b );
v = double [3] (Given)
x, y, z vector.
a = double
(Returned)
Spherical coordinate (radians)
b = double
(Returned)
Spherical coordinate (radians)
Uses eraC2s(). See SOFA/ERFA documentation for details.
palDcs2c
Spherical coordinates to direction cosines
The spherical coordinates are longitude (
ve anticlockwise looking
from the
ve latitude pole) and latitude. The Cartesian coordinates
are right handed, with the x axis at zero longitude and latitude, and
the z axis at the
ve latitude pole.
palDcs2c( double a, double b, double v[3] );
a = double (Given)
Spherical coordinate in radians (ra, long etc).
b = double (Given)
Spherical coordinate in radians (dec, lat etc).
v = double [3] (Returned)
x, y, z vector
Uses eraS2c(). See SOFA/ERFA documentation for details.
palDd2tf
Convert an interval in days into hours, minutes, seconds
Convert and interval in days into hours, minutes, seconds.
palDd2tf( int ndp, double days, char
sign, int ihmsf[4] );
ndp = int (Given)
Number of decimal places of seconds
days = double (Given)
Interval in days
sign = char
(Returned)
'
' or '-' (single character, not string)
ihmsf = int [4] (Returned)
Hours, minutes, seconds, fraction
Uses eraD2tf(). See SOFA/ERFA documentation for details.
palDimxv
Perform the 3-D backward unitary transformation
Perform the 3-D backward unitary transformation.
palDimxv( double dm[3][3], double va[3], double vb[3] );
dm = double [3][3] (Given)
Matrix
va = double [3] (Given)
vector
vb = double [3] (Returned)
Result vector
Uses eraTrxp(). See SOFA/ERFA documentation for details.
palDm2av
From a rotation matrix, determine the corresponding axial vector
A rotation matrix describes a rotation about some arbitrary axis,
called the Euler axis. The "axial vector" returned by this routine
has the same direction as the Euler axis, and its magnitude is the
amount of rotation in radians. (The magnitude and direction can be
separated by means of the routine palDvn.)
palDm2av( double rmat[3][3], double axvec[3] );
rmat = double [3][3] (Given)
Rotation matrix
axvec = double [3] (Returned)
Axial vector (radians)
Uses eraRm2v(). See SOFA/ERFA documentation for details.
palDjcl
Modified Julian Date to Gregorian year, month, day and fraction of day
Modified Julian Date to Gregorian year, month, day and fraction of day.
palDjcl( double djm, int
iy, int
im, int
id, double
fd, int
j );
djm = double (Given)
modified Julian Date (JD-2400000.5)
iy = int
(Returned)
year
im = int
(Returned)
month
id = int
(Returned)
day
fd = double
(Returned)
Fraction of day.
Uses eraJd2cal(). See SOFA/ERFA documentation for details.
palDmxm
Product of two 3x3 matrices
Product of two 3x3 matrices.
palDmxm( double a[3][3], double b[3][3], double c[3][3] );
a = double [3][3] (Given)
Matrix
b = double [3][3] (Given)
Matrix
c = double [3][3] (Returned)
Matrix result
Uses eraRxr(). See SOFA/ERFA documentation for details.
palDmxv
Performs the 3-D forward unitary transformation
Performs the 3-D forward unitary transformation.
palDmxv( double dm[3][3], double va[3], double vb[3] );
dm = double [3][3] (Given)
matrix
va = double [3] (Given)
vector
dp = double [3] (Returned)
result vector
Uses eraRxp(). See SOFA/ERFA documentation for details.
palDpav
Position angle of one celestial direction with respect to another
Position angle of one celestial direction with respect to another.
pa = palDpav( double v1[3], double v2[3] );
v1 = double [3] (Given)
direction cosines of one point.
v2 = double [3] (Given)
direction cosines of the other point.
The result is the bearing (position angle), in radians, of point
V2 with respect to point V1. It is in the range
/- pi. The
sense is such that if V2 is a small distance east of V1, the
bearing is about
pi/2. Zero is returned if the two points
are coincident.
The coordinate frames correspond to RA,Dec, Long,Lat etc.
Uses eraPap(). See SOFA/ERFA documentation for details.
palDr2af
Convert an angle in radians to degrees, arcminutes, arcseconds
Convert an angle in radians to degrees, arcminutes, arcseconds.
palDr2af( int ndp, double angle, char sign, int idmsf[4] );
ndp = int (Given)
number of decimal places of arcseconds
angle = double (Given)
angle in radians
sign = char
(Returned)
'
' or '-' (single character)
idmsf = int [4] (Returned)
Degrees, arcminutes, arcseconds, fraction
Uses eraA2af(). See SOFA/ERFA documentation for details.
palDr2tf
Convert an angle in radians to hours, minutes, seconds
Convert an angle in radians to hours, minutes, seconds.
palDr2tf ( int ndp, double angle, char
sign, int ihmsf[4] );
ndp = int (Given)
number of decimal places of arcseconds
angle = double (Given)
angle in radians
sign = char
(Returned)
'
' or '-' (single character)
idmsf = int [4] (Returned)
Hours, minutes, seconds, fraction
Uses eraA2tf(). See SOFA/ERFA documentation for details.
palDranrm
Normalize angle into range 0-2 pi
Normalize angle into range 0-2 pi.
norm = palDranrm( double angle );
angle = double (Given)
angle in radians
Angle expressed in the range 0-2 pi
Uses eraAnp(). See SOFA/ERFA documentation for details.
palDsep
Angle between two points on a sphere
Angle between two points on a sphere.
ang = palDsep( double a1, double b1, double a2, double b2 );
a1 = double (Given)
Spherical coordinate of one point (radians)
b1 = double (Given)
Spherical coordinate of one point (radians)
a2 = double (Given)
Spherical coordinate of other point (radians)
b2 = double (Given)
Spherical coordinate of other point (radians)
Angle, in radians, between the two points. Always positive.
The spherical coordinates are [RA,Dec], [Long,Lat] etc, in radians.
Uses eraSeps(). See SOFA/ERFA documentation for details.
palDsepv
Angle between two vectors
Angle between two vectors.
ang = palDsepv( double v1[3], double v2[3] );
v1 = double [3] (Given)
First vector
v2 = double [3] (Given)
Second vector
Angle, in radians, between the two points. Always positive.
Uses eraSepp(). See SOFA/ERFA documentation for details.
palDtf2d
Convert hours, minutes, seconds to days
Convert hours, minutes, seconds to days.
palDtf2d( int ihour, int imin, double sec, double days, int
j );
ihour = int (Given)
Hours
imin = int (Given)
Minutes
sec = double (Given)
Seconds
days = double
(Returned)
Interval in days
j = int
(Returned)
status: 0 = ok, 1 = ihour outside range 0-23,
2 = imin outside range 0-59, 3 = sec outside range 0-59.999...
Uses eraTf2d(). See SOFA/ERFA documentation for details.
palDtf2r
Convert hours, minutes, seconds to radians
Convert hours, minutes, seconds to radians.
palDtf2r( int ihour, int imin, double sec, double
rad, int
j );
ihour = int (Given)
Hours
imin = int (Given)
Minutes
sec = double (Given)
Seconds
days = double
(Returned)
Angle in radians
j = int
(Returned)
status: 0 = ok, 1 = ihour outside range 0-23,
2 = imin outside range 0-59, 3 = sec outside range 0-59.999...
Uses eraTf2a(). See SOFA/ERFA documentation for details.
palDvdv
Scalar product of two 3-vectors
Scalar product of two 3-vectors.
prod = palDvdv ( double va[3], double vb[3] );
va = double [3] (Given)
First vector
vb = double [3] (Given)
Second vector
Scalar product va.vb
Uses eraPdp(). See SOFA/ERFA documentation for details.
palDvn
Normalizes a 3-vector also giving the modulus
Normalizes a 3-vector also giving the modulus.
palDvn( double v[3], double uv[3], double
vm );
v = double [3] (Given)
vector
uv = double [3] (Returned)
unit vector in direction of "v"
vm = double
(Returned)
modulus of "v"
Uses eraPn(). See SOFA/ERFA documentation for details.
palDvxv
Vector product of two 3-vectors
Vector product of two 3-vectors.
palDvxv( double va[3], double vb[3], double vc[3] );
va = double [3] (Given)
First vector
vb = double [3] (Given)
Second vector
vc = double [3] (Returned)
Result vector
Uses eraPxp(). See SOFA/ERFA documentation for details.
palEpb
Conversion of modified Julian Data to Besselian Epoch
Conversion of modified Julian Data to Besselian Epoch.
epb = palEpb ( double date );
date = double (Given)
Modified Julian Date (JD - 2400000.5)
Besselian epoch.
Uses eraEpb(). See SOFA/ERFA documentation for details.
palEpb2d
Conversion of Besselian Epoch to Modified Julian Date
Conversion of Besselian Epoch to Modified Julian Date.
mjd = palEpb2d ( double epb );
epb = double (Given)
Besselian Epoch
Modified Julian Date (JD - 2400000.5)
Uses eraEpb2jd(). See SOFA/ERFA documentation for details.
palEpj
Conversion of Modified Julian Date to Julian Epoch
Conversion of Modified Julian Date to Julian Epoch.
epj = palEpj ( double date );
date = double (Given)
Modified Julian Date (JD - 2400000.5)
The Julian Epoch.
Uses eraEpj(). See SOFA/ERFA documentation for details.
palEpj2d
Conversion of Julian Epoch to Modified Julian Date
Conversion of Julian Epoch to Modified Julian Date.
mjd = palEpj2d ( double epj );
epj = double (Given)
Julian Epoch.
Modified Julian Date (JD - 2400000.5)
Uses eraEpj2d(). See SOFA/ERFA documentation for details.
palEqeqx
Equation of the equinoxes (IAU 2000/2006)
Equation of the equinoxes (IAU 2000/2006).
palEqeqx( double date );
date = double (Given)
TT as Modified Julian Date (JD-400000.5)
Uses eraEe06a(). See SOFA/ERFA documentation for details.
palFk5hz
Transform an FK5 (J2000) star position into the frame of the
Hipparcos catalogue
Transform an FK5 (J2000) star position into the frame of the
Hipparcos catalogue.
palFk5hz ( double r5, double d5, double epoch,
double
rh, double
dh );
r5 = double (Given)
FK5 RA (radians), equinox J2000, epoch "epoch"
d5 = double (Given)
FK5 dec (radians), equinox J2000, epoch "epoch"
epoch = double (Given)
Julian epoch
rh = double
(Returned)
RA (radians)
dh = double
(Returned)
Dec (radians)
Assumes zero Hipparcos proper motion.
Uses eraEpj2jd() and eraFk5hz. See SOFA/ERFA documentation for details. palGmst Greenwich mean sidereal time (consistent with IAU 2006 precession) Greenwich mean sidereal time (consistent with IAU 2006 precession). mst = palGmst ( double ut1 ); ut1 = double (Given) Universal time (UT1) expressed as modified Julian Date (JD-2400000.5) Greenwich mean sidereal time Uses eraGmst06(). See SOFA/ERFA documentation for details. palGmsta Greenwich mean sidereal time (consistent with IAU 2006 precession) Greenwich mean sidereal time (consistent with IAU 2006 precession). mst = palGmsta ( double date, double ut1 ); date = double (Given) UT1 date (MJD: integer part of JD-2400000.5) ut1 = double (Given) UT1 time (fraction of a day) Greenwich mean sidereal time (in range 0 to 2 pi) For best accuracy use eraGmst06() directly.
Uses eraGmst06(). See SOFA/ERFA documentation for details.
palHfk5z
Hipparcos star position to FK5 J2000
Transform a Hipparcos star position into FK5 J2000, assuming
zero Hipparcos proper motion.
palHfk5z( double rh, double dh, double epoch,
double r5, double
d5, double
dr5, double
dd5 );
rh = double (Given)
Hipparcos RA (radians)
dh = double (Given)
Hipparcos Dec (radians)
epoch = double (Given)
Julian epoch (TDB)
r5 = double
(Returned)
RA (radians, FK5, equinox J2000, epoch "epoch")
d5 = double
(Returned)
Dec (radians, FK5, equinox J2000, epoch "epoch")
Uses eraEpj2jd and eraHfk5z(). See SOFA/ERFA documentation for details.
palRefcoq
Determine the constants A and B in the atmospheric refraction model
Determine the constants A and B in the atmospheric refraction
model dZ = A tan Z
B tan
3 Z. This is a fast alternative
to the palRefco routine.
Z is the "observed" zenith distance (i.e. affected by refraction)
and dZ is what to add to Z to give the "topocentric" (i.e. in vacuo)
zenith distance.
palRefcoq( double tdk, double pmb, double rh, double wl,
double refa, double
refb );
tdk = double (Given)
Ambient temperature at the observer (K)
pmb = double (Given)
Pressure at the observer (millibar)
rh = double (Given)
Relative humidity at the observer (range 0-1)
wl = double (Given)
Effective wavelength of the source (micrometre).
Radio refraction is chosen by specifying wl
100 micrometres.
refa = double
(Returned)
tan Z coefficient (radian)
refb = double
(Returned)
tan
3 Z coefficient (radian)
Uses eraRefco(). See SOFA/ERFA documentation for details.
Note that the SOFA/ERFA routine uses different order of of arguments and uses deg C rather than K.