Closed SchroederSa closed 2 months ago
To illustrate what I mean. Here, I added an infinitesimal short drift just in front of the aperture to have an additional value in the envelope extraction:
If you look at the code track
is calculating the twiss at every step given by the navigator. So based on this, I would suggest decreasing the navigator unit step. If this results in too much of a slow down, scale the corresponding steps of all your physics processes, then add an empty proc with a step = 1
. I'm not sure I've done this but I think it should work. The idea anyway should be clear: force the navigator to go in smaller steps.
Ok, thanks. So far, I don't have any physics processes included.
Then add an emptyproc to force the navigator to take small steps and set the unit step of the navigator as small as you like.
Great, thanks for the quick help!
For reference:
navi = Navigator(lat)
navi.activate_apertures()
ep = EmptyProc()
ep.step=0.1
navi.add_physics_proc(ep, lat.sequence[1], triplet.lat.sequence[-2])
navi.unit_step = 0.1
tws_track, p_array = track(.lat, p_array, navi, print_progress=False)
Although I still have the infinitesimal dummy drift just before the aperture, it allows me to have a larger step value and doesn't falsify the result (too much) :).
Thanks!
In principle step
should be an integer (it is dimensionless). The physics process is applied every step*Navigator.unit_step
, so Navigator.unit_step
defines the increment step forward taken by the ParticleArray, so it is units of metres. I don't know what impact it has in this case, though. I don't know what happens if you pick a float step and particularly if you pick a physics process step <1. Maybe @sergey-tomin can comment on this.
Hi,
Is there a way to increase the number of nPoints, i.e. the number of s-evaluations for the tracking twiss output?
I'd like to have tws_track being more granular sampled for nicer plotting: tws_track, p_array = track(triplet.lat, p_array, navi, print_progress=False)
I saw that it works through the envelope calculations, but I couldn't find any handle to increase the stepping output.
In the attached plot, I added an aperture at the s-location of the black dotted line. Given the limited s-sampling of tws_track the first bit of sigma up to the aperture is incorrectly depicted.
Thanks! Sarah