Skip to content

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

Open
wants to merge 74 commits into
base: develop
Choose a base branch
from

Conversation

Daniel-Buckelew
Copy link
Contributor

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.

EashaS and others added 30 commits March 20, 2025 23:29
…etagivan into asi_daq"

This reverts commit e401072, reversing
changes made to fa48620.
Copy link
Contributor

@Copilot Copilot AI left a 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.

Comment on lines +190 to +214
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"]
)
Copy link
Preview

Copilot AI Jun 5, 2025

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.

Suggested change
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}")
Copy link
Preview

Copilot AI Jun 5, 2025

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.

Suggested change
print(f"Period (ms): {frequency}")
logging.debug(f"Period (ms): {frequency}")

Copilot uses AI. Check for mistakes.

Copy link
Collaborator

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):
Copy link
Collaborator

@AdvancedImagingUTSW AdvancedImagingUTSW Jun 5, 2025

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
Copy link
Collaborator

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?

Copy link
Collaborator

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.

Copy link
Collaborator

@AdvancedImagingUTSW AdvancedImagingUTSW left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants