Return combined xy-coordinate array with arbitrary dimensions in predict_xy

This commit is contained in:
Johannes Schönberger
2013-05-01 11:15:47 +02:00
parent b58f52e40e
commit c1bb30f625
+6 -10
View File
@@ -277,10 +277,8 @@ class CircleModel(BaseModel):
Returns
-------
x : array
Predicted x-coordinates.
y : array
Predicted y-coordinates.
xy : (..., 2) array
Predicted x- and y-coordinates.
'''
if params is None:
@@ -290,7 +288,7 @@ class CircleModel(BaseModel):
x = xc + r * np.cos(t)
y = yc + r * np.sin(t)
return x, y
return np.concatenate((x[..., None], y[..., None]), axis=t.ndim)
class EllipseModel(BaseModel):
@@ -483,10 +481,8 @@ class EllipseModel(BaseModel):
Returns
-------
x : array
Predicted x-coordinates.
y : array
Predicted y-coordinates.
xy : (..., 2) array
Predicted x- and y-coordinates.
'''
@@ -502,7 +498,7 @@ class EllipseModel(BaseModel):
x = xc + a * ctheta * ct - b * stheta * st
y = yc + a * stheta * ct + b * ctheta * st
return x, y
return np.concatenate((x[..., None], y[..., None]), axis=t.ndim)
def ransac(data, model_class, min_samples, residual_threshold,