LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
Classes | Functions
lsst.afw.display.utils Namespace Reference

Classes

class  Mosaic
 

Functions

def drawBBox
 
def drawFootprint
 
def drawCoaddInputs
 

Function Documentation

def lsst.afw.display.utils.drawBBox (   bbox,
  borderWidth = 0.0,
  origin = None,
  frame = None,
  ctype = None,
  bin = 1 
)
Draw an afwImage::BBox on a ds9 frame with the specified ctype.  Include an extra borderWidth pixels
If origin is present, it's Added to the BBox

All BBox coordinates are divided by bin, as is right and proper for overlaying on a binned image

Definition at line 241 of file utils.py.

242 def drawBBox(bbox, borderWidth=0.0, origin=None, frame=None, ctype=None, bin=1):
243  """Draw an afwImage::BBox on a ds9 frame with the specified ctype. Include an extra borderWidth pixels
244 If origin is present, it's Added to the BBox
245 
246 All BBox coordinates are divided by bin, as is right and proper for overlaying on a binned image
247  """
248  x0, y0 = bbox.getMinX(), bbox.getMinY()
249  x1, y1 = bbox.getMaxX(), bbox.getMaxY()
250 
251  if origin:
252  x0 += origin[0]; x1 += origin[0]
253  y0 += origin[1]; y1 += origin[1]
254 
255  x0 /= bin; y0 /= bin
256  x1 /= bin; y1 /= bin
257  borderWidth /= bin
258 
259  ds9.line([(x0 - borderWidth, y0 - borderWidth),
260  (x0 - borderWidth, y1 + borderWidth),
261  (x1 + borderWidth, y1 + borderWidth),
262  (x1 + borderWidth, y0 - borderWidth),
263  (x0 - borderWidth, y0 - borderWidth),
264  ], frame=frame, ctype=ctype)
def lsst.afw.display.utils.drawCoaddInputs (   exposure,
  frame = None,
  ctype = None,
  bin = 1 
)
Draw the bounding boxes of input exposures to a coadd on a ds9 frame with the specified ctype,
assuming ds9.mtv() has already been called on the given exposure on this frame.


All coordinates are divided by bin, as is right and proper for overlaying on a binned image

Definition at line 309 of file utils.py.

310 def drawCoaddInputs(exposure, frame=None, ctype=None, bin=1):
311  """Draw the bounding boxes of input exposures to a coadd on a ds9 frame with the specified ctype,
312  assuming ds9.mtv() has already been called on the given exposure on this frame.
313 
314 
315  All coordinates are divided by bin, as is right and proper for overlaying on a binned image
316  """
317  coaddWcs = exposure.getWcs()
318  catalog = exposure.getInfo().getCoaddInputs().ccds
319 
320  offset = afwGeom.Point2D() - afwGeom.Point2D(exposure.getXY0())
321  with ds9.Buffering():
322  for record in catalog:
323  ccdBox = afwGeom.Box2D(record.getBBox())
324  ccdCorners = ccdBox.getCorners()
325  coaddCorners = [coaddWcs.skyToPixel(record.getWcs().pixelToSky(point)) + offset
326  for point in ccdCorners]
327  ds9.line([(coaddCorners[i].getX() / bin, coaddCorners[i].getY() / bin)
328  for i in range(-1, 4)], frame=frame, ctype=ctype)
A floating-point coordinate rectangle geometry.
Definition: Box.h:271
def lsst.afw.display.utils.drawFootprint (   foot,
  borderWidth = 0.5,
  origin = None,
  XY0 = None,
  frame = None,
  ctype = None,
  bin = 1,
  peaks = False,
  symb = "+",
  size = 0.4,
  ctypePeak = None 
)
Draw an afwDetection::Footprint on a ds9 frame with the specified ctype.  Include an extra borderWidth
pixels If origin is present, it's Added to the Footprint; if XY0 is present is Subtracted from the Footprint

If peaks is True, also show the object's Peaks using the specified symbol and size and ctypePeak

All Footprint coordinates are divided by bin, as is right and proper for overlaying on a binned image

Definition at line 266 of file utils.py.

267  peaks=False, symb="+", size=0.4, ctypePeak=None):
268  """Draw an afwDetection::Footprint on a ds9 frame with the specified ctype. Include an extra borderWidth
269 pixels If origin is present, it's Added to the Footprint; if XY0 is present is Subtracted from the Footprint
270 
271 If peaks is True, also show the object's Peaks using the specified symbol and size and ctypePeak
272 
273 All Footprint coordinates are divided by bin, as is right and proper for overlaying on a binned image
274  """
275 
276  if XY0:
277  if origin:
278  raise RuntimeError("You may not specify both origin and XY0")
279  origin = (-XY0[0], -XY0[1])
280 
281  with ds9.Buffering():
282  borderWidth /= bin
283  for s in foot.getSpans():
284  y, x0, x1 = s.getY(), s.getX0(), s.getX1()
285 
286  if origin:
287  x0 += origin[0]; x1 += origin[0]
288  y += origin[1]
289 
290  x0 /= bin; x1 /= bin; y /= bin
291 
292  ds9.line([(x0 - borderWidth, y - borderWidth),
293  (x0 - borderWidth, y + borderWidth),
294  (x1 + borderWidth, y + borderWidth),
295  (x1 + borderWidth, y - borderWidth),
296  (x0 - borderWidth, y - borderWidth),
297  ], frame=frame, ctype=ctype)
298 
299  if peaks:
300  for p in foot.getPeaks():
301  x, y = p.getIx(), p.getIy()
302 
303  if origin:
304  x += origin[0]; y += origin[1]
305 
306  x /= bin; y /= bin
307 
308  ds9.dot(symb, x, y, size=size, ctype=ctypePeak, frame=frame)