at.lattice.elements.idtable_element#
ID table :py:clas:`.Element`.
Classes
|
Insertion Device Element. |
- class InsertionDeviceKickMap(family_name, *args, **kwargs)[source]#
Bases:
Element
Insertion Device Element. Valid for a parallel electron beam.
This elememt implements tracking through an integrated magnetic field map of second order in energy, normalized to an energy value that is required to calculate alpha. See Eq. (5) in [#].
First order maps could be included. See Eq. (3) in [#]. Note that positive and negative signs are not taken into account in this implementation. Input should already include the sign difference.
Default PassMethod:
IdTablePass
.- [#] Pascale ELLEAUME, “A New Approach to the Electron Beam Dynamics in
Undulators and Wigglers”. EPAC1992 0661. European Synchrotron Radiation Facility. BP 220, F-38043 Grenoble, France
Init IdTable.
This __init__ takes the input to initialize an InsertionDeviceKickMap from an user input with arguments, for example at the moment of the element creation, or from all parameters, for example when reading a Lattice.
- Parameters:
- from_user(nslice, fname, norm_energy)[source]#
Create an Insertion Device Kick Map from a Radia field map file.
The following is an example of an Insertion Device element, idelem, created from a file ‘radiakickmap.txt’ with 10 integration steps. The tables have been normalized to 3 GeV. The family name is ‘IDname’. >>> idelem = at.InsertionDeviceKickMap(‘IDname’, 10, ‘radiakickmap.txt’, 3)
The input file could be a text file or a dictionary. See read_text_radia_field_map for info about the text file format. See read_dict_radia_field_map for info about the dict format.
Family name is part of the base class, and all other arguments are parsed here below.
- get_PassMethod()[source]#
Get the current tracking pass method.
- Returns:
String with the current tracking pass method.
- read_dict_radia_field_map(id_input)[source]#
Read a dictionary with Radia field map tables.
The required keys are “Length”, “xkick” and “ykick” for the second order maps, “xtable” and “ytable” for the grid, and “xkick1” and “ykick1” for the first order maps.
- Parameters:
id_input (dict) – Radia field map input.
- Returns:
Tuple with Insertion Device parameters.
- read_text_radia_field_map(file_in_name)[source]#
Read a RadiaField map in text format and return.
A File, where : - comments start with #. - the first data line is the length in meters. - the second data line is the number of points in the h. plane. - the third data line is the number of points in the v. plane. - each block is a table with axes. - each data block comes after a START. - first the horizontal data block, and second the vertical data block with the second order kicks. There might be two other blocks with the horizontal and vertical first order kicks.
File example (ignore the !SPACE): ! #comment in line 1 ! #comment in line 2 ! Length_in_m ! #comment in line 4 ! Number of points in horizontal plane :nh ! #comment in line 6 ! Number of points in vertical plane :nv ! #comment in line 8 ! START ! pos_point1h pos_point2h … pos_pointnh ! pos_point1v ! … horizontal kick_map(nv,nh) ! pos_pointnv ! START ! pos_point1h pos_point2h … pos_pointnh ! pos_point1v ! … vertical kick_map(nv,nh) ! pos_pointnv ! (EOL)
- Parameters:
file_in_name (str) – the file name.
- Returns:
Tuple with file tables and axes.
- Raises:
ValueError – if the number of blocks in less than 2 or equal to 3.