mbtrack2.utilities.read_impedance module¶
Module where function used to import impedance and wakes from other codes are defined.
- read_CST(file: str, component_type: str = 'long', divide_by: float | None = None, imp: bool = True) Impedance | WakeFunction[source]¶
Read CST text file format into an Impedance or WakeFunction object.
Parameters¶
- filestr
Path to the text file to read.
- component_typestr, optional
Type of the Impedance or WakeFunction object to load. Default is ‘long’.
- divide_byfloat, optional
Divide the impedance by a value. Mainly used to normalize transverse impedance by displacement. Default is None.
- impbool, optional.
If True a Impedance object is loaded, if False a WakeFunction object is loaded. Default is True.
Returns¶
- resultImpedance or WakeFunction object.
Data from file.
- read_IW2D(file: str, file_type: str = 'Zlong', output: bool = False) Impedance | WakeFunction[source]¶
Read IW2D file format into an Impedance object or a WakeFunction object.
Parameters¶
- filestr
Path to the file to read.
- file_typestr, optional
Type of the Impedance or WakeFunction object.
- outputbool, optional
If True, print out the interpolated values. Default is False.
Returns¶
- resultImpedance or WakeFunction object
Data from file.
- read_IW2D_folder(folder: str, suffix: str, select: str = 'WZ', output: bool = False) WakeField[source]¶
Read IW2D results into a WakeField object.
Parameters¶
- folderstr
Path to the folder to read.
- suffixstr
End of the name of each files. For example, in “Zlong_test.dat” the suffix should be “_test.dat”.
- selectstr, optional
Select which object to load. “W” for WakeFunction, “Z” for Impedance and “WZ” or “ZW” for both.
- outputbool, optional
If True, print out the interpolated values. Default is False.
Returns¶
- resultWakeField object
WakeField object with Impedance and WakeFunction objects from the different files.
- read_ABCI(file: str, azimuthal: bool = False, output: bool = False) WakeField[source]¶
Read ABCI output files [1].
Parameters¶
- filestr
Path to ABCI .pot file.
- azimuthalbool, optional
If True, the transverse wake potential and impedance is loaded from the “AZIMUTHAL” data. If False, it is loaded from the “TRANSVERSE” data. In that case, a -1 factor is applied on the wake to agree with mbtrack2 sign convention. The default is False.
- outputbool, optional
If True, print out the loaded components header. Default is False.
Returns¶
- resultWakeField object
Data from file.
References¶
[1] : ABCI - https://abci.kek.jp/abci.htm
- read_ECHO2D(file: str, component_type: str = 'long') WakeFunction[source]¶
Read ECHO2D text file format (after matlab post-processing) into a WakeFunction object.
Parameters¶
- filestr
Path to the text file to read.
- component_typestr, optional
Type of the WakeFunction object to load. Default is ‘long’.
Returns¶
- resultWakeFunction object.
Data from file.
- read_GdfidL(files: str | List[str], component_type: str = 'long', divide_by: float | None = None, imp: bool = False) Impedance | WakeFunction[source]¶
Read GdfidL text file format into an Impedance or WakeFunction object.
Parameters¶
- filesstr or list of two str
Path to the text file to read. Single str for wake date and list of str for impedance in the format: [ReZ, ImZ].
- component_typestr, optional
Type of the Impedance or WakeFunction object to load. Default is ‘long’.
- divide_byfloat, optional
Divide the impedance by a value. Mainly used to normalize transverse impedance by displacement. Default is None.
- impbool, optional.
If True a Impedance object is loaded, if False a WakeFunction object is loaded. Default is False.
Returns¶
- resultImpedance or WakeFunction object.
Data from file.