Page 1 of 1
Extracting Hofmann chart data for analysis
Posted: Tue 7 Apr 2026 23:55
by jyosk001
After running TraceWin on my .dat file, I can create a Hofmann chart of the lattice periods in my linac as shown below.

- Hofmann chart image
- Hofmann_chart.png (3.11 MiB) Viewed 66 times
I was wondering if there is a way to extract the lattice period data from the chart, i.e. the coordinates (kz/kxy, kxy/kxy0), for external analysis? There seems to be an option to generate a table (shown below) using the 4th menu option, but I don't know what this data is and it doesn't seem to match what is plotted -- there should be ~50 lines for the ~50 periods in my lattice (most of the periods are currently off the chart as the linac is not yet optimized).

- Hofmann chart data (?)
- Hofmann_chart_data.png (16.47 KiB) Viewed 66 times
If possible, I would like to be able to extract the lattice period data using the non-GUI version of TraceWin (TraceWin_noGUI.exe). I imagine there could be some option in the .ini file that I could set so that an ascii file of the data can be generated when running the non-GUI version.
Re: Extracting Hofmann chart data for analysis
Posted: Wed 8 Apr 2026 10:03
by Didier
Dear Sir,
I haven't your project, so it’s a bit complex, but the table appears to show the coordinates of the yellow points, which correspond to the periods where your HWR cavities are located.
I’m not entirely sure what you want to save to a file. Is it the set of pixels in the [400x400] grid, or more, depending on the resolution you’ve chosen for your diagram?
Sorry, but the non-graphical version isn't capable of calculating this type of data.
Regards,
Didier
Re: Extracting Hofmann chart data for analysis
Posted: Wed 8 Apr 2026 16:22
by jyosk001
Dear Didier,
I am trying to save just the coordinates of the lattice period points in the entire Hofmann chart. I've attached the full Hofmann chart below. Earlier I zoomed into the default axis scales.

- Full Hofmann Chart
- Screenshot 2026-04-08 092410.png (50.56 KiB) Viewed 23 times
My ultimate goal is to be able to scan different lattice parameters (magnet settings, cavity phases, drift lengths, phase advances, etc.) and correlate them with the positions of the lattice periods in the Hofmann chart so I can see their effect, then determine the optimal parameters that ensure the lattice periods remain within the stability regions. To help speed up analysis, I was hoping to perform batch runs of TraceWin using the non-GUI version with python so that I can easily scan the parameters. If I cannot get the lattice period data directly with the non-GUI version, is there some other way to get this data?
Let me know if you'd like me to send you my TraceWin project.
Thanks,
Josh
Re: Extracting Hofmann chart data for analysis
Posted: Wed 8 Apr 2026 16:47
by Didier
Dear Josh,
Is it the data shown in the two graphs below that you’re looking for, if I’ve understood correctly?

- phase_adv.png (532.54 KiB) Viewed 22 times
Regards,
Didier
Re: Extracting Hofmann chart data for analysis
Posted: Wed 8 Apr 2026 19:52
by jyosk001
Dear Didier,
I looked at the underlying data for the two plots. From what I can tell (and please correct me if I'm wrong), the "structure" plot contains the phase advances without space charge and the "beam" plot contains phase advances with space charge. The variables in the two plots are different ("k" in the structure plot and "sigma" in the beam plot), but from what I can tell, one can use the plot data and take the ratios kz/kxy and kxy/kxy0 and generate the points in the Hofmann chart correctly.
Two questions:
1. When opening either plot in the GUI, a txt file "Chart_Phaseadvance(deg).txt" is generated. The file name is the same regardless of the plot and thus this text file gets overwritten each time a plot is generated. Could the filenames be different for each plot type so that they don't get overwritten?
2. Is it possible to generate these text files using the non-GUI version of TraceWin? If so, I could work with these and it would solve my problem.
Thanks,
Josh