samoylv / WPG

WPG: WavePropaGator, Interactive framework for X-ray FEL optics design and simulations.
Other
26 stars 20 forks source link

Optical Element "Screen" #111

Open CFGrote opened 7 years ago

CFGrote commented 7 years ago

This is a suggestion for adding an optical element that acts like a screen. It can be used to dump the wavefront at the screen's position to a file. In this way, we could trace the the WF as it propagates through the beamline more easily. Right now, to achieve this, I have to comment the later parts of the beamline, propagate, save, then uncomment the next element, run and save again etc. By inserting screens at interesting points in the beamline, this becomes more flexible and user friendly. By default, it should dump the entire WF (no resize, clipping, resampling etc.), such that a dumped WF could be used to restart the propagation from that point. A default filename could be taken from the distance from the source.

Or maybe this exists already and I'm just too blind to see it ;)

samoylv commented 7 years ago

I'm not sure it can work - from mathematical point of view the container ( or beamline) which consists of appended propagators, is as a whole the kernel of Fresnel integral that is solved for propagation. You can split the beamline in few ones and dump intermediate WFs in files - it may reduce accuracy but should work

CFGrote commented 7 years ago

hm. what about the optical_elements.Empty class? it's almost what i want, except for dumping the WF.

samoylv commented 7 years ago

we should ask about Empty propagator implementation details @buzmakov , but I am pretty sure, that the Empty can be only the last one element there, and it is special hacking in SRW library to cope

CFGrote commented 7 years ago

yes, i just saw it. will not work.

instead i'm writing a stepwise propagation in prop/propagate_s2e that does the job. almost done.

carsten

On 03/29/2017 03:29 PM, samoylv wrote:

we should ask about Empty propagator implementation details @buzmakov https://github.com/buzmakov , but I am pretty sure, that the Empty can be only the last one element there, and it is special hacking in SRW library to cope

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/samoylv/WPG/issues/111#issuecomment-290089965, or mute the thread https://github.com/notifications/unsubscribe-auth/AOwoR4ldLSEwcrueHBZyVVMOCijQY2zeks5rqlzWgaJpZM4Msvxl.

-- Dr. Carsten Fortmann-Grote Scientist for Scientific Simulations / Wissenschaftler fuer wissenschaftliche Simulationen European XFEL GmbH Holzkoppel 4 22869 Schenefeld Germany

Phone: +49 (0)40 8998-5603 Fax: +49 (0)40 8998-1905 Email: carsten.grote@xfel.eu Web: www.xfel.eu

Managing Directors: Prof. Dr. Robert Feidenhans'l, Dr. Claudia Burger

Registered as European X-Ray Free-Electron Laser Facility GmbH at Amtsgericht Hamburg, HRB 111165

CFGrote commented 7 years ago

112

implemented stepwise propagation in propagate_s2e in prop module. in test case, the final step gives the same result as propagate():

Stepwise propagation: stepwise

One-go propagation: reference