Apply suggestions from code review of branch recentre-with-rom-methods
Co-authored-by: Richard Bowman <richard.bowman@cantab.net>
This commit is contained in:
parent
b0b755f19b
commit
614fd8b9e9
1 changed files with 6 additions and 1 deletions
|
|
@ -70,7 +70,12 @@ class RomDataTracker:
|
||||||
return self.stage_coords[-1].copy()
|
return self.stage_coords[-1].copy()
|
||||||
|
|
||||||
def fit_axis(self, axis: Literal["x", "y"]) -> np.poly1d:
|
def fit_axis(self, axis: Literal["x", "y"]) -> np.poly1d:
|
||||||
"""Quadratic fit stage coords along and axis (against z) and return poly1d of fit."""
|
"""Quadratic fit stage z against x or y and return poly1d of fit.
|
||||||
|
|
||||||
|
Note that this considers only one of x and y, and ignores the other coordinate. If
|
||||||
|
this function is used on moves where both x and y are changing, it will give misleading
|
||||||
|
results.
|
||||||
|
"""
|
||||||
lateral_positions = [i[axis] for i in self.stage_coords]
|
lateral_positions = [i[axis] for i in self.stage_coords]
|
||||||
z_positions = [i["z"] for i in self.stage_coords]
|
z_positions = [i["z"] for i in self.stage_coords]
|
||||||
fit_params = np.polyfit(lateral_positions, z_positions, 2)
|
fit_params = np.polyfit(lateral_positions, z_positions, 2)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue