Skip to content

Feature: Add an RF masterclock facade #374

Description

@gupichon

Description, motivation and use case
RFHolder already resolves named RF plants and exposes frequency and voltage from DEFAULT_RF_PLANT. The original holder proposal expresses this default RF plant as rf.masterclock, which makes its role explicit and leaves room for other RF plants under the same holder.

This improves readability in control applications that operate on the machine master clock while still supporting named RF plants.

Proposed solution
Add rf.masterclock, returning the RF plant configured as DEFAULT_RF_PLANT:

  • rf.masterclock.frequency exposes its frequency access.
  • rf.masterclock.voltage exposes its total-voltage access.
  • rf.get(name) continues to resolve other RF plants by name.

Retain rf.frequency and rf.voltage as backward-compatible aliases for the corresponding masterclock accessors. Raise a clear PyAMLException when DEFAULT_RF_PLANT is absent.

Describe alternatives you've considered
Keeping only rf.frequency and rf.voltage is compact but hides which configured RF plant they refer to. Making masterclock a separate object would duplicate the RFPlant API and create unnecessary synchronization concerns.

Example

masterclock = sr.live.rf.masterclock
masterclock.frequency.set(499.654e6)
masterclock.voltage.set(2.5e6)

same_frequency = sr.live.rf.frequency
spare_rf_plant = sr.live.rf.get("SPARE_RF_PLANT")

Additional context
Parent issue: ElementHolder API refurbishment #199.

The current RFHolder already implements get(name), frequency, and voltage. This issue introduces the explicit default-plant façade proposed in #199 while retaining the current shortcuts.

Checklist

  • I've assigned this issue to a project
  • I've @-mentioned relevant people

Activity

  1. gubaidulinvadim commented on Sep 15, 2026

    @gubaidulinvadim
    Member

    @gupichon, I am not sure I understand this issue. With the present implementation, I think we cover the simplest case of RF, where there's one single "effective cavity".

    • rf.masterclock.voltage would not make sense because masterclock is only a clock for the frequency.
    • sr.design.rf currently refers to "DEFAULT_RF_PLANT" in the configuration, similarly to other utilities like sr.design.tune referring to "DEFAULT_TUNE_CORRECTION". If it's not defined, you need to do sr.design.rf.get('NAME') to obtain the RF object that you need.

    For my case, with multiple RF cavities that each have their own voltage is not really covered in detail at the moment. And I don't see if this is necessary in the near future.

    @GamelinAl, is there a need to have a more detailed RF implementation?

  2. GamelinAl commented on Sep 15, 2026

    @GamelinAl
    Member

    I would say probably not at the current time.

  3. self-assigned this
    on Sep 16, 2026
  4. linked a pull request that will close this issueAdd an RF masterclock facade #427on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions