Open
Conversation
* Add new parameter `file_offset` to keep the files separate * Adjust output statements to use the new file numbers * Adjust output statements to include z-location and correctly scale `xpx` values (as in `diagnostic1avg_Output`)
* Call with a different file offset each time to avoid file clash * Call once at the start and then every 15 time steps
* Use a single plot for both single and multiple bunch plots * Use a drop-down to select bunch rather than a message window * Set the bunch selector based on number of bunches in simulation * Use methods instead of attributes to pass data
Contributor
Author
|
Note that I have only tested the GUI changes with Python 3, we'd need to check whether or not I've broken anything in Python 2.x. |
mattachu
commented
Dec 31, 2019
| !> calculate <x^2>,<xp>,<px^2>,x emittance, <y^2>,<ypy>, | ||
| !> <py^2> and y emittance, <z^2>,<zp>,<pz^2>,z emittance. | ||
| subroutine diagnostic1_Output(z,this) | ||
| subroutine diagnostic1_Output(z,this,file_offset) |
Contributor
Author
There was a problem hiding this comment.
As far as I can tell, this older routine diagnostic1_Output is no longer used, so modifying it here shouldn't cause any problems. It is just what is needed for per-bunch output.
mattachu
commented
Dec 31, 2019
| plotWindow.title(sys._getframe().f_back.f_code.co_name) | ||
|
|
||
| l=PlotFrame(plotWindow,'fort.28',1,4,'Live particle number') | ||
| l=PlotFrame(plotWindow, 'fort.28', 4, 'Live particle number') |
Contributor
Author
There was a problem hiding this comment.
x-axis columns now selected in the plot classes themselves
mattachu
commented
Dec 31, 2019
| else: | ||
| return [zcol, 'z direction (m)'] | ||
|
|
||
| class PlotFrame(PlotBaseFrame): |
Contributor
Author
There was a problem hiding this comment.
Other plot frames now inherit from PlotBaseFrame to access the new features and reduce duplication.
Adjusted calculation of `localmax(5)` and `localmax(6)` to match the calculation in the average diagnostic output subroutines. Previously would output maximum size in the z direction without first subtracting the beam centroid.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As well as the standard output files, also produce separate output files for each bunch, to enable more detailed analysis of bunch behaviour.
Includes changes to the output routine, a couple of calls in the main accelerator routine, and lots of changes in the GUI to be able to plot all the extra statistical data.