SingleFrameNaiveTrailPlugin#
- class lsst.meas.extensions.trailedSources.SingleFrameNaiveTrailPlugin(config, name, schema, metadata, logName=None)#
Bases:
SingleFramePluginNaive trailed source measurement plugin
Measures the length, angle from +x-axis, and end points of an extended source using the second moments.
Parameters#
- config:
SingleFrameNaiveTrailConfig Plugin configuration.
- name:
str Plugin name.
- schema:
lsst.afw.table.Schema Schema for the output catalog.
- metadata:
lsst.daf.base.PropertySet Metadata to be attached to output catalog.
Notes#
This measurement plugin aims to utilize the already measured adaptive second moments to naively estimate the length and angle, and thus end-points, of a fast-moving, trailed source. The length is solved for via finding the root of the difference between the numerical (stack computed) and the analytic adaptive second moments. The angle, theta, from the x-axis is also computed via adaptive moments: theta = arctan(2*Ixy/(Ixx - Iyy))/2. The end points of the trail are then given by (xc +/- (length/2)*cos(theta) and yc +/- (length/2)*sin(theta)), with xc and yc being the centroid coordinates.
See also#
lsst.meas.base.SingleFramePlugin
Methods Summary
check_trail(measRecord, exposure, x0, y0, ...)Set flags for edge pixels, off chip, and nan trail coordinates and flag if trail length is three times larger than psf.
computeLength(Ixx, Iyy)Compute the length of a trail, given unweighted second-moments.
computeRaDec(exposure, x, y)Convert pixel coordinates to RA and Dec.
fail(measRecord[, error])Record failure
findLength(Ixx, Iyy)Find the length of a trail, given adaptive second-moments.
Get the relative execution order of this plugin.
measure(measRecord, exposure)Run the Naive trailed source measurement algorithm.
Methods Documentation
- check_trail(measRecord, exposure, x0, y0, x1, y1, length)#
Set flags for edge pixels, off chip, and nan trail coordinates and flag if trail length is three times larger than psf.
Check if the coordinates of the beginning and ending of the trail fall inside the exposures bounding box. If not, set the off_chip flag. If the beginning or ending falls within a pixel marked as edge, set the edge flag. If any of the coordinates happens to fall on a nan, then set the nan flag. Additionally, check if the trail is three times larger than the psf. If so, set the suspect trail flag.
Parameters#
- measRecord:
lsst.afw.MeasurementRecord Record describing the object being measured.
- exposure:
lsst.afw.Exposure Pixel data to be measured.
- x0:
float x coordinate of the beginning of the trail.
- y0:
float y coordinate of the beginning of the trail.
- x1:
float x coordinate of the end of the trail.
- y1:
float y coordinate of the end of the trail.
- measRecord:
- static computeLength(Ixx, Iyy)#
Compute the length of a trail, given unweighted second-moments.
- static computeRaDec(exposure, x, y)#
Convert pixel coordinates to RA and Dec.
Parameters#
- exposure
lsst.afw.image.ExposureF Exposure object containing the WCS.
- x
float x coordinate of the trail centroid
- y
float y coodinate of the trail centroid
Returns#
- ra
float Right ascension.
- dec
float Declination.
- exposure
- classmethod findLength(Ixx, Iyy)#
Find the length of a trail, given adaptive second-moments.
Uses a root finder to compute the length of a trail corresponding to the adaptive second-moments computed by previous measurements (ie. SdssShape).
Parameters#
- Ixx
float Adaptive second-moment along x-axis.
- Iyy
float Adaptive second-moment along y-axis.
Returns#
- length
float Length of the trail.
- results
scipy.optimize.RootResults Contains messages about convergence from the root finder.
- Ixx
- classmethod getExecutionOrder()#
Get the relative execution order of this plugin.
Must be reimplemented as a class method by concrete derived classes.
- measure(measRecord, exposure)#
Run the Naive trailed source measurement algorithm.
Parameters#
- measRecord
lsst.afw.table.SourceRecord Record describing the object being measured.
- exposure
lsst.afw.image.Exposure Pixel data to be measured.
See also#
lsst.meas.base.SingleFramePlugin.measure
- measRecord
- config: