1
This commit is contained in:
@@ -408,7 +408,7 @@ microscopes:
|
|||||||
|
|
||||||
camera:
|
camera:
|
||||||
hardware:
|
hardware:
|
||||||
type: Andor Test Camera
|
type: Andor
|
||||||
serial_number: 0
|
serial_number: 0
|
||||||
defect_correct_mode: 2.0
|
defect_correct_mode: 2.0
|
||||||
delay: 1.0
|
delay: 1.0
|
||||||
@@ -454,6 +454,7 @@ microscopes:
|
|||||||
hardware:
|
hardware:
|
||||||
-
|
-
|
||||||
type: synthetic
|
type: synthetic
|
||||||
|
serial_number: 000000
|
||||||
axes: [x, y, z, theta, f]
|
axes: [x, y, z, theta, f]
|
||||||
axes_mapping: [1, 2, 3, 4, 5]
|
axes_mapping: [1, 2, 3, 4, 5]
|
||||||
min: 0.0
|
min: 0.0
|
||||||
|
|||||||
@@ -509,3 +509,31 @@ class AndorCamera(CameraBase):
|
|||||||
|
|
||||||
def set_readout_direction(self, mode) -> None:
|
def set_readout_direction(self, mode) -> None:
|
||||||
super().set_readout_direction(mode)
|
super().set_readout_direction(mode)
|
||||||
|
|
||||||
|
def generate_new_frame(self) -> None:
|
||||||
|
"""Generate a synthetic image for testing with synthetic DAQ.
|
||||||
|
|
||||||
|
This method is called by SyntheticDAQ when running in synthetic hardware mode.
|
||||||
|
It generates a random test image and copies it to the data buffer.
|
||||||
|
"""
|
||||||
|
if not self.is_acquiring or self.data_buffer is None:
|
||||||
|
return
|
||||||
|
|
||||||
|
# Generate random noise image
|
||||||
|
image = np.random.normal(
|
||||||
|
100, # mean background
|
||||||
|
20, # standard deviation (noise)
|
||||||
|
size=(self.y_pixels, self.x_pixels),
|
||||||
|
).astype(np.uint16)
|
||||||
|
|
||||||
|
# Ensure values are in valid uint16 range
|
||||||
|
image = np.clip(image, 0, 65535)
|
||||||
|
|
||||||
|
# Copy to buffer
|
||||||
|
ctypes.memmove(
|
||||||
|
self.data_buffer[self.current_frame_idx].ctypes.data,
|
||||||
|
image.ctypes.data,
|
||||||
|
self.x_pixels * self.y_pixels * 2,
|
||||||
|
)
|
||||||
|
|
||||||
|
self.current_frame_idx = (self.current_frame_idx + 1) % self.num_of_frame
|
||||||
|
|||||||
Reference in New Issue
Block a user