core.elements.field_maps.factory module
Define a class to easily create FieldMap
objects.
This element has its own factory as I expect that creating field maps will become very complex in the future: 3D, superposed fields…
Todo
This will be subclassed, as the different solvers do not have the same
needs. TraceWin
does not need to load the electromagnetic fields,
so every FIELD_MAP
is implemented.
Envelope1D
cannot support 3D.
etc
- class FieldMapFactory(default_field_map_folder: Path, freq_bunch_mhz: float, default_absolute_phase_flag: str = '0', **factory_kw: Any)
Bases:
object
An object to create
FieldMap
objects.- __init__(default_field_map_folder: Path, freq_bunch_mhz: float, default_absolute_phase_flag: str = '0', **factory_kw: Any) None
Save the default folder for field maps.
- _append_absolute_phase_flag(line: list[str]) None
Add an explicit absolute phase flag.
- _get_proper_field_map_subclass(geometry: int) ABCMeta
Determine the proper field map subclass.
Warning
As for now, it always raises an error or return the rf electric field 1D class
FieldMap100
.
- IMPLEMENTED_FIELD_MAPS = {100: <class 'core.elements.field_maps.field_map_100.FieldMap100'>, 1100: <class 'core.elements.field_maps.field_map_1100.FieldMap1100'>, 7700: <class 'core.elements.field_maps.field_map_7700.FieldMap7700'>}
- warn_once(geometry: int)
Raise this warning only once.
https://stackoverflow.com/questions/31953272/logging-print-message-only-once