You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I set a quad strength to a bad setting Pytao crashes:
python test2.py
Traceback (most recent call last):
File "/Users/vahidranjbar/Develop/RCS/RCS_2/RCS_DougH/May2024Lat/test2.py", line 17, in
error = tao.cmd("set element QF0 K1=.6")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/vahidranjbar/miniconda3/lib/python3.11/site-packages/pytao/tao_ctypes/core.py", line 146, in cmd
raise RuntimeError(f"Command: {cmd} causes error: {err}")
RuntimeError: Command: set element QF0 K1=.6 causes error: ERROR detected: [ERROR | 2024-JUL-05 21:19:25] closed_orbit_calc:
PARTICLE LOST IN TRACKING!!
ABORTING CLOSED ORBIT SEARCH.
TRACKING BRANCH: 0:RING
This is the python script:
from pytao import Tao
import numpy
import sys
import time
import math
import subprocess
import os
You can still get the error output of the command by using:
error=tao.cmd("set element QF0 K1=.6", raises=False)
There's not currently a good way of filtering out specific error messages or ignoring them entirely. Errors and warnings unfortunately come directly from Tao in the same data stream as the output information from each command.
When I set a quad strength to a bad setting Pytao crashes:
python test2.py
Traceback (most recent call last):
File "/Users/vahidranjbar/Develop/RCS/RCS_2/RCS_DougH/May2024Lat/test2.py", line 17, in
error = tao.cmd("set element QF0 K1=.6")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/vahidranjbar/miniconda3/lib/python3.11/site-packages/pytao/tao_ctypes/core.py", line 146, in cmd
raise RuntimeError(f"Command: {cmd} causes error: {err}")
RuntimeError: Command: set element QF0 K1=.6 causes error: ERROR detected: [ERROR | 2024-JUL-05 21:19:25] closed_orbit_calc:
PARTICLE LOST IN TRACKING!!
ABORTING CLOSED ORBIT SEARCH.
TRACKING BRANCH: 0:RING
This is the python script:
from pytao import Tao
import numpy
import sys
import time
import math
import subprocess
import os
from subprocess import Popen, PIPE
load_lattice ='-lat rcsl4s1-wig_henry.bmad -noplot'
tao=Tao(load_lattice)
#names = tao.ele_gen_attribs('k1')
#print(names[0:105])
#gammaT =float(names[42].split()[1]))
error = tao.cmd("set element QF0 K1=.6")
names = tao.cmd("show universe")
print(error)
print(names)
The text was updated successfully, but these errors were encountered: