-
Notifications
You must be signed in to change notification settings - Fork 1
Tests/source and beam #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
413fdde
Added methods for comparing beams and for printing out summary in the…
ben-c-2013 fd58b69
Added test for testing SourceBasic
ben-c-2013 e3ea280
Updates to test_sources.py
ben-c-2013 ea6b689
Added test_beam.py for testing the Beam class.
ben-c-2013 0e7d7d9
Small change in Beam.copy_particle_charge() to handle one of the beam…
ben-c-2013 9543833
Added more tests in test_beam.py.
ben-c-2013 5eae0e8
Added Beam class initiation tests to test_beam.py and added another t…
ben-c-2013 bcc9aa7
Edited __init__.py to add SourceCapsule.
ben-c-2013 18887a3
Added a function for setting up a SourceBasic in test_beam.py. Also a…
ben-c-2013 1e4f5c0
Saving some tests for beam coordinate rotation. Work in progress...
ben-c-2013 02a45a7
Added controls to the Beam class to ensure that energy, longitudinal …
ben-c-2013 0561094
Edited tests in test_beam.py to meet the requirement of energy, longi…
ben-c-2013 fcc2ce9
Moved a chunk of code (the rotation part) further down in beam.py. Al…
ben-c-2013 df96f88
Added several major tests for the beam coordinate system rotations.
ben-c-2013 00afa1f
Updates to the rotation tets in test_beam.py.
ben-c-2013 e9634d2
Changed proper_velocity2momentum() in relativity.py to calculate mome…
ben-c-2013 eb90604
Changed pxs(), pys() and pzs() to reflect the changes done to proper_…
ben-c-2013 95c8085
Added more tolerances to phase space tests and added a large amount o…
ben-c-2013 94ab1fe
Added tests for beam projection methods in test_beam.py.
ben-c-2013 74c8332
Minor change to Beam plotting methods and moved these further down in…
ben-c-2013 81cffab
Added tests for Beam plotting methods.
ben-c-2013 602c6d0
Added tests for Beam.accelerate().
ben-c-2013 ef6c2b5
Added controls to Beam.scale_norm_emittance_x() and Beam.scale_norm_e…
ben-c-2013 1904545
Added a flag calc_evolution to StageBaisc and edited StageBasic.track…
ben-c-2013 a8c26e0
Added tests for the Beam methods compress(), scale_to_length(), scale…
ben-c-2013 5362d2a
Added test_magnify_beta_function() to test_beam.py.
ben-c-2013 3b16ce5
Added test_apply_betatron_damping(), test_magnify_beta_function(), te…
ben-c-2013 ccd580d
Minor changes in Beam.apply_betatron_damping() and Beam.flip_transver…
ben-c-2013 7e9b64b
Changes to the default relative tolerance and absolute tolerance of B…
ben-c-2013 2437ed1
Added test_save_load() to test_beam.py.
ben-c-2013 e04994d
Added beam reference file for tests.
ben-c-2013 de2a3af
Changed the limit for minimum energy in the Beam class to gamma=10.
ben-c-2013 8f487ed
Added controls to weighted_mean(), weighted_std() and weighted_cov() …
ben-c-2013 e21c239
Edited the str operator and added controls for __init__() and reset_p…
ben-c-2013 7d2b100
Edited some tests to purposedly trigger exceptions in test_beam.py.
ben-c-2013 b3556f6
Added to test_rs(), test_deltas(), test_transverse_vector(), test_nor…
ben-c-2013 bb597f7
Added several more tests for beam statistics.
ben-c-2013 5934727
Added exception triggering to test_rotate_coord_sys_3D() under test_b…
ben-c-2013 d5b3336
Added test_density_map_diags() and test_print_summary() to test_beam.py.
ben-c-2013 9752890
Small correction in test_beam.py
ben-c-2013 027c598
Rearranged code in beam.py.
ben-c-2013 6d69d5a
Added checks for input types in Beam.set_phase_space() and implemente…
ben-c-2013 4ac5954
Added test_remove_halo_particles() to test_beam.py.
ben-c-2013 3a246fa
Added doc string to Beam.apply_betatron_motion().
ben-c-2013 40c5fe1
Added minor comment to stage_basic.py.
ben-c-2013 9bb7a73
Added controls in source_from_file.py to ensure valid file path in bo…
ben-c-2013 b903b82
Edited test_SourceFromFile2Beam() in test_sources.py to trigger excep…
ben-c-2013 04c5462
Revert "Rearranged code in beam.py."
kyrsjo 5665394
Manually undo the moving of 'beam statistics' function from commit fc…
kyrsjo 3542531
Manually undo the moving of plotting functions from commit 74c833294e…
kyrsjo 95de216
Changed beam reference file path in test_SourceFromFile2Beam() using …
ben-c-2013 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,8 +54,10 @@ def proper_velocity2gamma(u): | |
| return np.sign(u) * np.sqrt(1+(u/SI.c)**2) | ||
|
|
||
| # convert proper velocity to momentum [kg m/s] | ||
| def proper_velocity2momentum(u): | ||
| return gamma2momentum(proper_velocity2gamma(u)) | ||
| # def proper_velocity2momentum(u): | ||
| # return gamma2momentum(proper_velocity2gamma(u)) | ||
| def proper_velocity2momentum(u, m=SI.m_e): | ||
| return m*u | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is u = gamma*v?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
|
|
||
| # convert proper velocity to energy | ||
| def proper_velocity2energy(u, unit=defaultUnitE, m=SI.m_e): | ||
|
|
||
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
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
Binary file added
BIN
+1.03 MB
...ePrtclTransWakeInstability_beamline/test_baseline_linac/shot_000/beam_003_00048.558626.h5
Binary file not shown.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not pull the
beam.apply_betatron_motionoutside of theif? Its called by the same parameters anyway, the only difference is whether self.evolution.beam is set or not.Also, why is it called? Are there side effects to beam when this is called (the function has no docstring)?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is inside of
if self.calc_evolutionbecause it only tracks the beam parameter evolution whenself.calc_evolution=True. And this is the function that actually evolves the beam by solving Hill's equation. I will add docstrings to this (commit 3a246fa).