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

Naming convention of bunch generation vs analysis, saving of bunch parameters #96

Open
TheresaBruemmer opened this issue Sep 9, 2022 · 1 comment

Comments

@TheresaBruemmer
Copy link

I have 2 issues that arise for my use case:

When initialising a ParticleBunch instance from parameters, (eg get_gaussian_bunch_from_twiss), the naming of the input parameters do not match the naming of the output obtained from analyze_bunch.
Consequently, one cannot simply run

bunch_params = analyze_bunch(ExistingBunch)
NewBunch = get_gaussian_bunch_from_twiss(**bunch_params)

I wrote a function which rewrites the names to match the required input to fix the issue or me, but I guess it could just be renamed in wake-t..?

In analyze_bunch, basically all data (eg energy spread) has to be calculated (even when the bunch was initialised from parameters, not a file) because that initial info is not stored... Saving input parameters in ParticleBunch and/or adding routines to calc them would also resolve my first issue.

@AngelFP
Copy link
Owner

AngelFP commented Sep 9, 2022

Hi Theresa,
Thanks for your feedback! I'm not sure I understand the use case here. The method analyze_bunch calculates a wide range of bunch parameters, many more than the parameters needed by get_gaussian_bunch_from_twiss, for example. Therefore, it will not be possible to do what you suggest unless the number of output parameters from analyze_bunch exactly match those of the generator function. Since we have many generator functions, each of them with different input parameters, we cannot do this in a way that works for all of them as you describe.

In what case do you need this functionality? Are you trying to make a copy of a bunch? In that case, using the copy module would be much easier.

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

No branches or pull requests

2 participants