Skip to content

Implemented BBA#314

Merged
JeanLucPons merged 2 commits into
mainfrom
implement-bba
Jul 10, 2026
Merged

Implemented BBA#314
JeanLucPons merged 2 commits into
mainfrom
implement-bba

Conversation

@JeanLucPons

Copy link
Copy Markdown
Member

This PR implements BBA.
There is no most effective steerer detection and quad location detection yet. For the time being this has to be configured by hand.

    sr = Accelerator.load("tests/config/EBSOrbit.yaml")
    SR = sr.design
    bba = SR.get_bba("BBA-BPM_C04-03")

    # Add a misalignement
    SR.get_bpm("BPM_C04-03").offset.set([20e-6, -15e-6])
    # Measure offsets
    bba.measure()
    assert np.abs(bba.h_offset() - 20e-6) < 2e-6
    assert np.abs(bba.v_offset() + 15e-6) < 2e-6

@kparasch kparasch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's great!

The only thing I don't like but could maybe get addressed in a future PR is that with this way, there is one BBA tuning tool per BPM.

@JeanLucPons

Copy link
Copy Markdown
Member Author

Yes this is a simple implementation.
For more advanced BBA tool (including BPM and quad search) we can see later.

@JeanLucPons JeanLucPons merged commit d11fbbb into main Jul 10, 2026
4 checks passed
@JeanLucPons JeanLucPons deleted the implement-bba branch July 10, 2026 11:36
@gubaidulinvadim

Copy link
Copy Markdown
Contributor

From the example it seems that it only does a single quad-bpm pair. Is this correct?

@JeanLucPons

Copy link
Copy Markdown
Member Author

Yes no paralell BBA for the moment.

@kparasch

Copy link
Copy Markdown
Member

Yes. For reference, the pySC BBA implemented here is the classic "model-independent" or "bow-tie" BBA algorithm adapted from MML.

@gubaidulinvadim

Copy link
Copy Markdown
Contributor

Like @kparasch pointed out, maybe at the end we will want only the parallel version in the configuration. Otherwise, we'll get a very long BBA config with only the names different.

@kparasch Maybe there will be some contribution from SOLEIL to pySC with either fast BBA or fast ORM. To be checked (Sami will leave SOLEIL; maybe his replacement will be less inclined to only test the code). Or I'll do it because for SOLEIL II we do not plan to rely on the classic algorithm (takes too long).

@JeanLucPons

Copy link
Copy Markdown
Member Author

Yes here you can see the whole BBA config for EBS (using only pySC)
https://github.com/kparasch/ebs2pySC/blob/main/bba_config_tango.json

To decrease this config size, a search of quad and steerer for a given bpm is needed.
This will need some more complex modif (typically to get s position).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants