OscarES / serpentinetracker

Automatically exported from code.google.com/p/serpentinetracker
GNU General Public License v3.0
0 stars 0 forks source link

Nested serpentine object S-positions not consistent #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
import beamline
import beamrep
import serpentine as st
from elements import *

bl = beamline.Line()
bl.append(Drift(name='drift0', L=1))
ind = 1
bpmgrd0 = beamline.Line()
bpmgrd1 = beamline.Line()
for d in range(3):
        bpmgrd0.append(BPM(name='bpm'+str(ind),L=0,res=1e-7))
        bpmgrd0.append(Drift(name='drift'+str(ind),L=1))
        ind += 1

for d in range(3):
        bpmgrd1.append(Drift(name='drift'+str(ind),L=1))
        bpmgrd1.append(BPM(name='bpm'+str(ind),L=0,res=1e-7))
        ind += 1

bl.append(st.Serpentine(line=bpmgrd0))
bl.append(Quad(name='clicquad',L=0.5,B=50))
bl.append(st.Serpentine(line=bpmgrd1))

bm = beamrep.Beam(P=11)
s = st.Serpentine(line=bl,beam=bm)

print s.beamline[s.beamline.FindEleByType('Quad')[0]].S
print [b.S for b in s.beamline.GetEleByType('BPM')]

What is the expected output? What do you see instead?
Expected:
4
[1,2,3,5.5,6.5,7.5]

Seen:
1
[1, 2, 3, 2.5, 3.5, 4.5]

What version of the product are you using? On what operating system?
serpentine revision 105
python 2.5.5

Please provide any additional information below.
Thanks

Original issue reported on code.google.com by Francis....@live.rhul.ac.uk on 2 Jun 2011 at 9:16