Skip to content
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

Data Analysis: What is the analysis_...py file? #592

Open
zhangli28 opened this issue Apr 27, 2024 · 3 comments
Open

Data Analysis: What is the analysis_...py file? #592

zhangli28 opened this issue Apr 27, 2024 · 3 comments
Labels
question Further information is requested

Comments

@zhangli28
Copy link

zhangli28 commented Apr 27, 2024

Hi,

I prepared an input-file for chicane using the input_kvdist_twiss.in format. The run was successful. Now, for data I use the analysis_chicane.py file but I got an error message:

Initial Beam:
  sigx=2.001725e-05 sigy=1.997410e-05 sigt=6.004582e-04
  emittance_x=1.013888e-08 emittance_y=1.007726e-08 emittance_t=1.804302e-07
  rtol=0.015556349186104048 (ignored: atol~=0.0)
Traceback (most recent call last):
  File "analysis_chicane.py", line 60, in <module>
    assert np.allclose(
AssertionError

the same error message was also appear when I use the file analysis_kvdist.py

However, I can make plots with plot_chicane.py file.

@zhangli28
Copy link
Author

Hi @n01r @cemitch99 @ax3l ,

I want to make plots of initial electron beam current and longitudinal phase-space and the same for the final electron beam. How I can do that and all are in normal coordinates (x,y,s) (no "ct")

@n01r
Copy link
Member

n01r commented Apr 29, 2024

Hi @zhangli28, sorry about the confusion. The Python files called analysis_<example-name>.py are used by our automated regression tests, which are run by our CI. They ensure that when we make changes to the code our examples and tests still produce the same results. Hence, when you changed the input parameters of the example, the np.allclose from the analysis script failed because it is checking for hard-coded values.

But in your second message, it looks like you may have found the phase space plotting feature that was introduced here: #469.

If you look in your diags directory of your successful run, you will notice files called ref_particle.*. These contain the data of the reference particle and one of the columns in there is s, as also mentioned in this issue: #533. You can use this to offset the longitudinal phase space to absolute units.

@zhangli28
Copy link
Author

Hi @n01r ,

thank you. You are always very clear and supportive. I will check the ref_particle files and see if I can do what I am trying.

@ax3l ax3l added the question Further information is requested label May 1, 2024
@ax3l ax3l changed the title Data Analysis problem Data Analysis: What is the analysis_...py file? May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants