[SCM] Python interface to DS9 branch, debian, updated. b3fb3bd6e23c5c317331eb8a19ba98b8a55f2fa3
Ole Streicher
debian at liska.ath.cx
Tue Mar 12 15:35:52 UTC 2013
The following commit has been merged in the debian branch:
commit 8605098c2c8f6cb206974c56bd5cf4d714464411
Author: Ole Streicher <debian at liska.ath.cx>
Date: Tue Mar 12 16:30:43 2013 +0100
New upstream version 1.6
diff --git a/PKG-INFO b/PKG-INFO
index c6197c2..6cdcf66 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: pyds9
-Version: 1.5
+Version: 1.6
Summary: Python/DS9 connection via XPA (with numpy and pyfits support)
Home-page: http://hea-www.harvard.edu/saord/ds9/
Author: Bill Joye and Eric Mandel
diff --git a/README b/README
index 8f4b671..c02f0b0 100644
--- a/README
+++ b/README
@@ -40,6 +40,10 @@ compile options to build a 32-bit shared object. This check can be overridden
by defining the CFLAGS environment variable (which can be anything sensible,
including an empty string).
+For Linux, the X Window System libraries and header files must be available.
+On some versions of Linux (e.g., debian), the development libraries must be
+installed explicitly. If you have problems, please let us know.
+
Contact saord at cfa.harvard.edu for help.
Eric Mandel
diff --git a/changelog b/changelog
index 6c4d7ac..ea536f5 100644
--- a/changelog
+++ b/changelog
@@ -29,3 +29,6 @@ version 1.5 August 2012
fixed bug in set_np2arr when arrays were not contiguous (rot90)
documentation additions
+version 1.6 March 2013
+ add support for astropy fits
+
diff --git a/ds9.py b/ds9.py
index 5e02b69..bca9a2f 100644
--- a/ds9.py
+++ b/ds9.py
@@ -13,23 +13,27 @@ ds9.py connects python and ds9 via the xpa messaging system:
- The ds9 class constructor connects to a single instance of a running ds9.
- The ds9 object supports 'set' and 'get' methods to communicate with ds9.
-- Other methods send/retrieve numpy arrays and pyfits hdulists to/from ds9.
+- Send/retrieve numpy arrays and pyfits (or astropy) hdulists to/from ds9.
- The ds9_targets() function lists ds9 programs running on your system.
- The ds9_openlist() function connects to a list of running ds9 instances.
"""
# pyds9 version
-__version__ = '1.5'
+__version__ = '1.6'
try:
- import pyfits
- if pyfits.__version__ >= '2.2':
- _have_pyfits = 1
- else:
- _have_pyfits = 0
+ from astropy.io import fits as pyfits
+ _have_pyfits = 1
except:
- _have_pyfits = 0
+ try:
+ import pyfits
+ if pyfits.__version__ >= '2.2':
+ _have_pyfits = 2
+ else:
+ _have_pyfits = 0
+ except:
+ _have_pyfits = 0
try:
import numpy
@@ -185,8 +189,8 @@ class ds9(object):
- get_arr2np: retrieve a FITS image or an array into a numpy array
- get_np2arr: send a numpy array to ds9 for display
- - get_pyfits: retrieve a FITS image into a pyfits hdu list
- - set_pyfits: send a pyfits hdu list to ds9 for display
+ - get_pyfits: retrieve a FITS image into a pyfits (or astropy) hdu list
+ - set_pyfits: send a pyfits (or astropy) hdu list to ds9 for display
"""
@@ -445,7 +449,10 @@ class ds9(object):
if not _have_pyfits:
raise ValueError, 'set_pyfits not defined (pyfits not found)'
if type(hdul) != pyfits.HDUList:
- raise ValueError, 'requires pyfits.HDUList as input'
+ if _have_pyfits == 1:
+ raise ValueError, 'requires pyfits.HDUList as input'
+ else:
+ raise ValueError, 'requires astropy.HDUList as input'
newFitsFile = StringIO.StringIO()
hdul.writeto(newFitsFile)
newfits = newFitsFile.getvalue()
@@ -619,7 +626,7 @@ if __name__ == '__main__':
print "\nskipping numpy test ..."
if _have_pyfits:
- print "\ntesting pyfits support ..."
+ print "\ntesting pyfits support (%d) ..." % _have_pyfits
hdul = d.get_pyfits()
print hdul.info()
i = hdul[0].data
diff --git a/setup.py b/setup.py
index bb730cb..7023cc5 100644
--- a/setup.py
+++ b/setup.py
@@ -58,7 +58,7 @@ class my_clean(clean.clean):
# setup command
setup(name='pyds9',
- version='1.5',
+ version='1.6',
description='Python/DS9 connection via XPA (with numpy and pyfits support)',
author='Bill Joye and Eric Mandel',
author_email='saord at cfa.harvard.edu',
diff --git a/xpa-2.1.14/Makefile b/xpa-2.1.14/Makefile
index caf1b68..a47f275 100644
--- a/xpa-2.1.14/Makefile
+++ b/xpa-2.1.14/Makefile
@@ -54,7 +54,7 @@ MAN_SHARE_DIR = $(INSTALL_ROOT)$(prefix)/share/xpa
# Platform-specific X compiler flags (include file specifications)
X_CFLAGS =
# Platform-specific link directive for X libraries (-L specification)
-X_LIBS = -L/usr/lib64
+X_LIBS =
# Platform-specific libraries that must go before -lXt
X_PRE_LIBS = -lSM -lICE
# Platform-specific libraries that must go after -lXt
diff --git a/xpa-2.1.14/config.status b/xpa-2.1.14/config.status
index 9873a1a..4ed6e6d 100755
--- a/xpa-2.1.14/config.status
+++ b/xpa-2.1.14/config.status
@@ -545,7 +545,7 @@ s, at LLIB@,|#_!!_#|$(LIB),g
s, at XMKMF@,|#_!!_#|,g
s, at X_CFLAGS@,|#_!!_#|,g
s, at X_PRE_LIBS@,|#_!!_#| -lSM -lICE,g
-s, at X_LIBS@,|#_!!_#| -L/usr/lib64,g
+s, at X_LIBS@,|#_!!_#|,g
s, at X_EXTRA_LIBS@,|#_!!_#|,g
s, at TCL_VERSION@,|#_!!_#|,g
s, at TCL_BIN_DIR@,|#_!!_#|,g
diff --git a/xpa-2.1.14/libxpa.a b/xpa-2.1.14/libxpa.a
index 7820515..5f472f7 100644
Binary files a/xpa-2.1.14/libxpa.a and b/xpa-2.1.14/libxpa.a differ
diff --git a/xpa-2.1.14/libxpa.so.1.0 b/xpa-2.1.14/libxpa.so.1.0
index 020b56a..702a7be 100755
Binary files a/xpa-2.1.14/libxpa.so.1.0 and b/xpa-2.1.14/libxpa.so.1.0 differ
diff --git a/xpa-2.1.14/xpaaccess b/xpa-2.1.14/xpaaccess
index 519e3c1..19fc816 100755
Binary files a/xpa-2.1.14/xpaaccess and b/xpa-2.1.14/xpaaccess differ
diff --git a/xpa-2.1.14/xpaget b/xpa-2.1.14/xpaget
index 1b4adf1..50066db 100755
Binary files a/xpa-2.1.14/xpaget and b/xpa-2.1.14/xpaget differ
diff --git a/xpa-2.1.14/xpainfo b/xpa-2.1.14/xpainfo
index 16d47c8..c16c451 100755
Binary files a/xpa-2.1.14/xpainfo and b/xpa-2.1.14/xpainfo differ
diff --git a/xpa-2.1.14/xpamb b/xpa-2.1.14/xpamb
index 499397a..3c354f5 100755
Binary files a/xpa-2.1.14/xpamb and b/xpa-2.1.14/xpamb differ
diff --git a/xpa-2.1.14/xpans b/xpa-2.1.14/xpans
index c841270..07dc503 100755
Binary files a/xpa-2.1.14/xpans and b/xpa-2.1.14/xpans differ
diff --git a/xpa-2.1.14/xpaset b/xpa-2.1.14/xpaset
index cec6c7b..a36204d 100755
Binary files a/xpa-2.1.14/xpaset and b/xpa-2.1.14/xpaset differ
--
Python interface to DS9
More information about the debian-science-commits
mailing list