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]
type reference radius (mm) x position (mm) y position (mm)
0 Cylindrical 17.0 0.0 0.0


  • Field information

dfs[1]
main field (T) reference magnet strength (T) error of harmonic analysis of br
0 -7.169634072777 -7.169634072777 0.0003159894656828


  • Harmonics table

dfs[2]
Order bn an
0 1 1.000000e+04 1.986444e-12
1 2 7.947441e-13 7.458240e-13
2 3 2.456824e+00 -1.330748e-13
3 4 1.161683e-12 -2.706258e-12
4 5 -4.926023e+00 -2.231423e-12
5 6 -1.054013e-12 1.504351e-12
6 7 1.787194e+00 2.314897e-12
7 8 5.846220e-13 -7.246530e-13
8 9 1.380537e-01 -1.520078e-12
9 10 8.335324e-13 1.977976e-12
10 11 6.914776e-01 8.256689e-13
11 12 7.313067e-13 3.205894e-13
12 13 5.154286e-02 -1.034959e-12
13 14 3.502288e-13 -8.002637e-13
14 15 4.286381e-02 -1.639240e-12
15 16 3.381311e-13 -1.618674e-12
16 17 -5.466255e-02 1.075487e-12
17 18 -2.703234e-12 8.475658e-12
18 19 -1.079437e-03 1.327724e-12
19 20 6.151687e-13 -1.265663e-11


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 11.041 seconds)

Gallery generated by Sphinx-Gallery