atcollab / at

Accelerator Toolbox
Apache License 2.0
48 stars 31 forks source link

fast_ring when having harmonic cavities in the lattice #757

Closed TeresiaOlsson closed 2 months ago

TeresiaOlsson commented 2 months ago

Hi,

We have a lattice with both main and harmonic cavities and I have problem with generating the fast_ring. Internally the function get_timelag_fromU0 is called and that fails because the cavities don't have the same frequency.

I have set the cavpts attribute on the lattice to only point towards the main cavities and this works when calling get_timelag_fromU0 directly, but not when it's called inside fast_ring because this attribute is never used inside the function. Perhaps fast_ring also needs a keyword to specify which cavity reference points to use like on find_orbit6?

swhite2401 commented 2 months ago

Hi @TeresiaOlsson , I've had similar comment from another user, most likely the same issue. Could you please send me your script by email? I'll take a look.

Normally, get_timelag_fromU0 should be find a solution with multiple RF systems

TeresiaOlsson commented 2 months ago

Thank you :)

I have attached my files. The script is super simple but I have some parts at the end of the lattice file which maybe could be the cause.

    # Turn cavity and radiation on
    ring.enable_6d()

    # Set cavpts to point to main cavities
    ring.cavpts = ring.get_uint32_index('CAV*')

    # Set only main cavity phases
    ring.set_cavity_phase(cavpts=ring.cavpts)

fast_ring_test.zip

swhite2401 commented 2 months ago

Handled in #758 , test scripts are running

swhite2401 commented 2 months ago

Fixed in #758