Skip to Content.
Sympa Menu

opal - Re: [Opal] Injected distribution with OFFSETZ

opal AT lists.psi.ch

Subject: The OPAL Discussion Forum

List archive

Re: [Opal] Injected distribution with OFFSETZ


Chronological Thread 
  • 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 10:21:48 +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:xC8qzh+jruLybP9uRHKM819IXTAuvvDOBiVQ1KB+0u0eIJqq85mqBkHD//Il1AaPAdyFragdwLKM++C4ACpcuMvH6ChDOLV3FDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3OgV6PPn6FZDPhMqrye+y54fTYwJVjzahfL9+Nhq7oRjQu8UMn4duN6k9xgfXrnBVf+ha2X5kKUickhrh5sq85oJv/zhVt/k868NOTKL2crgiQ7dFFjomKWc15MPqtRnHUwSC42YXX3sVnBRVHQXL9Qn2UZjtvCT0sOp9wzSaMtbtTb8oQzSi7rxkRwHuhSwaKjM26mDXish3jKJGvBKsogF0zoDIbI2JMvd1Y7jQds0GS2VfQslRVjRBAoKiYIsJE+oBJvtTo43kq1cTsReyGQygCeXywTFKm3D2x7U33eQ8Hw/Y0gwgGNEAvnrao9r6NqgdTeG1wbLSwjnfdf5bwyvx5YbKfx0nvPqCXahwcc3UyUQ3GQ/LgE+QpZb4ND2I1+QNtm+b7+x9XuyvkW4nqh9+rSWxycc2i4nGmoIVxl7Z/ih+24Y5P9O4SFR6YdG6DZRfqTuaN4pqTcMiWGxopSA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81fzIQjNXbvhv AFfqvIh+4P7L9Kuc9FfMqV0w/urw3uXKMiOvQWVazbZYkVZNbY1aMNHlQ/P66THgey4qntvmDi qgwHO0KvlvaH2mD3kvaigkPTqfgvQE2HJ2eG0d+/sRT8lDt97iMgJVq/BhefBySsUTcqTsef1w HFTRHPEf0s61j0jtLbodRckGe3Ap6w/m5UECXkP8SRnMjw+OtgFiXqkvLPr3IbyRThtqgxfuih mXs=
  • Organization: Institut für Kernphysik Mainz

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,"

Am 09.07.2020 um 10:29 schrieb Christof Metzger-Kraus:
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

PNG image




Archive powered by MHonArc 2.6.19.

Top of Page