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

Scattering rate #624

Merged
merged 4 commits into from
Jul 5, 2023
Merged

Scattering rate #624

merged 4 commits into from
Jul 5, 2023

Conversation

swhite2401
Copy link
Contributor

This implements the request of #622. A new function is added to derive the scattering rate. The interface is identical to the one of the lifetime calculation.

@swhite2401
Copy link
Contributor Author

@bdalena I have used your formula, could you please check that everything is fine on your side?
You can call the new function as follows:

scatter, *_ = ring.get_scattering_rate(emity=emity, bunch_curr=bunch_curr, refpts=refpts)

Copy link

@bdalena bdalena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comparing the modification in get_lifetime and the new update od pyAT with get_scattering_rate

the function scattering_rate is equivalent to our modification of get_lifetime.
Many Thanks
Mihail and Barbara

@swhite2401
Copy link
Contributor Author

@lfarv , @oscarxblanco , could you please take a look at this on e for approval when you have time?

I have been asked by @bdalena to add the calculation of scattering rate, it makes use of the same algorithm as the lifetime with minor variations, so this is for the most part reshuffling code and introducing a new function to output the requested quantities.

I have checked the lifetime part and results are identical.

Copy link
Contributor

@lfarv lfarv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

@oscarxblanco
Copy link
Contributor

@swhite2401 yes, I will do a test that will be provided by @bdalena and Mihail Miceski.
After that I could review.

o

@oscarxblanco
Copy link
Contributor

@swhite2401 Using the input from @bdalena and Mihail Miceski I checked that the function returns w/o issues. Based on their test I created another test which calculates the scattering rate without the momentum aperture input using the current SOLEIL lattice, and it also returns w/o issues. I launch another test using the flag use_mp from the get_scattering_rate function call and confirm it used the available cores through htop.

In addition, I compared the rate equations with the piwinski article and they are written almost in the same way. I was not able to follow the construction of B1 and B2, I would trust @bdalena's and Mihail Miceski's cross check.

I add a folder with the scripts used for these tests, except the SOLEIL II lattice that I won't provide.

I think this branch could be safely merged.

test_scattering_rate.zip

@swhite2401
Copy link
Contributor Author

Ok great thanks a lot, I merge then!

@swhite2401 swhite2401 merged commit e3769b2 into master Jul 5, 2023
31 checks passed
@swhite2401 swhite2401 deleted the scattering_rate branch July 5, 2023 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants