LSSTApplications  17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
LSSTDataManagementBasePackage
Public Member Functions | List of all members
lsst.display.ds9.ds9.Buffer Class Reference
Inheritance diagram for lsst.display.ds9.ds9.Buffer:

Public Member Functions

def __init__ (self, size=0)
 
def set (self, size, silent=True)
 
def pushSize (self, size=-1)
 
def popSize (self)
 
def flush (self, silent=True)
 

Detailed Description

Buffer to control sending commands to DS9.

Notes
-----
The usual usage pattern is:

>>> with ds9.Buffering():
...     # bunches of ds9.{dot,line} commands
...     ds9.flush()
...     # bunches more ds9.{dot,line} commands

Definition at line 111 of file ds9.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.display.ds9.ds9.Buffer.__init__ (   self,
  size = 0 
)

Definition at line 124 of file ds9.py.

124  def __init__(self, size=0):
125  self._commands = "" # list of pending commands
126  self._lenCommands = len(self._commands)
127  self._bufsize = [] # stack of bufsizes
128 
129  self._bufsize.append(size) # don't call self.size() as ds9Cmd isn't defined yet
130 
std::shared_ptr< FrameSet > append(FrameSet const &first, FrameSet const &second)
Construct a FrameSet that performs two transformations in series.
Definition: functional.cc:33
def __init__(self, minimum, dataRange, Q)

Member Function Documentation

◆ flush()

def lsst.display.ds9.ds9.Buffer.flush (   self,
  silent = True 
)
Flush the pending commands.

Parameters
----------
silent : `bool`, optional
    Do not print error messages.

Definition at line 197 of file ds9.py.

197  def flush(self, silent=True):
198  """Flush the pending commands.
199 
200  Parameters
201  ----------
202  silent : `bool`, optional
203  Do not print error messages.
204  """
205  ds9Cmd(flush=True, silent=silent)
206 
207  cmdBuffer = Buffer(0)
def ds9Cmd(cmd=None, trap=True, flush=False, silent=True, frame=None, get=False)
Definition: ds9.py:225

◆ popSize()

def lsst.display.ds9.ds9.Buffer.popSize (   self)
Switch back to the previous command buffer size.

Notes
-----
See also `pushSize`.

Definition at line 185 of file ds9.py.

185  def popSize(self):
186  """Switch back to the previous command buffer size.
187 
188  Notes
189  -----
190  See also `pushSize`.
191  """
192  self.flush(silent=True)
193 
194  if len(self._bufsize) > 1:
195  self._bufsize.pop()
196 

◆ pushSize()

def lsst.display.ds9.ds9.Buffer.pushSize (   self,
  size = -1 
)
Replace current DS9 command buffer size.

Parameters
----------
size : `int`, optional
    Size of buffer. A negative value sets the largest possible
    buffer.

Notes
-----
See also `popSize`.

Definition at line 168 of file ds9.py.

168  def pushSize(self, size=-1):
169  """Replace current DS9 command buffer size.
170 
171  Parameters
172  ----------
173  size : `int`, optional
174  Size of buffer. A negative value sets the largest possible
175  buffer.
176 
177  Notes
178  -----
179  See also `popSize`.
180  """
181  self.flush(silent=True)
182  self._bufsize.append(0)
183  self.set(size, silent=True)
184 
std::shared_ptr< FrameSet > append(FrameSet const &first, FrameSet const &second)
Construct a FrameSet that performs two transformations in series.
Definition: functional.cc:33

◆ set()

def lsst.display.ds9.ds9.Buffer.set (   self,
  size,
  silent = True 
)
Set the ds9 buffer size to size.

Parameters
----------
size : `int`
    Size of buffer. Requesting a negative size provides the
    largest possible buffer given bugs in xpa.
silent : `bool`, optional
    Do not print error messages (default `True`).

Definition at line 131 of file ds9.py.

131  def set(self, size, silent=True):
132  """Set the ds9 buffer size to size.
133 
134  Parameters
135  ----------
136  size : `int`
137  Size of buffer. Requesting a negative size provides the
138  largest possible buffer given bugs in xpa.
139  silent : `bool`, optional
140  Do not print error messages (default `True`).
141  """
142  if size < 0:
143  size = XPA_SZ_LINE - 5
144 
145  if size > XPA_SZ_LINE:
146  print("xpa silently hardcodes a limit of %d for buffer sizes (you asked for %d) " %
147  (XPA_SZ_LINE, size), file=sys.stderr)
148  self.set(-1) # use max buffersize
149  return
150 
151  if self._bufsize:
152  self._bufsize[-1] = size # change current value
153  else:
154  self._bufsize.append(size) # there is no current value; set one
155 
156  self.flush(silent=silent)
157 
std::shared_ptr< FrameSet > append(FrameSet const &first, FrameSet const &second)
Construct a FrameSet that performs two transformations in series.
Definition: functional.cc:33
daf::base::PropertySet * set
Definition: fits.cc:884

The documentation for this class was generated from the following file: