Skip to content

Commit f6bcce6

Browse files
authored
Merge pull request #304 from atcollab/transfer_line
Avoid W and Chrom calculations in transfer line mode
2 parents d720f80 + ef4d94f commit f6bcce6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pyat/at/physics/linear.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ def unwrap(mu):
328328
if get_chrom or get_w:
329329
warnings.warn(AtWarning("'get_chrom' and 'get_w' are ignored in "
330330
"transfer-line mode"))
331+
get_chrom = False
332+
get_w = False
331333
orbit, sigma, d0 = build_sigma(twiss_in, orbit)
332334
dorbit = numpy.hstack((0.5*dp_step*d0, 0.5*dp_step, 0.0))
333335
# Get 1-turn transfer matrix
@@ -338,8 +340,10 @@ def unwrap(mu):
338340

339341
# Perform analysis
340342
vps, dtype, el0, els = analyze(mxx, ms)
341-
tunes = numpy.mod(numpy.angle(vps) / 2.0 / pi, 1.0) if twiss_in is None \
342-
else numpy.NaN
343+
if twiss_in is None:
344+
tunes = numpy.mod(numpy.angle(vps) / 2.0 / pi, 1.0)
345+
else:
346+
tunes = numpy.NaN
343347

344348
# Propagate the closed orbit
345349
orb0, orbs = get_orbit(ring, refpts=refpts, orbit=orbit,

0 commit comments

Comments
 (0)