Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e05aab9
search laser spot
Alpaca233 Nov 26, 2025
ae4c663
piezo
Alpaca233 Jan 7, 2026
8e87c55
intensity profile cross correlation check
Alpaca233 Jan 8, 2026
9714f28
fix callers
Alpaca233 Jan 8, 2026
955a660
rmse
Alpaca233 Jan 9, 2026
a1adf46
debug
Alpaca233 Jan 9, 2026
edcc32f
bug fix: crop
Alpaca233 Jan 9, 2026
b3c7f62
debug plot
Alpaca233 Jan 9, 2026
b253d8d
test: new normalization method
Alpaca233 Jan 9, 2026
425db31
use simple rmse
Alpaca233 Jan 9, 2026
7afb4e4
debug plot
Alpaca233 Jan 9, 2026
39b663b
normalization fix
Alpaca233 Jan 11, 2026
18b8f05
logging
Alpaca233 Jan 11, 2026
2a49f60
normalization fix
Alpaca233 Jan 11, 2026
9a7bff5
normalization fi
Alpaca233 Jan 11, 2026
b3a15a9
normalization fix
Alpaca233 Jan 11, 2026
7aa1457
revert normalization
Alpaca233 Jan 11, 2026
5a9678c
replace line profile spot detection with connected components method
Alpaca233 Jan 13, 2026
07b4db4
fix spot detection during initialization and search
Alpaca233 Jan 14, 2026
d56f48e
add debug image saving for laser AF characterization mode
Alpaca233 Jan 15, 2026
22accfc
remove redundant 3rd debug image save, fix signal type
Alpaca233 Jan 17, 2026
8e4e00c
separate debug_image from image for characterization mode saves
Alpaca233 Jan 19, 2026
c634a9b
add aspect ratio filter, update filter sigma default, use pixel-based…
Alpaca233 Jan 19, 2026
26ab573
Add piezo settling delay and Gaussian filtering for CC verification
Alpaca233 Jan 20, 2026
7183792
Fix KeyError for displacement_success_window_um in widgets.py
Alpaca233 Jan 20, 2026
cd46594
Fix CC verification to crop around reference position instead of dete…
Alpaca233 Jan 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions software/control/_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,21 +599,25 @@ class SOFTWARE_POS_LIMIT:
LASER_AF_CROP_HEIGHT = 256
LASER_AF_SPOT_DETECTION_MODE = SpotDetectionMode.DUAL_LEFT.value
LASER_AF_RANGE = 100
DISPLACEMENT_SUCCESS_WINDOW_UM = 1.0
DISPLACEMENT_SUCCESS_WINDOW_PIXELS = 300 # Max displacement from reference x to accept detection (pixels)
SPOT_CROP_SIZE = 100
CORRELATION_THRESHOLD = 0.7
PIXEL_TO_UM_CALIBRATION_DISTANCE = 6.0
LASER_AF_Y_WINDOW = 96
LASER_AF_X_WINDOW = 20
LASER_AF_MIN_PEAK_WIDTH = 10
LASER_AF_MIN_PEAK_DISTANCE = 10
LASER_AF_MIN_PEAK_PROMINENCE = 0.20
LASER_AF_SPOT_SPACING = 100
# Connected component spot detection parameters
LASER_AF_CC_THRESHOLD = 8 # Intensity threshold for binarization
LASER_AF_CC_MIN_AREA = 5 # Minimum component area in pixels
LASER_AF_CC_MAX_AREA = 5000 # Maximum component area in pixels
LASER_AF_CC_ROW_TOLERANCE = 50 # Allowed deviation from expected row (pixels)
LASER_AF_CC_MAX_ASPECT_RATIO = 2.5 # Maximum aspect ratio (width/height or height/width)
SHOW_LEGACY_DISPLACEMENT_MEASUREMENT_WINDOWS = False
LASER_AF_FILTER_SIGMA = None
LASER_AF_FILTER_SIGMA = 1 # Sigma for Gaussian filter before spot detection
LASER_AF_INITIALIZE_CROP_WIDTH = 1200
LASER_AF_INITIALIZE_CROP_HEIGHT = 800

LASER_AF_SEARCH_DOWN_FIRST = (
True # If True, search downward (smaller z values) first then upward; if False, search upward first
)

MULTIPOINT_REFLECTION_AUTOFOCUS_ENABLE_BY_DEFAULT = False
MULTIPOINT_CONTRAST_AUTOFOCUS_ENABLE_BY_DEFAULT = False

Expand Down
5 changes: 4 additions & 1 deletion software/control/core/laser_af_settings_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def get_laser_af_settings(self) -> Dict[str, Any]:
return self.autofocus_configurations

def update_laser_af_settings(
self, objective: str, updates: Dict[str, Any], crop_image: Optional[np.ndarray] = None
self,
objective: str,
updates: Dict[str, Any],
crop_image: Optional[np.ndarray] = None,
) -> None:
if objective not in self.autofocus_configurations:
self.autofocus_configurations[objective] = LaserAFConfig(**updates)
Expand Down
Loading