Open hayg25 opened 3 years ago
@hayg25 Thank you for pointing this out, I never noticed the TWS type cavity in the manual.
I update the code to better handle fieldmaps, including archiving. Could you test if this works for you?
Hi @ChristopherMayes , yes please tell me when the code is updated so I can test it.
@hayg25 I already updated it. Or, are you using conda-forge?
Yes conda forge but I will install using pip.
ok I will wait for the conda update, I am somehow facing an error after installation :
ImportError Traceback (most recent call last)
<ipython-input-1-7824a10e5180> in <module>
----> 1 from astra import Astra
~/Astra/Lume_Astra/lume-astra/astra/__init__.py in <module>
2 from .generator import AstraGenerator
3 from .evaluate import evaluate_astra_with_generator
----> 4 from .astra_distgen import run_astra_with_distgen, evaluate_astra_with_distgen
5
6 from ._version import __version__
~/Astra/Lume_Astra/lume-astra/astra/astra_distgen.py in <module>
7 from .evaluate import default_astra_merit
8
----> 9 from distgen import Generator
10 from distgen.writers import write_astra
11 from distgen.tools import update_nested_dict
ImportError: cannot import name 'Generator' from 'distgen' (/home/guler/anaconda3/envs/astra/lib/python3.9/site-packages/distgen-1.7-py3.9.egg/distgen/__init__.py)
@hayg25 distgen
is a dependancy. Install via conda:
conda install -c conda-forge distgen
Hi @ChristopherMayes, thanks, there is no error remains. I cannot see the field plot but I know that Astra uses the periodic solutions to create the Electric Field amplitude. Is there a way to get that method into Lume-Astra ?
Thanks again
@hayg25 Could you send me a minimal (but complete) example for me to debug?
Hi @ChristopherMayes , here is my example files. Please tell me if something is missing.
Hi @ChristopherMayes , have you tried / succeeded to treat TWS structures in Lume-Astra ?
Cheers, Hayg
@hayg25 I added code to correctly plot the periodic field map, and adapted your example: https://github.com/ChristopherMayes/lume-astra/blob/master/examples/elements/tws.ipynb
Please let me know if this works for you.
Hi @ChristopherMayes , yes it works fine now thanks ! the length of the cavity is not taken into account, may be the numbers could be taken from the astra file ?
Nue(2)=2.99855
MaxE(2)=14.0
Phi(2)=0
C_pos(2)=1.528
C_Smooth(2)=0
C_numb(2)=135
other question : do you understand why it says
Path does not exist for symlink: RAD
Thanks again
@hayg25 It actually does read C_numb
= 135. Your period (in the fieldmap file) is about 0.1 m, which gives a 13.5 m long cavity.
You can ignore the RAD warning for now. This is because Astra lets you put in a keyword in place of a file, and LUME-Astra looks at file keys for real files. I will fix this in the future.
Dear @ChristopherMayes, I see. You should divide by 3 to get the cell length due to the period (see attached description). 4cellprototype.pptx In reality, the TWS cavity is around 4.8 m including the beam pipes.
many thanks
@hayg25 Thank you, I fixed the code. Would you mind if I use your digram in the example?
Hi @ChristopherMayes , Yes of course use it and thanks Alain for all your effort !
Dear @ChristopherMayes , thanks again for all your efforts. Concerning the E-field of the cavity you plotted, we would like to also plot the complex magnitude component as displayed by the Astra fieldplot program. See the attached plots.
Many thanks
Dear All, we are facing an error using travelling wave. We use an ascii file that describe the Real part of the Ez field. (Astra creates Ez amplitude. ) here is the beginning of the field file :
So in lume-astra I am facing an error concerning the first line which has 4 rows ...
see the error when trying the fieldplot :
Thanks for the feedback.