-
Notifications
You must be signed in to change notification settings - Fork 11
ASI RFVC Changes to be merged in Navigate #1099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Bringing all of the pieces into develop for packaging purposes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request integrates RFVC changes to support ASI devices within the Navigate codebase while removing deprecated implementations. Key changes include:
- Addition of a new ASI Remote Focus module with updated waveform handling.
- Minor type annotation improvements in the ASI Laser class.
- Removal of the obsolete ASI Galvo module and corresponding documentation/configuration updates.
- Updates to Tiger Controller command formatting for consistency.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/navigate/model/devices/remote_focus/asi.py | Implements the new ASI Remote Focus driver and waveform methods. |
src/navigate/model/devices/laser/asi.py | Fixes type annotation for the device_id parameter. |
src/navigate/model/devices/galvo/asi.py | Deletes the obsolete ASI Galvo driver file. |
src/navigate/model/devices/APIs/asi/asi_tiger_controller.py | Updates Tiger Controller commands (e.g., SA_waveform and SAM) with revised command prefixes. |
src/navigate/config/configuration_database.py | Adds configuration support for ASI devices including an axis widget field. |
docs/source/02_user_guide/01_supported_hardware/remote_focus.rst | Updates documentation to include ASI hardware details and configuration examples. |
Comments suppressed due to low confidence (1)
src/navigate/model/devices/galvo/asi.py:1
- Ensure that any dependencies or references to the deleted ASI Galvo module are removed from the codebase to prevent broken references.
# Copyright (c) 2021-2024 The University of Texas Southwestern Medical Center.
if temp == "-" or temp == ".": | ||
waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | ||
laser | ||
]["amplitude"] = "1000" | ||
|
||
amplitude = float( | ||
waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | ||
laser | ||
]["amplitude"] | ||
) | ||
|
||
# Validation for when user puts a '-' in spinbox | ||
temp = waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | ||
laser | ||
]["offset"] | ||
if temp == "-" or temp == ".": | ||
waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | ||
laser | ||
]["offset"] = "0" | ||
|
||
remote_focus_offset = float( | ||
waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | ||
laser | ||
]["offset"] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider storing numeric constants as numbers rather than as strings in waveform_constants (e.g., using 1000 instead of "1000") to reduce the need for type conversion and improve clarity.
if temp == "-" or temp == ".": | |
waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | |
laser | |
]["amplitude"] = "1000" | |
amplitude = float( | |
waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | |
laser | |
]["amplitude"] | |
) | |
# Validation for when user puts a '-' in spinbox | |
temp = waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | |
laser | |
]["offset"] | |
if temp == "-" or temp == ".": | |
waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | |
laser | |
]["offset"] = "0" | |
remote_focus_offset = float( | |
waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | |
laser | |
]["offset"] | |
) | |
if temp in ["-", "."]: | |
waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | |
laser | |
]["amplitude"] = 1000 | |
amplitude = waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | |
laser | |
]["amplitude"] | |
# Validation for when user puts a '-' in spinbox | |
temp = waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | |
laser | |
]["offset"] | |
if temp in ["-", "."]: | |
waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | |
laser | |
]["offset"] = 0 | |
remote_focus_offset = waveform_constants["remote_focus_constants"][imaging_mode][zoom][ | |
laser | |
]["offset"] |
Copilot uses AI. Check for mistakes.
""" | ||
|
||
"Verify if this is for synchronous or asynchronous" | ||
self.send_command(f"SAP {axis}={waveform}") | ||
print(f"Period (ms): {frequency}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove or replace the debug print statement with proper logging to avoid unintended console output in production.
print(f"Period (ms): {frequency}") | |
logging.debug(f"Period (ms): {frequency}") |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adopt recommended change to log this information, not print it to the console.
@@ -1013,28 +1013,49 @@ def logic_card_off(self, axis : str): | |||
self.send_command(f'6 CCA Z=0\r') | |||
self.read_response() | |||
|
|||
def SA_waveform(self, axis:str, waveform=0, amplitude=1000, offset=500): | |||
def logic_cell_on(self, axis : str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add numpydoc commenting
|
||
elif self.galvo_waveform == "sine": | ||
frequency=galvo_frequency | ||
amplitude=galvo_amplitude |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ASI galvo does not support these waveforms, or does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we support sine waves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only minor changes requested. See line comments.
Bringing in the related RFVC things to parent Navigate. The PR says I'll be deleting a file from y'all's repository, but I do not believe that file exists, so hopefully that's not an issue.