Skip to content
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

Tickets/DM-45823: Establish um as the unit for hexapod offsets in BaseFocusSweep and implement conversion to mm for auxtel in FocusSweepLatiss #233

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

MarcoRocchietti
Copy link
Contributor

No description provided.

…plement conversion to mm for auxtel in FocusSweepLatiss

- The `focus_window` and `focus_step_sequence` attributes of `BaseFocusSweep`
  are measured in um.

- A conversion to mm has been added for `focus_window` and
  `focus_step_sequence` in the configure method of `FocusSweepLatiss`.

- No conversion is needed for maintel, as um is the expected unit for hexapod
  offsets.
Copy link
Member

@tribeiro tribeiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I only have one comment about how you log things in the configure file. Please, take a look before merging.

Script configuration, as defined by `schema`.
"""
await super().configure(config=config)
self.log.debug("Applying unit translation from um to mm for ATHexapod use.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, merge these 3 debug calls together... In our system, calls to log will be sent to the control system and stored in the EFD. Having 3 consecutive calls to log is way more expensive than having only one. Also, note that you can use multiline string to format the text, and make it an f-string, e.g.:

self.log.debug(f"""Applying unit conversion from um to mm for ATHexapod use.

Original values in um from base class configuration are:

    focus_window = {self.config.focus_window} um
    focus_step_sequence = {self.config.focus_step_sequence} um

Converted values:
    focus_window = {self.config.focus_window} mm
    focus_step_sequence = {self.config.focus_step_sequence} mm
"""
)

Note that I replaced "translation" with "conversion" above.

@MarcoRocchietti MarcoRocchietti merged commit 4f60789 into develop Oct 18, 2024
2 checks passed
@MarcoRocchietti MarcoRocchietti deleted the tickets/DM-45823 branch October 18, 2024 20:25
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.

2 participants