|
lsst.meas.algorithms gc86a7ac1bc+215fc79fec
|
Classes | |
| class | FittedLine |
| class | FindGlintTrailsConfig |
| class | GlintTrailParameters |
| class | FindGlintTrailsTask |
Functions | |
| fit_line (x, y) | |
| _ransac_line (x, y, threshold, min_samples, seed, max_trials=100) | |
|
protected |
Fit a line to points that may include outliers, using RANSAC.
Each trial fits a line to ``min_samples`` randomly chosen points. The
trial with the most points within ``threshold`` of its line wins, with
ties going to the smaller summed squared distance. The line is iteratively
refit with new selections of inliers until the results stop changing, so
that every inlier is within ``threshold`` pixels of the returned line.
Parameters
----------
x, y : `numpy.ndarray`
Coordinates of the points.
threshold : `float`
Maximum perpendicular distance of an inlier from the line.
min_samples : `int`
Number of points each trial line is fit to.
seed : `int`
Seed for the random choice of points, so that fits are repeatable.
max_trials : `int`, optional
Maximum number of trial lines.
Returns
-------
line : `FittedLine` or `None`
The line fit to the inliers, or `None` if fewer than ``min_samples``
points are inliers.
inliers : `numpy.ndarray` [`bool`] or `None`
Which of the points lie within ``threshold`` of ``line``.
Definition at line 93 of file findGlintTrails.py.
| fit_line | ( | x, | |
| y ) |
Fit the line that minimizes the summed squared perpendicular distances
of points from it.
Unlike a regression of ``y`` on ``x``, this fits lines at any angle,
including vertical ones, equally well.
Parameters
----------
x, y : `numpy.ndarray`
Coordinates of at least two points.
Returns
-------
line : `FittedLine`
The fitted line.
Definition at line 70 of file findGlintTrails.py.