LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
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: