Insertion Device Table content and format #703
oscarxblanco
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear all,
I have recently checked the implementation on Insertion Devices in AT matlab and pyAT, updating the variables names.
In the process I came across with several aspects that are not yet written but seem to me important in order to trust the results. I will divided in two topics : content and format.
Content
The effect of an Insertion Device is implemented through kick tables corresponding to the integration of magnetic fields along the longitudinal axis, for a grid of transverse coordinates.
Second order kicks
The IdTablePass method reads horizontal and vertical Second order tables as the first term on the rhs of Eq. (5) in P. Elleaume's "A new approach to the electron beam dynamics in Undulators and Wigglers" https://accelconf.web.cern.ch/e92/PDF/EPAC1992_0661.PDF
where the minus sign and the factor 1/2 in front of the integral should be included when producing the input file. The$\alpha^2$ in front of the integral is only included when creating the AT element because it is a normalization to the beam energy. Here, $B\rho\approx E/c$ with a difference on the order of $10^{-8}$ for electrons at some GeV.
From Eq. (4)
the following conditions should be met when producing the input tables. @ZeusMarti imposes it by substracting these terms from Eq(5) when calculating the numerical integrals.
Additionally, the electron charge and sign is hard coded. It makes it only valid for electron beams.
First order kicks
The first order kick follow a similar definition given by P. Elleaume in Eq. (3)
As before, signs should be included when producing the input file to AT, and the$\alpha$ factor should NOT be included in the integration, as this is taken into account when creating the element in AT.
The first order kick seems not to come from modelling but from actual measurements, therefore, it might be less used.
Format
The format seems to vary depending on the laboratory and programming language used by the Insertion Devices modelling team. I have seen two main implementations: text or mat files.
text
The text file seems to be produced with only spaces (at SOLEIL) or only TABs (at ESRF) data separators. This used to be a problem in the matlab AT implementation but should be fixed in #683 . It also seems to come from Radia either in Mathematica or python. At ALBA I have tried to look on the Mathematica function
RadFldFocKick
but I was unable to find it in Radia Documentation https://www.esrf.fr/Accelerators/Groups/InsertionDevices/Software/Radia/Documentation , and the source code seems to me unavailable. I would suspect the negative sign and factor 1/2 mentioned while discussing the second order kick is included there, but, I am not able to check.
It seems RadiaSoft uses or develops Radia https://www.sirepo.com/en/apps/magnets/ , and refer to a public repository https://github.com/ochubar/Radia from which their Radia version is based on.
The file itself should contain the following :
The sign ⏎ means a change of line, while the dots are data points. The values of m and n are integers, where m is the number of horizontal steps and n the number of vertical steps. L is the length of the insertion device in meters. The values of x and y should be in meters and correspond to the transverse horizontal and vertical displacement on the grid.
Additionally, there could be two more tables with the first order kicks starting with a comment line and the word START (exactly as the first two).
mat file
It seems that for matlab users the most confortable way is to store the kickmaps into mat files and reading them when creating the element.
Beta Was this translation helpful? Give feedback.
All reactions