Proposed fix to allow inverted scope acquisitions#6
Proposed fix to allow inverted scope acquisitions#6drew-sinha wants to merge 1 commit intozplab:masterfrom
Conversation
zpincus
left a comment
There was a problem hiding this comment.
Sorry this took so long!
Also, since timecourse_handler.py has changed in the interim, you'll need to merge the current master into your branch and fix the merge conflicts.
| stack.enter_context(scope.tl.in_state(shutter_open=False)) | ||
| if hasattr(scope.il, 'shutter_open'): # Inverted scope doesn't have shutters. | ||
| stack.enter_context(scope.il.in_state(shutter_open=False)) | ||
| stack.enter_context(scope.tl.in_state(shutter_open=False)) |
There was a problem hiding this comment.
I'd add a second if-block for the tl shutter open. Right now you're using hasattr(scope.il, 'shutter_open') as a proxy for "is this our inverted scope", which is a bit brittle. Here just test for each shutter and if it's present, open it.
| if self.IL_FIELD_WHEEL is not None: | ||
| self.scope.il.field_wheel = self.IL_FIELD_WHEEL | ||
|
|
||
| if hasattr(self.scope.il, 'shutter_open'): # For non-inverted scope acquisitions |
There was a problem hiding this comment.
Again, it's a bit brittle to use hasattr(scope.il, 'shutter_open') in this way. I'd suggest for this change, you actually add a configuration variable to the class, like HAS_MOTORIZED_IL_TL or something. You then set that to false for acquisition scripts to be run on the inverted scope. (Putting each of the below into its own if-block seems a bit clumsy...)
Alternately, we add to the scope config a "scope name" attribute that we could test directly, rather than by proxy with the il.shutter_open thing.
This is a combined bug report + fix addressing rpc-scope guide acquisitions on the inverted microscope. When attempting acquisitions, the code available on iscope (commit unknown; not switched to external pysrc yet) suffers from the following errors:
(and on the appropriate fix,)
Both of these errors arise from the unique inverted scope configuration (i.e. not having shutters, etc.). These problem spots are preserved up to the current rpc-scope master. This fix patches these issues.