LSST Applications g0265f82a02+0e5473021a,g02d81e74bb+0dd8ce4237,g1470d8bcf6+3ea6592b6f,g2079a07aa2+86d27d4dc4,g2305ad1205+5ca4c0b359,g295015adf3+d10818ec9d,g2a9a014e59+6f9be1b9cd,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g3ddfee87b4+703ba97ebf,g487adcacf7+4fa16da234,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+ffa42b374e,g5a732f18d5+53520f316c,g64a986408d+0dd8ce4237,g858d7b2824+0dd8ce4237,g8a8a8dda67+585e252eca,g99cad8db69+d39438377f,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+f1d96605c8,gb0e22166c9+60f28cb32d,gb6a65358fc+0e5473021a,gba4ed39666+c2a2e4ac27,gbb8dafda3b+e5339d463f,gc120e1dc64+da31e9920e,gc28159a63d+0e5473021a,gcf0d15dbbd+703ba97ebf,gdaeeff99f8+f9a426f77a,ge6526c86ff+889fc9d533,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gf18bd8381d+7268b93478,gff1a9f87cc+0dd8ce4237,w.2024.16
LSST Data Management Base Package
Loading...
Searching...
No Matches
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

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

Detailed Description

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

Definition at line 168 of file dipoleMeasurement.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 171 of file dipoleMeasurement.py.

171 def __init__(self):
172 pass
173

Member Function Documentation

◆ __call__()

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 174 of file dipoleMeasurement.py.

174 def __call__(self, source):
175 """Parse information returned from dipole measurement
176
177 Parameters
178 ----------
179 source : `lsst.afw.table.SourceRecord`
180 The source that will be examined"""
181 return self.getSn(source), self.getCentroid(source), self.getOrientation(source)
182

◆ displayDipoles()

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 240 of file dipoleMeasurement.py.

240 def displayDipoles(self, exposure, sources):
241 """Display debugging information on the detected dipoles
242
243 Parameters
244 ----------
245 exposure : `lsst.afw.image.Exposure`
246 Image the dipoles were measured on
247 sources : `lsst.afw.table.SourceCatalog`
248 The set of diaSources that were measured"""
249
250 import lsstDebug
251 display = lsstDebug.Info(__name__).display
252 displayDiaSources = lsstDebug.Info(__name__).displayDiaSources
253 maskTransparency = lsstDebug.Info(__name__).maskTransparency
254 if not maskTransparency:
255 maskTransparency = 90
256 disp = afwDisplay.Display(frame=lsstDebug.frame)
257 disp.setMaskTransparency(maskTransparency)
258 disp.mtv(exposure)
259
260 if display and displayDiaSources:
261 with disp.Buffering():
262 for source in sources:
263 cenX, cenY = source.get("ipdiffim_DipolePsfFlux_centroid")
264 if np.isinf(cenX) or np.isinf(cenY):
265 cenX, cenY = source.getCentroid()
266
267 isdipole = source.get("ip_diffim_ClassificationDipole_value")
268 if isdipole and np.isfinite(isdipole):
269 # Dipole
270 ctype = afwDisplay.GREEN
271 else:
272 # Not dipole
273 ctype = afwDisplay.RED
274
275 disp.dot("o", cenX, cenY, size=2, ctype=ctype)
276
277 negCenX = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_x")
278 negCenY = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_y")
279 posCenX = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_x")
280 posCenY = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_y")
281 if (np.isinf(negCenX) or np.isinf(negCenY) or np.isinf(posCenX) or np.isinf(posCenY)):
282 continue
283
284 disp.line([(negCenX, negCenY), (posCenX, posCenY)], ctype=afwDisplay.YELLOW)
285
286 lsstDebug.frame += 1
287
288

◆ getCentroid()

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 202 of file dipoleMeasurement.py.

202 def getCentroid(self, source):
203 """Get the centroid of the dipole; average of positive and negative lobe
204
205 Parameters
206 ----------
207 source : `lsst.afw.table.SourceRecord`
208 The source that will be examined"""
209
210 negCenX = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_x")
211 negCenY = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_y")
212 posCenX = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_x")
213 posCenY = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_y")
214 if (np.isinf(negCenX) or np.isinf(negCenY) or np.isinf(posCenX) or np.isinf(posCenY)):
215 return None
216
217 center = geom.Point2D(0.5*(negCenX+posCenX),
218 0.5*(negCenY+posCenY))
219 return center
220

◆ getOrientation()

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 221 of file dipoleMeasurement.py.

221 def getOrientation(self, source):
222 """Calculate the orientation of dipole; vector from negative to positive lobe
223
224 Parameters
225 ----------
226 source : `lsst.afw.table.SourceRecord`
227 The source that will be examined"""
228
229 negCenX = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_x")
230 negCenY = source.get("ip_diffim_PsfDipoleFlux_neg_centroid_y")
231 posCenX = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_x")
232 posCenY = source.get("ip_diffim_PsfDipoleFlux_pos_centroid_y")
233 if (np.isinf(negCenX) or np.isinf(negCenY) or np.isinf(posCenX) or np.isinf(posCenY)):
234 return None
235
236 dx, dy = posCenX-negCenX, posCenY-negCenY
237 angle = geom.Angle(np.arctan2(dx, dy), geom.radians)
238 return angle
239
A class representing an angle.
Definition Angle.h:128

◆ getSn()

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 183 of file dipoleMeasurement.py.

183 def getSn(self, source):
184 """Get the total signal-to-noise of the dipole; total S/N is from positive and negative lobe
185
186 Parameters
187 ----------
188 source : `lsst.afw.table.SourceRecord`
189 The source that will be examined"""
190
191 posflux = source.get("ip_diffim_PsfDipoleFlux_pos_instFlux")
192 posfluxErr = source.get("ip_diffim_PsfDipoleFlux_pos_instFluxErr")
193 negflux = source.get("ip_diffim_PsfDipoleFlux_neg_instFlux")
194 negfluxErr = source.get("ip_diffim_PsfDipoleFlux_neg_instFluxErr")
195
196 # Not a dipole!
197 if (posflux < 0) is (negflux < 0):
198 return 0
199
200 return np.sqrt((posflux/posfluxErr)**2 + (negflux/negfluxErr)**2)
201

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