-
Notifications
You must be signed in to change notification settings - Fork 5
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
828 save waveform constants with acquisition and generate method to load it #841
828 save waveform constants with acquisition and generate method to load it #841
Conversation
Pushing changes so that I can jump on the machine. Co-Authored-By: Sriya Veerapaneni <78429510+Sriya-235@users.noreply.github.com>
Hey! So I made some changes to the menu_controller.py to save and load waveform_constants files. This allows us to save the waveform constants for experiments and load the same constants for future experiments. This commit also includes changes that @annie-xd-wang made to waveforms.py to align the wave.
Removed hot keys from menu controller. Now saves the waveform constants with the data. Only thing remaining is to have the popup GUI automatically populated with the new parameters.
Updated the documentation to show the updated file menu. Also added few lines about the load and save waveform constants option in the documentation. Replaced the menu_file.png image with a new image of the file menu.
…-acquisition-and-generate-method-to-load-it
#: str: Feature list file name. | ||
self.feature_list_file_name = "feature_lists.yaml" | ||
|
||
#: waveform_popup_controller: Waveform Popup Controller. | ||
# self.parent_controller.waveform_popup_controller = 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.
Perhaps we should delete these commented lines.
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.
Deleted.
"internal_line_interval": 4208720, # 0x00403850, R/W, sec, | ||
# "INTERNAL LINE INTERVAL" | ||
"internal_line_interval": 4208720, # 0x00403850, R/W, sec, "INTERNAL LINE INTERVAL" | ||
"internal_line_speed": 4208704, # 0x00403840, R/W, m/sec, "INTERNAL LINE SPEED" |
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.
Important changes, presumably.
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 modifications to camera functions originate from the commits in PR #808.
#: int: Maximum image width | ||
self.max_image_width = 2048 | ||
#: int: Maximum image height | ||
self.max_image_height = 2048 |
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.
More important stuff.
self.camera_parameters["x_pixels"] = self.max_image_width | ||
self.camera_parameters["y_pixels"] = self.max_image_height | ||
self.y_pixels = 2048 | ||
self.camera_parameters["x_pixels"] = 2048 |
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.
Hard coding
@@ -43,10 +43,11 @@ | |||
logger = logging.getLogger(p) | |||
|
|||
|
|||
class HamamatsuOrca(CameraBase): |
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 assume that most of these changes can be ignored. I take responsibility for this, and I'm sorry.
@@ -264,6 +266,9 @@ def create_analog_output_tasks(self, channel_key): | |||
""" | |||
self.n_sample = int(self.sample_rate * self.sweep_times[channel_key]) | |||
max_sample = self.n_sample * self.waveform_expand_num | |||
print("max_sample", max_sample) |
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.
Delete print statements.
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.
Deleted.
@@ -188,7 +188,7 @@ def adjust(self, exposure_times, sweep_times): | |||
elif self.galvo_waveform == "halfsaw": | |||
new_wave = sawtooth( | |||
sample_rate=self.sample_rate, | |||
sweep_time=self.sweep_time, | |||
sweep_time= self.sweep_time, |
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.
Uniform spacing
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.
Fixed.
src/navigate/model/microscope.py
Outdated
@@ -405,13 +405,18 @@ def prepare_acquisition(self): | |||
sensor_mode = self.configuration["experiment"]["CameraParameters"][ | |||
"sensor_mode" | |||
] | |||
|
|||
print('sensor_mode', sensor_mode) | |||
|
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.
Delete print statement
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.
Deleted.
…ion-and-generate-method-to-load-it
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #841 +/- ##
===========================================
- Coverage 54.33% 54.32% -0.02%
===========================================
Files 154 154
Lines 17444 17478 +34
===========================================
+ Hits 9479 9495 +16
- Misses 7965 7983 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
We can test bidirectional acquisition on a machine now.
) | ||
|
||
if hasattr(self.parent_controller, "waveform_popup_controller"): | ||
self.parent_controller.waveform_popup_controller.populate_experiment_values( |
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.
Much nicer.
Will test first thing tomorrow. But everything looks great. |
Annie, this could use a close look. Sriya led the charge on these code changes, and her branch combined two different issues: #828 and #804
For #828, she had a hard time getting the waveform popup to repopulate with new values, once she loaded a new waveform constants file. I dabbled with it, and then resorted to something that may not be ideal; I now destroy the waveform popup window, delete the waveform popup controller, and then launch a new popup and controller. To make it less annoying, The new popup shows up where the old one was.
For #804, we will need to change things to accommodate all of the work you did overhauling the camera timing.