Package gmisclib :: Module g_ds9
[frames] | no frames]

Module g_ds9

source code

Handles interactions with ds9 (http://hea-www.harvard.edu/RD/ds9/). Ds9 is an image display and analysis tool commonly used in astrophysics, but it's good for any kind of greyscale image.

Note: there is an extra, special property Coordsys. This is not fed to ds9. It is merely something that you can use to remember what coordinate system the regions are in.

Classes
  UnknownProperty
  execwait
  ds9_io
  BadTagError
  Region
  line
  circle
  point
  text
  ds9
  ds9_file
This is just a convenient way to write regions to a file, instead of writing them to a ds9 session.
Functions
 
copy(r, **kwargs)
Copy a region and update some of the keyword arguments (e.g.
source code
 
dequote(s) source code
 
make_chunks(s) source code
 
property_parser(ap) source code
 
test_property_parser() source code
 
region_parser(s, defprop) source code
 
test_region_parser() source code
 
text_kluge(s) source code
 
test_text_kluge() source code
 
r_list_factory(slist, Coordsys) source code
 
read_regions_iter(fd, Coordsys=None)
Read regions from a file.
source code
 
read_regions(fd, Coordsys=None)
Read regions from a file.
source code
 
test_io() source code
 
test_tags() source code
 
test_plot() source code
Variables
  COLORS = ('white', 'black', 'red', 'green', 'blue', 'cyan', 'm...
  PLOTSYMS = ('circle', 'diamond', 'plus', 'cross')
  PROPin = {'color': <type 'str'>, 'delete': <type 'int'>, 'edit...
  PROPout = {'color': _kvstr, 'text': _kvquote, 'font': _kvquote...
  PLOTSTYLES = ('discrete', 'line', 'step', 'quadratic', 'errorb...
  __package__ = 'gmisclib'

Imports: re, threading, os, time, COPY, die, g_exec


Function Details

copy(r, **kwargs)

source code 

Copy a region and update some of the keyword arguments (e.g. color). The original object is unchanged, and you can copy any subclass of Region.

read_regions_iter(fd, Coordsys=None)

source code 

Read regions from a file. This is an iterator. Fd is a file descriptor.

read_regions(fd, Coordsys=None)

source code 

Read regions from a file. Fd is a file descriptor.


Variables Details

COLORS

Value:
('white',
 'black',
 'red',
 'green',
 'blue',
 'cyan',
 'magenta',
 'yellow')

PROPin

Value:
{'color': <type 'str'>,
 'delete': <type 'int'>,
 'edit': <type 'int'>,
 'fixed': <type 'int'>,
 'font': <function dequote at 0x3680d70>,
 'highlite': <type 'int'>,
 'include': <type 'int'>,
 'line': None,
...

PROPout

Value:
{'color': _kvstr, 'text': _kvquote, 'font': _kvquote, 'select': _kvint\
, 'edit': _kvint, 'move': _kvint, 'rotate': _kvint, 'delete': _kvint, \
'fixed': _kvint, 'line': _kvline, 'tags': _kvtags, 'tag': _kverr, 'rul\
er': _kvint, 'width': _kvint, 'point': _kvstr, 'highlite': _kvint, 'in\
clude': _kvint}

PLOTSTYLES

Value:
('discrete', 'line', 'step', 'quadratic', 'errorbar')