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.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: