File: README.md

package info (click to toggle)
python-pyds9 1.8.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,184 kB
  • sloc: ansic: 17,257; sh: 3,668; python: 701; makefile: 491; tcl: 219
file content (66 lines) | stat: -rw-r--r-- 2,547 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Python connection to ds9 via XPA

The [XPA messaging system](http://hea-www.harvard.edu/saord/xpa) provides 
seamless communication between many kinds of Unix programs, including Tcl/Tk
programs such as ds9. The ``pyds9`` module uses a Python interface to XPA to 
communicate with ds9. It supports communication with all of ds9's XPA access
points. See http://hea-www.harvard.edu/saord/ds9/ref/xpa.html for more info.

pyds9 is available from GitHub at:

https://github.com/ericmandel/pyds9


The easiest way to install ``pyds9`` is:

    # install from the repository
    > pip install [--user] git+https://github.com/ericmandel/pyds9.git#egg=pyds9

Alternatively, you can clone the git repository or download and unpack the [zip
file](https://github.com/ericmandel/pyds9/archive/master.zip). Then ``cd`` into
the pyds9 directory and issue:

    > python setup.py [--user] install


If the compilation of the C files in ``xpa`` directory fails saying that doesn't
find the header file ``X11/Intrinsic.h`` make sure to install the relevant
packages:

* openSUSE: sudo zypper install libXt-devel
* Ubuntu: sudo apt-get install libxt-dev

To run:

    # start up python
    > python
        ... (startup messages) ...
    >>> import pyds9
    >>> print(pyds9.ds9_targets())
    >>> d = pyds9.DS9()  # will open a new ds9 window or connect to an existing one
    >>> d.set("file /path/to/fits")  # send the file to the open ds9 session

If you create a ``test.fits`` file and a ``casa.fits`` file in the working
directory you can test basic ds9 functionalities running the function:

    > pyds9.test()


The setup.py install will build and install both the XPA shared library and 
the xpans name server. By default, the code generated for the shared object
will match the address size of the host machine, i.e. 32-bit or 64-bit
as the case may be. But on 64-bit Intel machines, the XPA build also will check
whether python itself is 64-bit. If not, will add the "-m32" switch to the
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.

To report a bug, ask for a new feature, or request support, please contact us at
https://github.com/ericmandel/pyds9/issues


Eric Mandel and Francesco Montesano