bmad-sim / pytao

PyTao is Python interface for Tao, which is based on the Bmad subroutine library for relativistic charged–particle and X-ray simulations in accelerators and storage rings.
https://bmad-sim.github.io/pytao
GNU General Public License v3.0
9 stars 6 forks source link

Runtime error in PyTao #70

Closed BhawinDhital closed 8 months ago

BhawinDhital commented 8 months ago

I am using many observation points in the beam line and using saved_at = "marker::". &tao_beam_init ix_universe = 1 saved_at = "marker::" ! !saved_at = "D30_obs,D31_obs,D60_obs,D61_obs,Oct01_obs,Oct1_obs,Oct02_obs,Oct2_obs,Target_obs " !beam_init%position_file = 'text.txt' beam_init%n_particle = 2000 beam_init%n_bunch = 1 beam_init%bunch_charge = 1.5e-9 !beam_init%a_norm_emit = 1.0347195315e-5 !beam_init%b_norm_emit = 1.050736e-5 beam_init%a_emit = 4.78485424e-07 beam_init%b_emit = 2.30962251e-07 !beam_saved_at = "D30_obs,D31_obs,D60_obs,D61_obs,Oct0_obs,Oct1_obs,Oct2_obs,Oct2_obs,Target_obs " !beam_saved_at = "" !beam_init%sig_pz = .00046 !beam_init%sig_z = 7.5 track_start = 0 track_end = 112

!beam_init%random_engine = "pseudo" /

It saves for first few markers but gives an error for later observation point: RuntimeError: ERROR detected: [ERROR | 2023-OCT-17 10:49:31] tao_python_cmd: "python bunch1 Oct1_obs|model 1 x": BEAM NOT SAVED AT ELEMENT. INVALID

And tao.cmd('show beam Oct1_obs') gives:

['Bunch parameters at: OCT1_OBS (123)', 'Beam not tracked through this element!']

DavidSagan commented 8 months ago

@BhawinDhital Please attach all files you use. Easiest is to use zip.

BhawinDhital commented 8 months ago

Please find the attached zipped file.

d3totarget-bmad.zip

BhawinDhital commented 8 months ago

nsrl.bmad is the main file, nsrl.lines.bmad has all lines used in the transport line, nsrl.markers.bmad is the file with all markers, and so on.

DavidSagan commented 8 months ago

@BhawinDhital Did you fix the problem?

BhawinDhital commented 8 months ago

Hi David, Yes I fixed the problem. The problem was in input file. Thank you.