Skip to content
f2py and numpy wrappers of the fortran version of the astro library SLALIB
FORTRAN Python C Makefile
Find file
Failed to load latest commit information.
lib More fixes for 3.2 vs 2.x Jun 23, 2011
test Fixed import in test script. Jan 1, 2011
.gitignore Add metadata to enable source build (sdist) and debian packaging (stdeb) Aug 3, 2012
MANIFEST.in Add metadata to enable source build (sdist) and debian packaging (stdeb) Aug 3, 2012
Makefile First commit. Sep 20, 2010
README.txt Updated README Dec 7, 2010
addet.f First commit. Sep 20, 2010
afin.f First commit. Sep 20, 2010
airmas.f First commit. Sep 20, 2010
altaz.f First commit. Sep 20, 2010
amp.f First commit. Sep 20, 2010
ampqk.f First commit. Sep 20, 2010
aop.f First commit. Sep 20, 2010
aoppa.f First commit. Sep 20, 2010
aoppat.f First commit. Sep 20, 2010
aopqk.f First commit. Sep 20, 2010
atmdsp.f First commit. Sep 20, 2010
atms.f First commit. Sep 20, 2010
atmt.f First commit. Sep 20, 2010
av2m.f First commit. Sep 20, 2010
bear.f First commit. Sep 20, 2010
caf2r.f First commit. Sep 20, 2010
caldj.f First commit. Sep 20, 2010
calyd.f First commit. Sep 20, 2010
cc2s.f First commit. Sep 20, 2010
cc62s.f First commit. Sep 20, 2010
cd2tf.f First commit. Sep 20, 2010
cldj.f First commit. Sep 20, 2010
clyd.f First commit. Sep 20, 2010
combn.f First commit. Sep 20, 2010
cr2af.f First commit. Sep 20, 2010
cr2tf.f First commit. Sep 20, 2010
cs2c.f First commit. Sep 20, 2010
cs2c6.f First commit. Sep 20, 2010
ctf2d.f First commit. Sep 20, 2010
ctf2r.f First commit. Sep 20, 2010
daf2r.f First commit. Sep 20, 2010
dafin.f First commit. Sep 20, 2010
dat.f Added 2015 leap second. Feb 2, 2015
dav2m.f First commit. Sep 20, 2010
dbear.f First commit. Sep 20, 2010
dbjin.f First commit. Sep 20, 2010
dc62s.f First commit. Sep 20, 2010
dcc2s.f First commit. Sep 20, 2010
dcmpf.f First commit. Sep 20, 2010
dcs2c.f First commit. Sep 20, 2010
dd2tf.f First commit. Sep 20, 2010
de2h.f First commit. Sep 20, 2010
deuler.f First commit. Sep 20, 2010
dfltin.f First commit. Sep 20, 2010
dh2e.f First commit. Sep 20, 2010
dimxv.f First commit. Sep 20, 2010
djcal.f First commit. Sep 20, 2010
djcl.f First commit. Sep 20, 2010
dm2av.f First commit. Sep 20, 2010
dmat.f First commit. Sep 20, 2010
dmoon.f First commit. Sep 20, 2010
dmxm.f First commit. Sep 20, 2010
dmxv.f First commit. Sep 20, 2010
dpav.f First commit. Sep 20, 2010
dr2af.f First commit. Sep 20, 2010
dr2tf.f First commit. Sep 20, 2010
drange.f First commit. Sep 20, 2010
dranrm.f First commit. Sep 20, 2010
ds2c6.f First commit. Sep 20, 2010
ds2tp.f First commit. Sep 20, 2010
dsep.f First commit. Sep 20, 2010
dsepv.f First commit. Sep 20, 2010
dt.f First commit. Sep 20, 2010
dtf2d.f First commit. Sep 20, 2010
dtf2r.f First commit. Sep 20, 2010
dtp2s.f First commit. Sep 20, 2010
dtp2v.f First commit. Sep 20, 2010
dtps2c.f First commit. Sep 20, 2010
dtpv2c.f First commit. Sep 20, 2010
dtt.f First commit. Sep 20, 2010
dv2tp.f First commit. Sep 20, 2010
dvdv.f First commit. Sep 20, 2010
dvn.f First commit. Sep 20, 2010
dvxv.f First commit. Sep 20, 2010
e2h.f First commit. Sep 20, 2010
earth.f First commit. Sep 20, 2010
ecleq.f First commit. Sep 20, 2010
ecmat.f First commit. Sep 20, 2010
ecor.f First commit. Sep 20, 2010
eg50.f First commit. Sep 20, 2010
el2ue.f First commit. Sep 20, 2010
epb.f First commit. Sep 20, 2010
epb2d.f First commit. Sep 20, 2010
epco.f First commit. Sep 20, 2010
epj.f First commit. Sep 20, 2010
epj2d.f First commit. Sep 20, 2010
epv.f First commit. Sep 20, 2010
eqecl.f First commit. Sep 20, 2010
eqeqx.f First commit. Sep 20, 2010
eqgal.f First commit. Sep 20, 2010
etrms.f First commit. Sep 20, 2010
euler.f First commit. Sep 20, 2010
evp.f First commit. Sep 20, 2010
fitxy.f First commit. Sep 20, 2010
fk425.f First commit. Sep 20, 2010
fk45z.f First commit. Sep 20, 2010
fk524.f First commit. Sep 20, 2010
fk52h.f First commit. Sep 20, 2010
fk54z.f First commit. Sep 20, 2010
fk5hz.f First commit. Sep 20, 2010
flotin.f First commit. Sep 20, 2010
galeq.f First commit. Sep 20, 2010
galsup.f First commit. Sep 20, 2010
ge50.f First commit. Sep 20, 2010
geoc.f First commit. Sep 20, 2010
get_docstring.py Attempt to get things working on python3.2 Jun 22, 2011
gmst.f First commit. Sep 20, 2010
gmsta.f First commit. Sep 20, 2010
gresid.F First commit. Sep 20, 2010
h2e.f First commit. Sep 20, 2010
h2fk5.f First commit. Sep 20, 2010
hfk5z.f First commit. Sep 20, 2010
idchf.f First commit. Sep 20, 2010
idchi.f First commit. Sep 20, 2010
imxv.f First commit. Sep 20, 2010
intin.f First commit. Sep 20, 2010
invf.f First commit. Sep 20, 2010
kbj.f First commit. Sep 20, 2010
m2av.f First commit. Sep 20, 2010
map.f First commit. Sep 20, 2010
mappa.f First commit. Sep 20, 2010
mapqk.f First commit. Sep 20, 2010
mapqkz.f First commit. Sep 20, 2010
moon.f First commit. Sep 20, 2010
mxm.f First commit. Sep 20, 2010
mxv.f First commit. Sep 20, 2010
nut.f First commit. Sep 20, 2010
nutc.f First commit. Sep 20, 2010
nutc80.f First commit. Sep 20, 2010
oap.f First commit. Sep 20, 2010
oapqk.f First commit. Sep 20, 2010
obs.f First commit. Sep 20, 2010
pa.f First commit. Sep 20, 2010
pav.f First commit. Sep 20, 2010
pcd.f First commit. Sep 20, 2010
pda2h.f First commit. Sep 20, 2010
pdq2h.f First commit. Sep 20, 2010
permut.f First commit. Sep 20, 2010
pertel.f First commit. Sep 20, 2010
pertue.f First commit. Sep 20, 2010
planel.f First commit. Sep 20, 2010
planet.f First commit. Sep 20, 2010
plante.f First commit. Sep 20, 2010
plantu.f First commit. Sep 20, 2010
pm.f First commit. Sep 20, 2010
polmo.f First commit. Sep 20, 2010
prebn.f First commit. Sep 20, 2010
prec.f First commit. Sep 20, 2010
preces.f First commit. Sep 20, 2010
precl.f First commit. Sep 20, 2010
prenut.f First commit. Sep 20, 2010
pv2el.f First commit. Sep 20, 2010
pv2ue.f First commit. Sep 20, 2010
pvobs.f First commit. Sep 20, 2010
pxy.f First commit. Sep 20, 2010
random.F First commit. Sep 20, 2010
range.f First commit. Sep 20, 2010
ranorm.f First commit. Sep 20, 2010
rcc.f First commit. Sep 20, 2010
rdplan.f First commit. Sep 20, 2010
refco.f First commit. Sep 20, 2010
refcoq.f First commit. Sep 20, 2010
refro.f First commit. Sep 20, 2010
refv.f First commit. Sep 20, 2010
refz.f First commit. Sep 20, 2010
rverot.f First commit. Sep 20, 2010
rvgalc.f First commit. Sep 20, 2010
rvlg.f First commit. Sep 20, 2010
rvlsrd.f First commit. Sep 20, 2010
rvlsrk.f First commit. Sep 20, 2010
s2tp.f First commit. Sep 20, 2010
sep.f First commit. Sep 20, 2010
sepv.f First commit. Sep 20, 2010
setup.py Added 2015 leap second. Feb 3, 2015
sla.c First commit. Sep 20, 2010
sla_config.h First commit. Sep 20, 2010
slalib.h First commit. Sep 20, 2010
slalib.pyf First commit. Sep 20, 2010
slamac.h First commit. Sep 20, 2010
smat.f First commit. Sep 20, 2010
stdeb.cfg Add metadata to enable source build (sdist) and debian packaging (stdeb) Aug 3, 2012
subet.f First commit. Sep 20, 2010
supgal.f First commit. Sep 20, 2010
svd.f First commit. Sep 20, 2010
svdcov.f First commit. Sep 20, 2010
svdsol.f First commit. Sep 20, 2010
tp2s.f First commit. Sep 20, 2010
tp2v.f First commit. Sep 20, 2010
tps2c.f First commit. Sep 20, 2010
tpv2c.f First commit. Sep 20, 2010
ue2el.f First commit. Sep 20, 2010
ue2pv.f First commit. Sep 20, 2010
unpcd.f First commit. Sep 20, 2010
v2tp.f First commit. Sep 20, 2010
vdv.f First commit. Sep 20, 2010
veri.f First commit. Sep 20, 2010
vers.f First commit. Sep 20, 2010
vn.f First commit. Sep 20, 2010
vxv.f First commit. Sep 20, 2010
wait.f First commit. Sep 20, 2010
xy2xy.f First commit. Sep 20, 2010
zd.f First commit. Sep 20, 2010

README.txt

pySLALIB v1.0.2  (Dec 2010)
---------------

This is archive contains new f2py-generated (and hand-tweaked to
eliminate unnecessary function/subroutine arguments) wrappers for the
Fortran version of P.T. Wallace's SLALIB positional astronomy library.
SLALIB used to be hosted by the STARLINK site, although that service
has been suspended.  The version of SLALIB included here is 2.5-4
(with several additional tweaks) and is released under the GPL.

The python wrappers cover every function in SLALIB and a comprehensive
set of unit tests are available in the test/ directory.  The only
external dependency is numpy (http://numpy.scipy.org).  These wrappers
are not related to the older (and apparently abandoned) pySLALIB that
was once available on the Web (and which depended on Numeric as
opposed to numpy).

Installation
------------
Most users will only need to do:
  > python setup.py install
to generate the wrappers, build, and install the library.

Once slalib.so has been installed in your PYTHONPATH, you can run the
unittests via:
  > python test/test_slalib.py

Example Usage (using IPython)
-------------
In [1]: from pyslalib import slalib

In [2]: slalib.sla_veri()
Out[2]: 2005004

In [3]: slalib.sla_caldj(1999, 12, 31)
Out[3]: (51543.0, 0)

In [4]: slalib.sla_etrms(1976.9)
Out[4]: array([ -1.62161710e-06,  -3.31007009e-07,  -1.43529663e-07])

In [5]: slalib.sla_fk45z(1.234, -0.123, 1984)
Out[5]: (1.2446165107316911, -0.12141858395865548)

In [6]: slalib.sla_dafin("-00 03 34.6", 1)
Out[6]: (12, -0.0010404101596610642, 0)

In [7]: slalib.sla_obs(0, "GBT")
Out[7]:
('GBT',
 'Green Bank Telescope                    ',
 1.3934679949996727,
 0.67078450520692623,
 880.0)

If you import "sladoc" you can print the original Fortran doc
strings using something like:

In [1]: from pyslalib import slalib, sladoc

In [2]: print sladoc['sla_caldj']
"""
*     - - - - - -
*      C A L D J
*     - - - - - -
*
*  Gregorian Calendar to Modified Julian Date
*
*  (Includes century default feature:  use sla_CLDJ for years
*   before 100AD.)
*
*  Given:
*     IY,IM,ID     int    year, month, day in Gregorian calendar
*
...

Thanks go to Prasanth for adding the docstring capabilities!

If you would like to build a shared library for linking with other
programs, a simple Makefile is also included that should work with
only minor tweaks for most Unix-like OSs.

Please let me know if you find any problems.

Scott

----------------------------------
Scott M. Ransom <sransom@nrao.edu>
http://www.cv.nrao.edu/~sransom
Something went wrong with that request. Please try again.