-
Notifications
You must be signed in to change notification settings - Fork 0
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-46864: Take AOS Sequence #230
Conversation
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 creating an enumeration to hold the valid values for the mode
.
Then you can compare enum values instead of strings, which will make it more readable and easy to update.
you could have something like:
class Mode(enum.IntEnum):
TRIPLET = enum.auto()
INTRA = enum.auto()
EXTRA = enum.auto()
Then in the configuration you could do something like this.
schema_yaml = f"""
...
mode:
description: >-
Mode of operation. Options are 'triplet' (default), 'intra' or 'extra'.
type: str
default: 'triplet'
enum: {[mode for mode in Mode]}
Then, you will have to covert the value to a mode enum:
self.mode = getattr(Mode, config.mode)
and then compare mode to the enum values instead of strings, e.g:
if self.mode == Mode.TRIPLET or self.mode == Mode.INTRA:
...
# plus estimation on reading out the images (10s) | ||
number_of_images = 3 if self.mode == "triplet" else 2 |
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.
Should be
number_of_images = 3 if self.mode == Mode.TRIPLET else 2
await self.mtcs.offset_camera_hexapod(x=0, y=0, z=self.dz, u=0, v=0) | ||
|
||
self.log.info("Taking intra-focal image") | ||
async def take_out_of_focus_sequence(self) -> None: |
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.
Maybe take_aos_sequence
?
|
||
# Move the hexapod back to in focus position | ||
await self.mtcs.offset_camera_hexapod(x=0, y=0, z=self.dz, u=0, v=0) | ||
async def take_cwfs_image(self, reason_suffix: str) -> int: |
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.
I don't see the value of having this method here. Why not just call self.camera.take_cwfs
directly? note that, because this is a method, you need to add self.supplemented_group_id
as a class attribute. I suggest you get rid of this method (and also remove self.supplemented_group_id
in favor of a local variable. If you really want to have a method to encapsulate this operation (it does make the inline call leaner), pass supplemented_group_id
alongside reason_suffix
instead of relying on a class attribute.
self.log.info(f"Starting triplet {i+1} of {self.n_triplets}") | ||
await self.checkpoint(f"triplet {i+1} of {self.n_triplets}") | ||
for i in range(self.n_sequences): | ||
self.log.info(f"Starting out-of-focus sequence {i+1} of {self.n_sequences}") |
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.
Please, replace "out-of-focus" with "aos".
b22cbe8
to
be7c5c2
Compare
46379dc
to
24e3d43
Compare
24e3d43
to
a89d6d8
Compare
No description provided.