opal AT lists.psi.ch
Subject: The OPAL Discussion Forum
List archive
- From: "Dr. Simon Friederich" <s.friederich AT uni-mainz.de>
- To: Christof Metzger-Kraus <christof.j.kraus AT gmail.com>
- Cc: "opal AT lists.psi.ch" <opal AT lists.psi.ch>
- Subject: Re: [Opal] Injected distribution with OFFSETZ
- Date: Fri, 10 Jul 2020 11:34:50 +0200
- Authentication-results: localhost; iprev=pass (ironport-1.zdv.net) smtp.remote-ip=134.93.178.241; spf=pass smtp.mailfrom=uni-mainz.de; dkim=pass header.d=uni-mainz.de header.s=20190702 header.a=rsa-sha256; dmarc=pass header.from=uni-mainz.de
- Ironport-phdr: 9a23:PJVQ2hbwtcKeZcJXIgvXt87/LSx+4OfEezUN459isYplN5qZps29bB7h7PlgxGXEQZ/co6odzbaP7ea6ACdZuN7B6ClELMUREUddyI0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUoHdgN6q2O+s5pbdfxtHhCanYbN1MR66sRjdutMZjId/K6s90AXFrmZHd+hL2G9jOFafkwrh6suq85Nv7iRdt+g9+8JcVKnxYrg1Q6FfADk6KW4++dfltQPETQuB53scVnsZnx9VCAXb7x/0Q4n8vDLiuuVyxCeVM8v2TaspWTu59KdkVAXoiCYcODEn9mzcl9F9g7haoBKloBx/3pLUbYSIP/dwYq/RYdUXTndaU81PSyJOHJ+zb4oXD+oAI+lYqZX9p0ATphe6HAWgGf/jxiNNinLwwKY00fkuERve0QI9AdwOvnTarNL2OqkcX++6w6vHwinCb/5Nwzjx9JLFfwo9rfyCX799d9fax0k1FwPCi1WdsYLpMT2P1ugXrmOV8utgVeeoi24htgp/oiKvxsYyhYbUmI0V0FHE+jl5wIo7ONa1T1V7bcSqEJtKtiGVKZZ5Td04Q2FppCk6yqYLuYO9fCgL0ZgnwgTQa/2Bc4mJ+B7sSfieLC5+iXl4d72xmwy8/lK8yu3gSMa0ylBKozJFnNTItn4AygHe5MiZRvdg4kqs1zSC2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9mKANdzqFCtxG02KaPjkjpSu8k9JSOs8N9pWHhkAyL4P9BlMPLLIpBQ0xtCfWup90oD1KJ6T RsmUGep1p0z/dXBYBwKUqKa8uLuISPxkmc/Nya+W0WI1pY9ylDrzWKdt/5FOWp9uZsTAQILDn7 he8=
- Organization: Institut für Kernphysik Mainz
Dear Christof,
That did it. Thanks again very much! That was the missing hint. I've completely overlooked the ZSTART parameter. (Maybe one could refer to this parameter in the description of the OFFSETZ in the manual.)
Have a nice weekend.
Best regards,
Simon
Hi Christof,
Thank you for
the answer.
I thought of using the MONITOR output + FROMFILE too, but it does not work, i.e. if the distribution still gets emitted at bar(z)=0.
I have a temporal distribution extracted at z=0.7 as you suggested (using the TEMPORAL type of monitor) and used the following python code to convert it:
from opal.opal import load_dataset monitor_filename="temp_distr_0700.h5" mon = load_dataset(".", fname=monitor_filename) spos = mon._H5Dataset__parser.getStepAttribute('SPOS') fromfile_cols = ['x', 'px', 'y', 'py', 'z', 'pz'] df = mon.getMonitorDataFrame()[fromfile_cols] #df.z += spos mon.__del__() output_filename = monitor_filename[:-3] + ".dat" with open(output_filename, "w") as filen: filen.write(f"{len(df)}\n") df.to_csv(filen, index=None, sep=" ", header=None)
I have also added the SPOS of the monitor (~0.7) to the z-component (line 8), but it does not change the output.
Best regards
Simon
P.S: The manual
has double "slightly" in the FROMFILE chapter "The
text input file for the FROMFILE
distribution type has slightly a slightly different
format,"
Hi Simon,
if I remember correctly then the beam is always emitted at z = 0. I don't know what (if at all) effect OFFSETZ has when the beam is emitted. But I'm sure we will find another way to accomplish what you intended. E.g. you could use a monitor with TYPE = TEMPORAL. Then you use the recorded distribution (using FROMFILE) in the following optimization. The downside of this approach is that you have to export the data from the hdf5 file to ascii (using e.g. matlab/octave or python).
Best regards,Christof
On Tue, Jul 7, 2020 at 6:47 PM Dr. Simon Friederich <s.friederich AT uni-mainz.de> wrote:
Dear OPAL-Team,
My goal: I want to inject an electron bunch with a gaussian distribution at Z=-0.2 and have it cross a solenoid which is located at 0.0.
I tried: To use the OFFSETZ parameter, but it has not the desired effect (I expect the stat-file to start from s=-0.2m, right?).
I have also tried: To change the CATHODE's position, but it has no(t the desired) effect either.
I wanted to use the OFFSETZ parameter once to import a particle distribution at a specific point within my beam line so that I don't have to change the elements position and get the same result as if I injected the start-distribution at (0,0,0). [The purpose was to save computational time, because I could optimize the beam line step by step without having to simulate everything from the beginning]
If you find the time, maybe you could have a look at my input files and tell me what I've missed here.
Best regards,
Simon
-- Dr. Simon Friederich Helmholtz-Institut Mainz Kollaboration B/ACID Johannes Gutenberg-Universität Mainz Staudingerweg 18 55128 Mainz, Deutschland Tel.: +49 (0)6131 39-23160 E-Mail: s.friederich AT uni-mainz.de
-- Dr. Simon Friederich Helmholtz-Institut Mainz Kollaboration B/ACID Johannes Gutenberg-Universität Mainz Staudingerweg 18 55128 Mainz, Deutschland Tel.: +49 (0)6131 39-23160 E-Mail: s.friederich AT uni-mainz.de
-- Dr. Simon Friederich Helmholtz-Institut Mainz Kollaboration B/ACID Johannes Gutenberg-Universität Mainz Staudingerweg 18 55128 Mainz, Deutschland Tel.: +49 (0)6131 39-23160 E-Mail: s.friederich AT uni-mainz.de
- [Opal] Injected distribution with OFFSETZ, Dr. Simon Friederich, 07/07/2020
- Re: [Opal] Injected distribution with OFFSETZ, Christof Metzger-Kraus, 07/09/2020
- Re: [Opal] Injected distribution with OFFSETZ, Dr. Simon Friederich, 07/10/2020
- Re: [Opal] Injected distribution with OFFSETZ, Christof Metzger-Kraus, 07/10/2020
- Re: [Opal] Injected distribution with OFFSETZ, Dr. Simon Friederich, 07/10/2020
- Re: [Opal] Injected distribution with OFFSETZ, Christof Metzger-Kraus, 07/10/2020
- Re: [Opal] Injected distribution with OFFSETZ, Dr. Simon Friederich, 07/10/2020
- Re: [Opal] Injected distribution with OFFSETZ, Christof Metzger-Kraus, 07/09/2020
Archive powered by MHonArc 2.6.19.