summaryrefslogtreecommitdiff
path: root/setup.py.old
diff options
context:
space:
mode:
authordencheva <dencheva@stsci.edu>2008-08-15 09:49:03 -0400
committerdencheva <dencheva@stsci.edu>2008-08-15 09:49:03 -0400
commitc42103854ca3f38cd88e7d07b6c5a8af5eda0ee2 (patch)
tree386183951b5ed43415b6afd12ca390683902906c /setup.py.old
downloadstwcs_hcf-c42103854ca3f38cd88e7d07b6c5a8af5eda0ee2.tar.gz
moved hstwcs from general development repository to stsci_python/development
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/development/trunk/hstwcs@6931 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'setup.py.old')
-rw-r--r--setup.py.old89
1 files changed, 89 insertions, 0 deletions
diff --git a/setup.py.old b/setup.py.old
new file mode 100644
index 0000000..a4a57a2
--- /dev/null
+++ b/setup.py.old
@@ -0,0 +1,89 @@
+from distutils.core import setup, Extension
+from os.path import join
+
+######################################################################
+# NUMPY
+try:
+ import numpy
+except ImportError:
+ print "numpy must be installed to build pywcs."
+ print "ABORTING."
+ sys.exit(1)
+
+try:
+ numpy_include = numpy.get_include()
+except AttributeError:
+ numpy_include = numpy.get_numpy_include()
+
+######################################################################
+# PyFITS
+try:
+ import pyfits
+except ImportError:
+ print "WARNING: PyFITS must be installed to use pywcs."
+ print " Since this is not a build-time dependency, the build will proceed."
+
+######################################################################
+######################################################################
+# WCSLIB
+WCSVERSION = "4.3"
+WCSLIB = "wcslib-%s" % WCSVERSION # Path to wcslib
+WCSLIBC = join('pywcs', WCSLIB, "C") # Path to wcslib source files
+WCSFILES = [ # List of wcslib files to compile
+ 'flexed/wcsulex.c',
+ 'flexed/wcsutrn.c',
+ 'cel.c',
+ 'lin.c',
+ 'log.c',
+ 'prj.c',
+ 'spc.c',
+ 'sph.c',
+ 'spx.c',
+ 'tab.c',
+ 'wcs.c',
+ 'wcsfix.c',
+ 'wcshdr.c',
+ 'wcspih.c',
+ 'wcstrig.c',
+ 'wcsunits.c',
+ 'wcsutil.c']
+WCSFILES = [join(WCSLIBC, x) for x in WCSFILES]
+######################################################################
+
+######################################################################
+# GENERATE DOCSTRINGS IN C
+docstrings = {}
+execfile("pywcs/doc/docstrings.py", docstrings)
+keys = docstrings.keys()
+keys.sort()
+fd = open("pywcs/src/docstrings.h", "w")
+fd.write('/* This file is autogenerated by setup.py. To edit its contents\n')
+fd.write(' edit doc/docstrings.py\n')
+fd.write('*/\n')
+for key in keys:
+ if key.startswith('__'):
+ continue
+ val = docstrings[key].lstrip().encode("string_escape").replace('"', '\\"')
+ fd.write("static const char doc_%s[] = \"%s\";\n\n" % (key, val))
+fd.close()
+
+######################################################################
+
+setup(name="hstwcs",
+ version="0.1",
+ description="HST WCS Corrections",
+ packages=['hstwcs', 'hstwcs/pywcs', 'hstwcs/updatewcs', 'hstwcs/wcsutil', 'hstwcs/distortion'],
+ package_dir={'hstwcs':'lib', 'hstwcs/pywcs': 'pywcs/pywcs', 'hstwcs/updatewcs': 'updatewcs',
+ 'hstwcs/wcsutil': 'wcsutil', 'hstwcs/distortion': 'distortion'},
+ ext_modules=[
+ Extension('hstwcs.pywcs._pywcs',
+ ['pywcs/src/pywcs.c'] +
+ WCSFILES,
+ include_dirs=[
+ numpy_include,
+ WCSLIBC,
+ "src"
+ ]
+ )
+ ]
+ )