Liebe Leute,
Here's the current function
def trace_obj(lattice, obj, nPoints=None, attach2elem=False):
"""
track object through the lattice
obj must be Twiss or Particle
"""
if nPoints is None:
obj_list = [obj]
for e in lattice.sequence:
for tm in e.first_order_tms:
obj = tm * obj
obj.id = e.id
obj_list.append(obj)
if attach2elem:
e.tws = obj
else:
z_array = np.linspace(0, lattice.totalLen, nPoints, endpoint=True)
obj_list = trace_z(lattice, obj, z_array)
return obj_list
As you can see we return one twiss per map. We should perhaps consider returning one twiss per element instead. I think this would be better.
Like this:
for e in lattice.sequence:
for tm in e.first_order_tms:
obj = tm * obj
obj.id = e.id
obj_list.append(obj)
if attach2elem:
e.tws = obj
What do you think? Or make it an option?
Liebe Leute,
Here's the current function
As you can see we return one twiss per map. We should perhaps consider returning one twiss per element instead. I think this would be better.
Like this:
What do you think? Or make it an option?