LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | List of all members
lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis Class Reference

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

Inheritance diagram for lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis:

Public Member Functions

def __init__
 Constructor. More...
 
def __call__
 Parse information returned from dipole measurement. More...
 
def getSn
 Get the total signal-to-noise of the dipole; total S/N is from positive and negative lobe. More...
 
def getCentroid
 Get the centroid of the dipole; average of positive and negative lobe. More...
 
def getOrientation
 Calculate the orientation of dipole; vector from negative to positive lobe. More...
 
def displayDipoles
 Display debugging information on the detected dipoles. More...
 

Detailed Description

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

Definition at line 362 of file dipoleMeasurement.py.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 364 of file dipoleMeasurement.py.

365  def __init__(self):
366  """!Constructor"""
367  pass

Member Function Documentation

def lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis.__call__ (   self,
  source 
)

Parse information returned from dipole measurement.

Parameters
sourceThe source that will be examined

Definition at line 368 of file dipoleMeasurement.py.

369  def __call__(self, source):
370  """!Parse information returned from dipole measurement
371 
372  @param source The source that will be examined"""
373  return self.getSn(source), self.getCentroid(source), self.getOrientation(source)
def getCentroid
Get the centroid of the dipole; average of positive and negative lobe.
def __call__
Parse information returned from dipole measurement.
def getOrientation
Calculate the orientation of dipole; vector from negative to positive lobe.
def getSn
Get the total signal-to-noise of the dipole; total S/N is from positive and negative lobe...
def lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis.displayDipoles (   self,
  exposure,
  sources 
)

Display debugging information on the detected dipoles.

Parameters
exposureImage the dipoles were measured on
sourcesThe set of diaSources that were measured

Definition at line 422 of file dipoleMeasurement.py.

423  def displayDipoles(self, exposure, sources):
424  """!Display debugging information on the detected dipoles
425 
426  @param exposure Image the dipoles were measured on
427  @param sources The set of diaSources that were measured"""
428 
429  import lsstDebug
430  display = lsstDebug.Info(__name__).display
431  displayDiaSources = lsstDebug.Info(__name__).displayDiaSources
432  maskTransparency = lsstDebug.Info(__name__).maskTransparency
433  if not maskTransparency:
434  maskTransparency = 90
435  ds9.setMaskTransparency(maskTransparency)
436  ds9.mtv(exposure, frame=lsstDebug.frame)
437 
438  if display and displayDiaSources:
439  with ds9.Buffering():
440  for source in sources:
441  cenX, cenY = source.get("ipdiffim_DipolePsfFlux_centroid")
442  if np.isinf(cenX) or np.isinf(cenY):
443  cenX, cenY = source.getCentroid()
444 
445  isdipole = source.get("classification.dipole")
446  if isdipole and np.isfinite(isdipole):
447  # Dipole
448  ctype= "green"
449  else:
450  # Not dipole
451  ctype = "red"
452 
453  ds9.dot("o", cenX, cenY, size=2, ctype=ctype, frame=lsstDebug.frame)
454 
455  negCenX = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_x")
456  negCenY = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_y")
457  posCenX = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_x")
458  posCenY = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_y")
459  if (np.isinf(negCenX) or np.isinf(negCenY) or np.isinf(posCenX) or np.isinf(posCenY)):
460  continue
461 
462  ds9.line([(negCenX, negCenY), (posCenX, posCenY)], ctype="yellow", frame=lsstDebug.frame)
463 
464  lsstDebug.frame += 1
465 
466 
def displayDipoles
Display debugging information on the detected dipoles.
def lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis.getCentroid (   self,
  source 
)

Get the centroid of the dipole; average of positive and negative lobe.

Parameters
sourceThe source that will be examined

Definition at line 390 of file dipoleMeasurement.py.

391  def getCentroid(self, source):
392  """!Get the centroid of the dipole; average of positive and negative lobe
393 
394  @param source The source that will be examined"""
395 
396  negCenX = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_x")
397  negCenY = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_y")
398  posCenX = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_x")
399  posCenY = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_y")
400  if (np.isinf(negCenX) or np.isinf(negCenY) or np.isinf(posCenX) or np.isinf(posCenY)):
401  return None
402 
403  center = afwGeom.Point2D(0.5*(negCenX+posCenX),
404  0.5*(negCenY+posCenY))
405  return center
def getCentroid
Get the centroid of the dipole; average of positive and negative lobe.
def lsst.ip.diffim.dipoleMeasurement.DipoleAnalysis.getOrientation (   self,
  source 
)

Calculate the orientation of dipole; vector from negative to positive lobe.

Parameters
sourceThe source that will be examined

Definition at line 406 of file dipoleMeasurement.py.

407  def getOrientation(self, source):
408  """!Calculate the orientation of dipole; vector from negative to positive lobe
409 
410  @param source The source that will be examined"""
411 
412  negCenX = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_x")
413  negCenY = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_y")
414  posCenX = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_x")
415  posCenY = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_y")
416  if (np.isinf(negCenX) or np.isinf(negCenY) or np.isinf(posCenX) or np.isinf(posCenY)):
417  return None
418 
419  dx, dy = posCenX-negCenX, posCenY-negCenY
420  angle = afwGeom.Angle(np.arctan2(dx, dy), afwGeom.radians)
421  return angle
def getOrientation
Calculate the orientation of dipole; vector from negative to positive lobe.
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
sourceThe source that will be examined

Definition at line 374 of file dipoleMeasurement.py.

375  def getSn(self, source):
376  """!Get the total signal-to-noise of the dipole; total S/N is from positive and negative lobe
377 
378  @param source The source that will be examined"""
379 
380  posflux = source.get("ip_diffim_PsfDipoleFlux_pos_flux")
381  posfluxErr = source.get("ip_diffim_PsfDipoleFlux_pos_fluxSigma")
382  negflux = source.get("ip_diffim_PsfDipoleFlux_neg_flux")
383  negfluxErr = source.get("ip_diffim_PsfDipoleFlux_neg_fluxSigma")
384 
385  # Not a dipole!
386  if (posflux < 0) is (negflux < 0):
387  return 0
388 
389  return np.sqrt((posflux/posfluxErr)**2 + (negflux/negfluxErr)**2)
def getSn
Get the total signal-to-noise of the dipole; total S/N is from positive and negative lobe...

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