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

Fixed missing detector arming in standard collection #320

Open
wants to merge 1 commit into
base: 2023-2-nyx
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions daq_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from collections import OrderedDict
from threading import Thread
from config_params import *
from ophyd.status import SubscriptionStatus
from kafka_producer import send_kafka_message

import gov_lib
Expand Down Expand Up @@ -3433,10 +3434,21 @@ def zebraDaqBluesky(flyer, angle_start, num_images, scanWidth, imgWidth, exposur
'change_state':changeState, 'transmission':vector_params["transmission"],
'data_path':data_path}
start_time = time.time()
#flyer.detector_arm(**required_parameters)
flyer.detector_arm(**required_parameters)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is not correct. look at the flyer.detector_arm() code and see what its return value is and how your code needs to be changed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We were getting NoneType back instead of the status object, so I have moved the creation of the status object to the collection to allow operations to continue.


def armed_callback(value, old_value, **kwargs):
if old_value == 0 and value == 1:
return True
return False

arm_status = SubscriptionStatus(flyer.detector.cam.armed, armed_callback, run=False)

flyer.detector.cam.acquire.put(1)

govStatus = gov_lib.setGovRobot(gov_robot, "DA")
#arm_status.wait()
time.sleep(0.5)
govStatus.wait()
arm_status.wait()
logger.info(f"Governor move to DA and synchronous arming took {time.time()-start_time} seconds.")
if govStatus.exception():
logger.error(f"Problem during start-of-collection governor move, aborting! exception: {govStatus.exception()}")
Expand Down