Skip to content

Conversation

@jacob720
Copy link
Contributor

@jacob720 jacob720 commented Nov 11, 2025

Fixes #1076

Requires bluesky/ophyd-async#1127 and DiamondLightSource/dodal#1706

Instructions to reviewer on how to test:

  1. Do thing x
  2. Confirm thing y happens

Checks for reviewer

  • Would the PR title make sense to a user on a set of release notes

@jacob720 jacob720 requested a review from a team as a code owner November 11, 2025 11:00
@jacob720 jacob720 added i03 Changes relating to I03 fastcs eiger Migration to the FastCS Eiger device i04 Changes relating to I04 labels Nov 11, 2025
Copy link
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

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

Thanks, some comments in code. When you test it I suspect you might get issues with not calling complete and instead calling unstage (at

else_plan=lambda: (yield from bps.unstage(detector, wait=True)),
). I think we just try that and see though

@pydantic.dataclasses.dataclass(config={"arbitrary_types_allowed": True})
class FlyScanEssentialDevices:
eiger: EigerDetector
eiger: EigerDetector | FastCSEiger
Copy link
Contributor

Choose a reason for hiding this comment

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

Must: Annoyingly I don't think this is going to work. The code in

def device_composite_from_context(context: BlueskyContext, dc: type[DT]) -> DT:
will populate the composite based on the parameter name being the same as the device name and the type being the same. I think you will instead need to have a new device in this composite called fastcs_eiger: FastEiger

Copy link
Contributor Author

@jacob720 jacob720 Nov 12, 2025

Choose a reason for hiding this comment

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

Ah ok, I wanted to avoid that for now as it would involve creating a fastcs eiger in the i04.py device factory, as the I04 XRC composite class inherits from FlyScanEssentialDevices. But maybe that isn't a problem, I've just created an I04 fastcs Eiger.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yh, we will want to test on i04 at some point anyway

eiger.set_detector_parameters(parameters.detector_params)
eiger: EigerDetector | FastCSEiger = composite.eiger
if isinstance(eiger, FastCSEiger):
yield from configure_and_arm_detector(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: is there a dodal PR needed? I can't see this in main

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, will update the PR
DiamondLightSource/dodal#1706

trigger=DetectorTrigger.EDGE_TRIGGER,
deadtime=0.0001,
),
# group=data_collection_group
Copy link
Contributor

Choose a reason for hiding this comment

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

You want CONST.WAIT.GRID_READY_FOR_DC

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 89.65517% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.24%. Comparing base (97a841e) to head (ee0f35a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1436      +/-   ##
==========================================
- Coverage   92.26%   92.24%   -0.03%     
==========================================
  Files         142      142              
  Lines        8031     8042      +11     
==========================================
+ Hits         7410     7418       +8     
- Misses        621      624       +3     
Components Coverage Δ
i24 SSX 78.44% <ø> (ø)
hyperion 98.02% <100.00%> (-0.01%) ⬇️
other 97.99% <88.46%> (-0.09%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

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

Noticed a couple of things after briefly skimming

gridscan: FastGridScanCommon,
detector: EigerDetector, # Once Eiger inherits from StandardDetector, use that type instead
detector: EigerDetector
| FastCSEiger, # use StandardDetector once old eiger not in use
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we can actually use StandardDetector for the type here since we use dev_shm, which is specific to Odin. Maybe we can use StandardDetector[DetectorController, OdinWriter]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's good to know, could we just use FastCSEiger? How much more general is StandardDetector[DetectorController, OdinWriter] than FastCSEiger

Copy link
Contributor

Choose a reason for hiding this comment

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

Well theoretically any standard detector which writes using odin could do the XRC plan, but I doubt we'll be doing this anytime soon. So yeah, can just use FastCSEiger for now

)


def kickoff_and_complete_gridscan(
Copy link
Contributor

Choose a reason for hiding this comment

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

The old eiger device waits for frames when we unstage. The fast-cs eiger will just immediately disarm on unstage.

For the fast-cs eiger we need to do yield from bps.complete instead - this will wait for frames with a default timeout, or the timeout specified in TriggerInfo

Copy link
Contributor

Choose a reason for hiding this comment

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

Good spot, thanks

@DominicOram
Copy link
Contributor

Waiting on testing time

@jacob720 jacob720 force-pushed the use_fastcs_eiger_for_xrc branch from 5ae5d0d to ee0f35a Compare November 25, 2025 10:36
@jacob720 jacob720 force-pushed the use_fastcs_eiger_for_xrc branch from ac58072 to 080a87c Compare December 17, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fastcs eiger Migration to the FastCS Eiger device i03 Changes relating to I03 i04 Changes relating to I04

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate to the ophyd-async Eiger

4 participants