Skip to Content.
Sympa Menu

opal - Re: [Opal] Load phase space data in different time steps for a bunch in .h5 file

opal AT lists.psi.ch

Subject: The OPAL Discussion Forum

List archive

Re: [Opal] Load phase space data in different time steps for a bunch in .h5 file


Chronological Thread  
  • From: Siao-Cing Liou <sawout AT gmail.com>
  • To: 18001331171 <18001331171 AT 189.cn>, opal AT lists.psi.ch
  • Subject: Re: [Opal] Load phase space data in different time steps for a bunch in .h5 file
  • Date: Wed, 15 Mar 2023 09:50:38 +0800
  • Authentication-results: mc3.ethz.ch; iprev=pass (mail-yb1-f180.google.com) smtp.remote-ip=209.85.219.180; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com

It works and "ds.getData('x',step = i)" also works. 
Thank you very much.

Cheers,
Siao-Cing Liou


18001331171 <18001331171 AT 189.cn> 於 2023年3月14日 週二 下午6:01寫道:
Not sure if this is the right way. But you can try this command 
plt=ds.plot_phase_space(‘x’,’y’,step=i)
Where i is the step number and you can change it in a loop.


sawout <sawout AT gmail.com>写到:

Dear All,
I am new to OPAL. I use the example code "RingCyclotron.in" with "PSDUMPFREQ = 250", "turns = 5", "nstep = 2000", and "NPART = 1e2". I want to load the phase space data (x,y,z) in different time steps for a bunch.
I use the following code in pyOPALTools:
------------------------------------------------------------------------
from opal import load_dataset

ds = load_dataset('./ ', fname='RingCyclotron. h5 ')
x = ds.getData('x')
y = ds.getData('y')
z = ds.getData('z')
------------------------------------------------------------------------
From the above script, it (x,y,z) only comes out the initial bunch data. Is any method to load phase space data in different time steps? Or the setting is wrong?

Best regards
Siao-Cing Liou



--

Siao-Cing Liou
Department of Physics
National Tsing Hua University
Hsinchu City, Taiwan, R.O.C.
E-mail: sawout AT gmail.com




Archive powered by MHonArc 2.6.24.

Top of Page