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.ip.diffim.dipoleMeasurement.DipoleAnalysis Class Reference
Inheritance diagram for lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis:

Public Member Functions

def __init__ (self)
 
def __call__ (self, source)
 
def getSn (self, source)
 
def getCentroid (self, source)
 
def getOrientation (self, source)
 
def displayDipoles (self, exposure, sources)
 

Detailed Description

Functor class that provides (S/N, position, orientation) of measured dipoles

Definition at line 377 of file dipoleMeasurement.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis.__init__ (   self)

Definition at line 380 of file dipoleMeasurement.py.

380  def __init__(self):
381  pass
382 

Member Function Documentation

◆ __call__()

def lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis.__call__ (   self,
  source 
)
Parse information returned from dipole measurement

Parameters
----------
source : `lsst.afw.table.SourceRecord`
    The source that will be examined

Definition at line 383 of file dipoleMeasurement.py.

383  def __call__(self, source):
384  """Parse information returned from dipole measurement
385 
386  Parameters
387  ----------
388  source : `lsst.afw.table.SourceRecord`
389  The source that will be examined"""
390  return self.getSn(source), self.getCentroid(source), self.getOrientation(source)
391 

◆ displayDipoles()

def lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis.displayDipoles (   self,
  exposure,
  sources 
)
Display debugging information on the detected dipoles

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Image the dipoles were measured on
sources : `lsst.afw.table.SourceCatalog`
    The set of diaSources that were measured

Definition at line 449 of file dipoleMeasurement.py.

449  def displayDipoles(self, exposure, sources):
450  """Display debugging information on the detected dipoles
451 
452  Parameters
453  ----------
454  exposure : `lsst.afw.image.Exposure`
455  Image the dipoles were measured on
456  sources : `lsst.afw.table.SourceCatalog`
457  The set of diaSources that were measured"""
458 
459  import lsstDebug
460  display = lsstDebug.Info(__name__).display
461  displayDiaSources = lsstDebug.Info(__name__).displayDiaSources
462  maskTransparency = lsstDebug.Info(__name__).maskTransparency
463  if not maskTransparency:
464  maskTransparency = 90
465  disp = afwDisplay.Display(frame=lsstDebug.frame)
466  disp.setMaskTransparency(maskTransparency)
467  disp.mtv(exposure)
468 
469  if display and displayDiaSources:
470  with disp.Buffering():
471  for source in sources:
472  cenX, cenY = source.get("ipdiffim_DipolePsfFlux_centroid")
473  if np.isinf(cenX) or np.isinf(cenY):
474  cenX, cenY = source.getCentroid()
475 
476  isdipole = source.get("ip_diffim_ClassificationDipole_value")
477  if isdipole and np.isfinite(isdipole):
478  # Dipole
479  ctype = afwDisplay.GREEN
480  else:
481  # Not dipole
482  ctype = afwDisplay.RED
483 
484  disp.dot("o", cenX, cenY, size=2, ctype=ctype)
485 
486  negCenX = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_x")
487  negCenY = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_y")
488  posCenX = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_x")
489  posCenY = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_y")
490  if (np.isinf(negCenX) or np.isinf(negCenY) or np.isinf(posCenX) or np.isinf(posCenY)):
491  continue
492 
493  disp.line([(negCenX, negCenY), (posCenX, posCenY)], ctype=afwDisplay.YELLOW)
494 
495  lsstDebug.frame += 1
496 
497 

◆ getCentroid()

def lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis.getCentroid (   self,
  source 
)
Get the centroid of the dipole; average of positive and negative lobe

Parameters
----------
source : `lsst.afw.table.SourceRecord`
    The source that will be examined

Definition at line 411 of file dipoleMeasurement.py.

411  def getCentroid(self, source):
412  """Get the centroid of the dipole; average of positive and negative lobe
413 
414  Parameters
415  ----------
416  source : `lsst.afw.table.SourceRecord`
417  The source that will be examined"""
418 
419  negCenX = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_x")
420  negCenY = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_y")
421  posCenX = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_x")
422  posCenY = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_y")
423  if (np.isinf(negCenX) or np.isinf(negCenY) or np.isinf(posCenX) or np.isinf(posCenY)):
424  return None
425 
426  center = geom.Point2D(0.5*(negCenX+posCenX),
427  0.5*(negCenY+posCenY))
428  return center
429 

◆ getOrientation()

def lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis.getOrientation (   self,
  source 
)
Calculate the orientation of dipole; vector from negative to positive lobe

Parameters
----------
source : `lsst.afw.table.SourceRecord`
    The source that will be examined

Definition at line 430 of file dipoleMeasurement.py.

430  def getOrientation(self, source):
431  """Calculate the orientation of dipole; vector from negative to positive lobe
432 
433  Parameters
434  ----------
435  source : `lsst.afw.table.SourceRecord`
436  The source that will be examined"""
437 
438  negCenX = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_x")
439  negCenY = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_y")
440  posCenX = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_x")
441  posCenY = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_y")
442  if (np.isinf(negCenX) or np.isinf(negCenY) or np.isinf(posCenX) or np.isinf(posCenY)):
443  return None
444 
445  dx, dy = posCenX-negCenX, posCenY-negCenY
446  angle = geom.Angle(np.arctan2(dx, dy), geom.radians)
447  return angle
448 
A class representing an angle.
Definition: Angle.h:127

◆ getSn()

def lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis.getSn (   self,
  source 
)
Get the total signal-to-noise of the dipole; total S/N is from positive and negative lobe

Parameters
----------
source : `lsst.afw.table.SourceRecord`
    The source that will be examined

Definition at line 392 of file dipoleMeasurement.py.

392  def getSn(self, source):
393  """Get the total signal-to-noise of the dipole; total S/N is from positive and negative lobe
394 
395  Parameters
396  ----------
397  source : `lsst.afw.table.SourceRecord`
398  The source that will be examined"""
399 
400  posflux = source.get("ip_diffim_PsfDipoleFlux_pos_instFlux")
401  posfluxErr = source.get("ip_diffim_PsfDipoleFlux_pos_instFluxErr")
402  negflux = source.get("ip_diffim_PsfDipoleFlux_neg_instFlux")
403  negfluxErr = source.get("ip_diffim_PsfDipoleFlux_neg_instFluxErr")
404 
405  # Not a dipole!
406  if (posflux < 0) is (negflux < 0):
407  return 0
408 
409  return np.sqrt((posflux/posfluxErr)**2 + (negflux/negfluxErr)**2)
410 

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