Looser typing of stage positions in autofocus
This commit is contained in:
parent
b1791833e2
commit
07caa1f05f
1 changed files with 16 additions and 15 deletions
|
|
@ -243,7 +243,7 @@ class SharpnessDataArrays(BaseModel):
|
||||||
jpeg_sizes: NDArray
|
jpeg_sizes: NDArray
|
||||||
focus_foms: NDArray
|
focus_foms: NDArray
|
||||||
stage_times: NDArray
|
stage_times: NDArray
|
||||||
stage_positions: list[dict[str, int]]
|
stage_positions: list[Mapping[str, int]]
|
||||||
|
|
||||||
|
|
||||||
class JPEGSharpnessMonitor:
|
class JPEGSharpnessMonitor:
|
||||||
|
|
@ -453,20 +453,21 @@ class JPEGSharpnessMonitor:
|
||||||
|
|
||||||
def data_to_array(self) -> SharpnessDataArrays:
|
def data_to_array(self) -> SharpnessDataArrays:
|
||||||
"""Return the gathered data as SharpnessDataArrays."""
|
"""Return the gathered data as SharpnessDataArrays."""
|
||||||
data = {}
|
return SharpnessDataArrays(
|
||||||
|
jpeg_times=np.array(self._jpeg_times),
|
||||||
data["jpeg_times"] = self._jpeg_times
|
jpeg_sizes=(
|
||||||
data["stage_times"] = self._stage_times
|
np.array(self._jpeg_sizes)
|
||||||
data["stage_positions"] = self._stage_positions
|
if self.record & SharpnessMethod.JPEG
|
||||||
|
else np.array([])
|
||||||
if self.record & SharpnessMethod.JPEG:
|
),
|
||||||
data["jpeg_sizes"] = self._jpeg_sizes
|
focus_foms=(
|
||||||
|
np.array(self._focus_foms)
|
||||||
if self.record & SharpnessMethod.FOCUS_FOM:
|
if self.record & SharpnessMethod.FOCUS_FOM
|
||||||
data["focus_foms"] = self._focus_foms
|
else np.array([])
|
||||||
else:
|
),
|
||||||
data["focus_foms"] = []
|
stage_times=np.array(self._stage_times),
|
||||||
return SharpnessDataArrays(**data)
|
stage_positions=self._stage_positions,
|
||||||
|
)
|
||||||
|
|
||||||
def data_dict(self) -> dict:
|
def data_dict(self) -> dict:
|
||||||
"""Return the gathered data as dict."""
|
"""Return the gathered data as dict."""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue