Permalink
Browse files

First commit.

  • Loading branch information...
0 parents commit c6178c2a9a1d6fadaa2e7dc50ada7bebb5e633a7 @scottransom committed Sep 20, 2010
Showing with 41,169 additions and 0 deletions.
  1. +7 −0 .gitignore
  2. +50 −0 Makefile
  3. +65 −0 README.txt
  4. +84 −0 addet.f
  5. +119 −0 afin.f
  6. +75 −0 airmas.f
  7. +162 −0 altaz.f
  8. +88 −0 amp.f
  9. +139 −0 ampqk.f
  10. +191 −0 aop.f
  11. +193 −0 aoppa.f
  12. +62 −0 aoppat.f
  13. +259 −0 aopqk.f
  14. +140 −0 atmdsp.f
  15. +57 −0 atms.f
  16. +71 −0 atmt.f
  17. +84 −0 av2m.f
  18. +59 −0 bear.f
  19. +74 −0 caf2r.f
  20. +74 −0 caldj.f
  21. +82 −0 calyd.f
  22. +69 −0 cc2s.f
  23. +99 −0 cc62s.f
  24. +72 −0 cd2tf.f
  25. +94 −0 cldj.f
  26. +118 −0 clyd.f
  27. +159 −0 combn.f
  28. +75 −0 cr2af.f
  29. +75 −0 cr2tf.f
  30. +57 −0 cs2c.f
  31. +72 −0 cs2c6.f
  32. +73 −0 ctf2d.f
  33. +71 −0 ctf2r.f
  34. +72 −0 daf2r.f
  35. +180 −0 dafin.f
  36. +244 −0 dat.f
  37. +83 −0 dav2m.f
  38. +59 −0 dbear.f
  39. +130 −0 dbjin.f
  40. +99 −0 dc62s.f
  41. +69 −0 dcc2s.f
  42. +159 −0 dcmpf.f
  43. +56 −0 dcs2c.f
  44. +106 −0 dd2tf.f
  45. +106 −0 de2h.f
  46. +180 −0 deuler.f
  47. +297 −0 dfltin.f
  48. +100 −0 dh2e.f
  49. +68 −0 dimxv.f
  50. +92 −0 djcal.f
  51. +83 −0 djcl.f
  52. +74 −0 dm2av.f
  53. +157 −0 dmat.f
  54. +658 −0 dmoon.f
  55. +72 −0 dmxm.f
  56. +68 −0 dmxv.f
  57. +81 −0 dpav.f
  58. +75 −0 dr2af.f
  59. +75 −0 dr2tf.f
  60. +49 −0 drange.f
  61. +47 −0 dranrm.f
  62. +74 −0 ds2c6.f
  63. +84 −0 ds2tp.f
  64. +60 −0 dsep.f
  65. +76 −0 dsepv.f
  66. +96 −0 dt.f
  67. +72 −0 dtf2d.f
  68. +70 −0 dtf2r.f
  69. +59 −0 dtp2s.f
  70. +73 −0 dtp2v.f
  71. +108 −0 dtps2c.f
  72. +100 −0 dtpv2c.f
  73. +63 −0 dtt.f
  74. +95 −0 dv2tp.f
  75. +44 −0 dvdv.f
  76. +69 −0 dvn.f
  77. +56 −0 dvxv.f
  78. +106 −0 e2h.f
  79. +129 −0 earth.f
  80. +72 −0 ecleq.f
  81. +69 −0 ecmat.f
  82. +95 −0 ecor.f
  83. +107 −0 eg50.f
  84. +328 −0 el2ue.f
  85. +47 −0 epb.f
  86. +47 −0 epb2d.f
  87. +68 −0 epco.f
  88. +46 −0 epj.f
  89. +46 −0 epj2d.f
  90. +2,508 −0 epv.f
  91. +72 −0 eqecl.f
  92. +74 −0 eqeqx.f
  93. +96 −0 eqgal.f
  94. +79 −0 etrms.f
  95. +85 −0 euler.f
  96. +456 −0 evp.f
  97. +328 −0 fitxy.f
  98. +266 −0 fk425.f
  99. +182 −0 fk45z.f
  100. +274 −0 fk524.f
  101. +122 −0 fk52h.f
  102. +86 −0 fk54z.f
  103. +124 −0 fk5hz.f
  104. +145 −0 flotin.f
  105. +96 −0 galeq.f
  106. +96 −0 galsup.f
  107. +107 −0 ge50.f
  108. +77 −0 geoc.f
  109. +77 −0 gmst.f
  110. +99 −0 gmsta.f
  111. +113 −0 gresid.F
  112. +100 −0 h2e.f
  113. +126 −0 h2fk5.f
  114. +139 −0 hfk5z.f
  115. +111 −0 idchf.f
  116. +108 −0 idchi.f
  117. +68 −0 imxv.f
  118. +193 −0 intin.f
  119. +105 −0 invf.f
  120. +73 −0 kbj.f
  121. +74 −0 m2av.f
  122. +98 −0 map.f
  123. +128 −0 mappa.f
  124. +159 −0 mapqk.f
  125. +130 −0 mapqkz.f
  126. +379 −0 moon.f
  127. +71 −0 mxm.f
  128. +68 −0 mxv.f
  129. +75 −0 nut.f
  130. +830 −0 nutc.f
  131. +475 −0 nutc80.f
  132. +192 −0 oap.f
  133. +250 −0 oapqk.f
  134. +942 −0 obs.f
  135. +63 −0 pa.f
  136. +70 −0 pav.f
  137. +76 −0 pcd.f
  138. +117 −0 pda2h.f
  139. +115 −0 pdq2h.f
  140. +159 −0 permut.f
  141. +181 −0 pertel.f
  142. +642 −0 pertue.f
  143. +183 −0 planel.f
  144. +724 −0 planet.f
  145. +250 −0 plante.f
  146. +155 −0 plantu.f
  147. +97 −0 pm.f
  148. +158 −0 polmo.f
  149. +79 −0 prebn.f
  150. +96 −0 prec.f
  151. +101 −0 preces.f
  152. +142 −0 precl.f
  153. +66 −0 prenut.f
  154. +379 −0 pv2el.f
  155. +167 −0 pv2ue.f
  156. +76 −0 pvobs.f
  157. +109 −0 pxy.f
  158. +87 −0 random.F
  159. +50 −0 range.f
  160. +48 −0 ranorm.f
  161. +1,109 −0 rcc.f
  162. +200 −0 rdplan.f
  163. +87 −0 refco.f
  164. +226 −0 refcoq.f
  165. +401 −0 refro.f
  166. +128 −0 refv.f
  167. +169 −0 refz.f
  168. +65 −0 rverot.f
  169. +86 −0 rvgalc.f
  170. +81 −0 rvlg.f
  171. +95 −0 rvlsrd.f
  172. +94 −0 rvlsrk.f
  173. +84 −0 s2tp.f
  174. +55 −0 sep.f
  175. +70 −0 sepv.f
  176. +18 −0 setup.py
  177. +1,771 −0 sla.c
  178. +69 −0 sla_config.h
  179. +509 −0 slalib.h
  180. +1,399 −0 slalib.pyf
  181. +100 −0 slamac.h
  182. +158 −0 smat.f
  183. +83 −0 subet.f
  184. +96 −0 supgal.f
  185. +400 −0 svd.f
  186. +77 −0 svdcov.f
  187. +126 −0 svdsol.f
  188. +6,567 −0 test/sla_test.f
  189. +1,424 −0 test/test_slalib.py
  190. +59 −0 tp2s.f
  191. +73 −0 tp2v.f
  192. +108 −0 tps2c.f
  193. +100 −0 tpv2c.f
  194. +211 −0 ue2el.f
  195. +252 −0 ue2pv.f
  196. +144 −0 unpcd.f
  197. +95 −0 v2tp.f
  198. +44 −0 vdv.f
  199. +52 −0 veri.f
  200. +58 −0 vers.f
  201. +63 −0 vn.f
  202. +56 −0 vxv.f
  203. +49 −0 wait.f
  204. +66 −0 xy2xy.f
  205. +79 −0 zd.f
@@ -0,0 +1,7 @@
+*.[oa]
+*.so
+*.pyc
+*~
+TAGS
+*egg-info
+build/
@@ -0,0 +1,50 @@
+# Makefile for SLALIB
+# for Pentium/Linux
+# by Scott M. Ransom
+
+# OS type
+OS = Linux
+#OS = OSX
+
+# Linux is the first choice
+ifeq ($(OS),Linux)
+ LIBSUFFIX = .so
+ LIBCMD = -shared
+ SYSDIR = /usr
+ LOCDIR = /usr/local
+# else assume Darwin (i.e. OSX)
+else
+ LIBSUFFIX = .dylib
+ LIBCMD = -dynamiclib
+ SYSDIR = /sw
+ LOCDIR = /sw
+endif
+
+CC = gcc
+FC = gfortran
+#FC = g77
+CFLAGS = -O2 -Wall -W -fPIC
+CLINKFLAGS = $(CFLAGS)
+FFLAGS = -O2 -fPIC
+FLINKFLAGS = $(FFLAGS)
+
+all: slalib
+
+slalib: libsla$(LIBSUFFIX)
+ $(FC) -o test/sla_test test/sla_test.f -fno-second-underscore -L. -lsla
+ test/sla_test
+
+libsla$(LIBSUFFIX):
+ $(FC) $(FFLAGS) -fno-second-underscore -c -I. *.f *.F
+ $(FC) $(LIBCMD) -o libsla$(LIBSUFFIX) -fno-second-underscore *.o
+
+# Note: a better way to make pyslalib is to use the setup.py file
+pyslalib:
+ f2py -c slalib.pyf -I. *.f *.F
+
+clean:
+ rm -f *.o *~ *#
+ rm -rf build
+
+cleaner: clean
+ rm -f test/sla_test libsla.so slalib.so
@@ -0,0 +1,65 @@
+pySLALIB v1.0 (Nov 2007)
+-------------
+
+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]: import slalib as S
+
+In [2]: S.sla_veri()
+Out[2]: 2005004
+
+In [3]: S.sla_caldj(1999, 12, 31)
+Out[3]: (51543.0, 0)
+
+In [4]: S.sla_etrms(1976.9)
+Out[4]: array([ -1.62161710e-06, -3.31007009e-07, -1.43529663e-07])
+
+In [5]: S.sla_fk45z(1.234, -0.123, 1984)
+Out[5]: (1.2446165107316911, -0.12141858395865548)
+
+In [6]: S.sla_dafin("-00 03 34.6", 1)
+Out[6]: (12, -0.0010404101596610642, 0)
+
+In [7]: S.sla_obs(0, "GBT")
+Out[7]:
+('GBT',
+ 'Green Bank Telescope ',
+ 1.3934679949996727,
+ 0.67078450520692623,
+ 880.0)
+
+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
84 addet.f
@@ -0,0 +1,84 @@
+ SUBROUTINE sla_ADDET (RM, DM, EQ, RC, DC)
+*+
+* - - - - - -
+* A D D E T
+* - - - - - -
+*
+* Add the E-terms (elliptic component of annual aberration)
+* to a pre IAU 1976 mean place to conform to the old
+* catalogue convention (double precision)
+*
+* Given:
+* RM,DM dp RA,Dec (radians) without E-terms
+* EQ dp Besselian epoch of mean equator and equinox
+*
+* Returned:
+* RC,DC dp RA,Dec (radians) with E-terms included
+*
+* Note:
+*
+* Most star positions from pre-1984 optical catalogues (or
+* derived from astrometry using such stars) embody the
+* E-terms. If it is necessary to convert a formal mean
+* place (for example a pulsar timing position) to one
+* consistent with such a star catalogue, then the RA,Dec
+* should be adjusted using this routine.
+*
+* Reference:
+* Explanatory Supplement to the Astronomical Ephemeris,
+* section 2D, page 48.
+*
+* Called: sla_ETRMS, sla_DCS2C, sla_DCC2S, sla_DRANRM, sla_DRANGE
+*
+* P.T.Wallace Starlink 18 March 1999
+*
+* Copyright (C) 1999 Rutherford Appleton Laboratory
+*
+* License:
+* 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 2 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 (see SLA_CONDITIONS); if not, write to the
+* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+* Boston, MA 02111-1307 USA
+*
+*-
+
+ IMPLICIT NONE
+
+ DOUBLE PRECISION RM,DM,EQ,RC,DC
+
+ DOUBLE PRECISION sla_DRANRM
+
+ DOUBLE PRECISION A(3),V(3)
+
+ INTEGER I
+
+
+
+* E-terms vector
+ CALL sla_ETRMS(EQ,A)
+
+* Spherical to Cartesian
+ CALL sla_DCS2C(RM,DM,V)
+
+* Include the E-terms
+ DO I=1,3
+ V(I)=V(I)+A(I)
+ END DO
+
+* Cartesian to spherical
+ CALL sla_DCC2S(V,RC,DC)
+
+* Bring RA into conventional range
+ RC=sla_DRANRM(RC)
+
+ END
119 afin.f
@@ -0,0 +1,119 @@
+ SUBROUTINE sla_AFIN (STRING, IPTR, A, J)
+*+
+* - - - - -
+* A F I N
+* - - - - -
+*
+* Sexagesimal character string to angle (single precision)
+*
+* Given:
+* STRING c*(*) string containing deg, arcmin, arcsec fields
+* IPTR i pointer to start of decode (1st = 1)
+*
+* Returned:
+* IPTR i advanced past the decoded angle
+* A r angle in radians
+* J i status: 0 = OK
+* +1 = default, A unchanged
+* -1 = bad degrees )
+* -2 = bad arcminutes ) (note 3)
+* -3 = bad arcseconds )
+*
+* Example:
+*
+* argument before after
+*
+* STRING '-57 17 44.806 12 34 56.7' unchanged
+* IPTR 1 16 (points to 12...)
+* A ? -1.00000
+* J ? 0
+*
+* A further call to sla_AFIN, without adjustment of IPTR, will
+* decode the second angle, 12deg 34min 56.7sec.
+*
+* Notes:
+*
+* 1) The first three "fields" in STRING are degrees, arcminutes,
+* arcseconds, separated by spaces or commas. The degrees field
+* may be signed, but not the others. The decoding is carried
+* out by the DFLTIN routine and is free-format.
+*
+* 2) Successive fields may be absent, defaulting to zero. For
+* zero status, the only combinations allowed are degrees alone,
+* degrees and arcminutes, and all three fields present. If all
+* three fields are omitted, a status of +1 is returned and A is
+* unchanged. In all other cases A is changed.
+*
+* 3) Range checking:
+*
+* The degrees field is not range checked. However, it is
+* expected to be integral unless the other two fields are
+* absent.
+*
+* The arcminutes field is expected to be 0-59, and integral if
+* the arcseconds field is present. If the arcseconds field
+* is absent, the arcminutes is expected to be 0-59.9999...
+*
+* The arcseconds field is expected to be 0-59.9999...
+*
+* 4) Decoding continues even when a check has failed. Under these
+* circumstances the field takes the supplied value, defaulting
+* to zero, and the result A is computed and returned.
+*
+* 5) Further fields after the three expected ones are not treated
+* as an error. The pointer IPTR is left in the correct state
+* for further decoding with the present routine or with DFLTIN
+* etc. See the example, above.
+*
+* 6) If STRING contains hours, minutes, seconds instead of degrees
+* etc, or if the required units are turns (or days) instead of
+* radians, the result A should be multiplied as follows:
+*
+* for to obtain multiply
+* STRING A in A by
+*
+* d ' " radians 1 = 1.0
+* d ' " turns 1/2pi = 0.1591549430918953358
+* h m s radians 15 = 15.0
+* h m s days 15/2pi = 2.3873241463784300365
+*
+* Called: sla_DAFIN
+*
+* P.T.Wallace Starlink 13 September 1990
+*
+* Copyright (C) 1995 Rutherford Appleton Laboratory
+*
+* License:
+* 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 2 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 (see SLA_CONDITIONS); if not, write to the
+* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+* Boston, MA 02111-1307 USA
+*
+*-
+
+ IMPLICIT NONE
+
+ CHARACTER*(*) STRING
+ INTEGER IPTR
+ REAL A
+ INTEGER J
+
+ DOUBLE PRECISION AD
+
+
+
+* Call the double precision version
+ CALL sla_DAFIN(STRING,IPTR,AD,J)
+ IF (J.LE.0) A=REAL(AD)
+
+ END
Oops, something went wrong.

0 comments on commit c6178c2

Please sign in to comment.