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