LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
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

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 

◆ 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 
daf::base::PropertySet * set
Definition: fits.cc:912

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