field_map module
Hold a FIELD_MAP.
Todo
Handle the different kind of field_maps…
Todo
Completely handle the SET_SYNCH_PHASE command
Todo
Hande phi_s fitting with TraceWin.
Note
When subclassing field_maps, do not forget to update the transfer matrix
selector in:
- Envelope3D
- ElementEnvelope3DParameters
- SetOfCavitySettings
- the run_with_this methods
- class FieldMap(line, default_field_map_folder, cavity_settings, dat_idx=None, **kwargs)[source]
Bases:
ElementA generic
FIELD_MAP.- Parameters:
line (
DatLine)default_field_map_folder (
Path)cavity_settings (
CavitySettings)
- base_name = 'FM'
- n_attributes: int | range | Collection = 10
- __init__(line, default_field_map_folder, cavity_settings, dat_idx=None, **kwargs)[source]
Set most of attributes defined in
TraceWin.- Parameters:
line (
DatLine)default_field_map_folder (
Path)cavity_settings (
CavitySettings)
- property status: str
Give the status from the
CavitySettings.
- update_status(new_status)[source]
Change the status of the cavity.
We use
ElementBeamCalculatorParameters.re_set_for_broken_cavity()method. Ifk_e,phi_s,v_cav_mvare altered, this is performed inCavitySettings.status()setter.
- keep_cavity_settings(cavity_settings)[source]
Keep the cavity settings that were found.
- Parameters:
cavity_settings (
CavitySettings)- Return type:
- get(*keys, to_numpy=True, none_to_nan=False, **kwargs)[source]
Get attributes from this class or its attributes.
- Parameters:
*keys (
Literal['aperture_flag','field_map_filename','field_map_folder','geometry'] |Literal['e_spat','n_cell','n_z','starting_position','section_idx'] |Literal['dat_idx','elt_idx','idx','idx_in_lattice','lattice','length_m','nature','section'] |Literal['abs_mesh','d_z','n_steps','rel_mesh','s_in','s_out','transf_mat_function'] |Literal['field','freq_cavity_mhz','k_e','omega_0_rf','phi_ref','phi_rf','phi_s_func','reference','rf_field','status','v_cav_mv','w_kin'] |Literal['phi_0_abs','phi_0_rel','phi_s']) – Name of the desired attributes.to_numpy (
bool, default:True) – If you want the list output to be converted to a np.ndarray. The default is True.**kwargs (
bool|str|None) – Other arguments passed to recursive getter.none_to_nan (
bool, default:False)
- Returns:
out – Attribute(s) value(s).
- Return type:
Any
- to_line(which_phase, *args, **kwargs)[source]
Convert the object back into a line in the
DATfile.- Parameters:
- Returns:
The line in the
DAT, with updated amplitude and phase from current object.- Return type:
- property _indexes_in_line: dict[str, int]
Give the position of the arguments in the
FIELD_MAPcommand.
- _abc_impl = <_abc._abc_data object at 0x73dca86bf1c0>