Definition at line 185 of file abcd_optics.py. 00185 : 00186 zpos=0.0 00187 objectpos=[] 00188 objects=[] 00189 for (dz,obj) in matlist: #mark out positions of optical components, backup up over probes 00190 objectpos.append(zpos+dz) 00191 if not isinstance(obj,probe): zpos+=dz 00192 objects.append(obj) 00193 zpos=0.0 00194 opticindex=0 00195 resultlist=[] 00196 doing_optic=0 00197 while (zpos < end_dist): 00198 qparm=q0.qw(matx(matlist, zpos)) 00199 next_waist=zpos-qparm.q.real 00200 resultlist.append((zpos, qparm)) 00201 if opticindex < len(objectpos): 00202 next_optic=objectpos[opticindex] 00203 optic=objects[opticindex] 00204 else: 00205 next_optic=end_dist+1 00206 optic=None 00207 if not doing_optic: 00208 if next_waist > zpos and next_waist < next_optic-1: 00209 zpos=next_waist 00210 else: 00211 if isinstance(optic, identityoptic): 00212 zpos=next_optic 00213 optic.setqparm(q0.qw(matx(matlist, zpos))) 00214 resultlist.append((objectpos[opticindex],str(optic))) 00215 opticindex += 1 00216 else: 00217 zpos=next_optic-1 00218 doing_optic=1 00219 else: 00220 resultlist.append((objectpos[opticindex],str(matlist[opticindex][1]))) 00221 zpos+=2 00222 opticindex+=1 00223 doing_optic=0 00224 resultlist.append((end_dist, q0.qw(matx(matlist, end_dist)))) 00225 self.trace=resultlist 00226 def __str__(self):
|