Skip to main content

astropy-samp-ds9

Launch and interact with SAOImageDS9, using the SAMP protocol and client libraries provided by Astropy SAMP.

Installation

Using PyPI astropy-samp-ds9.

pip install astropy-samp-ds9

Example

  • single ds9 instance (managing its own hub)

Note: singleton (default=True), can be used to reattach existing instances sharing the same title, user and display

from astropy_samp_ds9.launcher import DS9

ds9 = DS9(title='hello world')
res = ds9.get('version')
ds9.set('cmap cool', 'scale zscale', 'zoom to fit')
ds9.set('mosaicimage wcs {my.fits}')
res = ds9.get('iexam key coordinate')
  • ds9 instance(s) attached to an external hub. Those can be attached, re-attached, and controlled from different sessions.

Caveat: blocking commands like get('iexam key coordinate') will not react to the ds9 window being killed.

from astropy_samp_ds9.hublauncher import DS9Hub
from astropy_samp_ds9.launcher import DS9

hub = DS9Hub(name='myhub')
samp_hub_file = hub.samp_hub_file

ds9red = DS9(title='red channel', kill_ds9_on_exit=False, samp_hub_file=samp_hub_file)
ds9blue = DS9(title='blue channel', kill_ds9_on_exit=False, samp_hub_file=samp_hub_file)

Environment

  • DS9_EXE

This package requires SAOImageDS9 >= 8.7b1. By default, it uses ds9 that must satisfy this version and found in your PATH.

If you have several ds9 installations on your machine, or ds9 is not in your path, use the DS9_EXE environment to specify the ds9 executable location. For example: export DS9_EXE=/usr/local/ds9/8.7/bin/ds9

  • SAMP_HUB_PATH

The directory used to store SAMP_HUB files. By default, it will use $HOME/.samp-ds9/, and create this directory as needed.

  • SAMP_HUB_EXE

The samp_hub executable provided by astropy. By default, it will use samp_hub that must be in your PATH.

Miscellaneous

More advanced features include: exit handler, use pre-existing SAMP hub, etc. As of now, the documention is lacking and still WIP. Read the code!

Release files for astropy-samp-ds9 0.1.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for astropy-samp-ds9 0.1.19
File Size Uploaded
astropy-samp-ds9-0.1.19.tar.gz 19.3 kB Details

Release files / astropy-samp-ds9-0.1.19.tar.gz

Download URL astropy-samp-ds9-0.1.19.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
778c0c2e39360f8eac83d0c49fbbec779cd057ad45ec87ffedb2116d8255f893
BLAKE2b-256 checksum
How to use checksums
88e20d1be1b82b25d0519265f259b7ce973184686cc9f41bece957ce238ebfbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.1.19 This release

1 release file

0.1.18

1 release file

0.1.17

1 release file

0.1.16

1 release file

0.1.15

1 release file

0.1.14

1 release file

0.1.13

1 release file

0.1.12

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page