simulation_results module
Define an object to store SPARK3D simulation results.
- class Spark3DResults(id, e_acc, time, population, p_rms=None, plotter=None, trim_trailing=False, period=None, parameters=None, **kwargs)[source]
Bases:
SimulationResultsStore a single SPARK3D simulation results.
- Parameters:
- _abc_impl = <_abc._abc_data object at 0x7e2c6f35c180>
- class Spark3DResultsFactory(plotter=None, freq_ghz=None, *args, **kwargs)[source]
Bases:
SimulationResultsFactoryDefine an object to easily instantiate
Spark3DResults.- __init__(plotter=None, freq_ghz=None, *args, **kwargs)[source]
Instantiate object.
- Parameters:
plotter (
Plotter|None, default:None) – Object to create the plots.freq_ghz (
float|None, default:None) – RF frequency in \(\mathrm{GHz}\). Used to compute RF period, which is mandatory for exp growth fitting.stl_path – Path to the
STLfile holding the 3D structure of the system. The default is None.stl_alpha – Transparency setting for the mesh.
- from_file(filepath, e_acc, delimiter=' ', **kwargs)[source]
Load a
TXTorCSVfile and create associated objects.- Parameters:
- Return type:
- _from_txt(filepath, e_acc, delimiter=' ', **kwargs)[source]
Create several
Spark3DResultsfromtime_results.txt.These file are generally produced with SPARK3D CLI.
TXTfiles look like this:#Sim num Power(W) Time(s) Num.elec. 1 100 0 1000 1 100 1 1010 1 100 2 1020 ... ... ... ... 2 50 0 1000 2 50 1 900 2 50 2 500 ... ... ... ...
Todo
Handle malformed files. In particular what happens if simulation numbers are mixed?
- Parameters:
filepath (Path) – Path to the file to load.
e_acc (np.ndarray) – Accelerating field values in \(\mathrm{V/m}\).
delimiter (str, optional) – Delimiter between columns. The default is a space.
- Return type:
- _from_csv(filepath, e_acc, delimiter=' ', **kwargs)[source]
Create several
Spark3DResultsfromtime_results.csv.Right-click on
Multipactor results,Export to CSV. These file are manually produed by the user.CSVfiles look like this:0 1000 1000 1000 1000 1e-9 1010 900 999 1001 2e-9 1020 500 998 1002 3e-9 1040 100 990 1003 4e-9 1050 0 950 1004 ...
There are no headers. The first column holds the time in seconds. Following columns hold the number of electrons for every simulation (one simulation on one column).
Note
In order to be consistent with CST import, we remove the end of the simulations, when the population is 0.
- Parameters:
filepath (Path) – Path to the file to load.
e_acc (np.ndarray) – Accelerating field values in \(\mathrm{V/m}\).
delimiter (str, optional) – Delimiter between columns. The default is a space.
- Return type:
- _abc_impl = <_abc._abc_data object at 0x7e2c6f35c200>