Skip to content

Commit

Permalink
Fixe Tao show spin command.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSagan committed Oct 15, 2024
1 parent 2e5d3f1 commit f5845bf
Show file tree
Hide file tree
Showing 21 changed files with 113 additions and 218,286 deletions.
15 changes: 13 additions & 2 deletions regression_tests/tao_test/output.correct
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
"Bookkeeper1" STR "GOOD"
"Bookkeeper2" STR "GOOD"
"spin-tune" ABS 1E-9 7.8680758427E-02
"Polarization Limit ST" REL 1E-9 8.2401772695E-01
"Polarization Limit DK" REL 1E-9 3.0639976557E-01
"Polarization Limits DK (a,b,c-modes)" REL 1E-9 8.4610268984E-01 7.7430731662E-01 3.1362070667E-01
"Polarization Limits DK (bc,ac,ab-modes)" REL 1E-9 2.6156335961E-01 3.6466666252E-01 8.0652175994E-01
"Polarization Rate BKS" REL 1E-9 2.5298438208E-03
"Depolarization Rate" REL 1E-9 1.4282072832E-03
"Depolarization Rate" REL 1E-9 4.2702606701E-05 2.2922955017E-05 1.3881174922E-03
"Depolarization Rate" REL 1E-9 1.7549445179E-03 1.0919736600E-03 3.5032159237E-05
"Integral g^3 * b_hat * n_0" REL 1E-9 2.0501003099E-10
"Integral g^3 * b_hat * dn/ddelta" REL 1E-9 8.5744575383E-11
"Integral g^3 (1 - 2(n * s_hat)/9)" REL 1E-9 2.2982534032E-10
"Integral g^3 * 11 (dn/ddelta)^2 / 9" REL 1E-9 1.2974643818E-10
33 changes: 4 additions & 29 deletions regression_tests/tao_test/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,10 @@
import os
import sys

out_file = open('output.now', 'w')

if os.path.isabs(sys.argv[1]):
exe = sys.argv[1] + 'tao'
else:
exe = '../' + sys.argv[1] + 'tao'

#-----------

print ('Test1...')
os.chdir('test1')
results = subprocess.run([exe, '-noplot', '-lat', 'lat.bmad'], stdout=subprocess.PIPE).stdout.decode('utf-8')
os.chdir('..')

if 'contact DCS' in results or 'FATAL' in results:
out_file.write ('"Bookkeeper1" STR "BAD"\n')
print(results)
else:
out_file.write ('"Bookkeeper1" STR "GOOD"\n')
exe = sys.argv[1] + 'tao'

#-----------

print ('Test2...')
os.chdir('test2')
results = subprocess.run([exe, '-noplot', '-lat', 'lat.bmad'], stdout=subprocess.PIPE).stdout.decode('utf-8')
os.chdir('..')

if 'contact DCS' in results or 'FATAL' in results:
out_file.write ('"Bookkeeper2" STR "BAD"\n')
print(results)
else:
out_file.write ('"Bookkeeper2" STR "GOOD"\n')
print ('Test...')
#os.chdir('test1')
results = subprocess.run([exe, '-noplot', '-lat', 'small_ring.bmad'], stdout=subprocess.PIPE).stdout.decode('utf-8')
23 changes: 23 additions & 0 deletions regression_tests/tao_test/small_ring.bmad
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
parameter[p0c] = 1e11
bmad_com[radiation_damping_on] = f
bmad_com[radiation_fluctuations_on] = f
bmad_com[spin_tracking_on] = T

q1: quad, l = 0.5, k1 = 0.6, vkick = 0.0001
q2: quad, l = 0.5, k1 = -0.7, hkick = 1e-5

d: drift, l = 0.3
b: sbend, l = 3, angle = 1e-3, e1 = 0.07, e2 = 0.07

sol1: solenoid, l = 0.1, ks = 1
sol2: solenoid, l = 0.1, ks = 1

s1: sextupole, l = 0.01
s2: sextupole, l = 0.01

rf: rfcavity, l = 0.6, rf_frequency = 500e6, voltage = 1e10

sector: line = (sol1, s1, d, q1, d, b, sol2, d, q2, d, s2, rf, b)
ring: line = (1*sector)

use, ring
2 changes: 2 additions & 0 deletions regression_tests/tao_test/tao.startup
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
regression
exit
Loading

0 comments on commit f5845bf

Please sign in to comment.