Note
Go to the end to download the full example code.
Field quality plots¶
Use the output of a harmonic coil and show the Field quality
Download Input files
Setting up¶
Standard Loading of input, Parsing and Initializing RoxiePlotOutputs object
from roxieapi.output.plots import RoxiePlotOutputs
plots = RoxiePlotOutputs(
"../input_files/dipole_2d.post.xml", "../input_files/dipole_2d.data"
)
Field quality tables¶
Field quality tables are parsed and accessible in the parser. To load, we select the Harmonic coil id and get it from the parser.
harmonic_coil = plots.output.get_harmonic_coil(1)
assert (
harmonic_coil is not None
) # We assume the input file is correct and harmonic coils are defined
dfs = plots.tables.print_harmonic_coil(harmonic_coil)
The output returns 3 Tables: - Coil definites
dfs[0]
Field information
dfs[1]
Harmonics table
dfs[2]
Plotting as bar graph¶
Alternatively, the Harmonics can be plotted as bar graph:
figure = plots.graphs.plot_harmonics(harmonic_coil)
figure
Total running time of the script: (0 minutes 0.106 seconds)