Definition at line 393 of file general_optics_example.py. 00393 : 00394 my=ir_compressor 00395 input_height=18*inch 00396 output_height=12*inch 00397 center_height=(input_height+output_height)/2.0 00398 00399 basebeam=beam((0,input_height,-1.0), qtens(lambda0, w=0.005, r=Infinity)) 00400 optics={} 00401 00402 optics[my.INPUT]=m1=reflector("input mirror", center=(0, input_height, 0), width=8*inch, angle=-45) 00403 00404 optics[my.G1]=g1=grating("g1", angle=theta1+90, center=(52*inch,center_height, 0), 00405 pitch=1740e3, order=1, width=16*inch, thickness=2.0*inch) 00406 mybeam=basebeam.clone() 00407 m1.transport_to_here(mybeam) 00408 m1.transform(mybeam) 00409 g1.transport_to_here(mybeam) 00410 g1.transform(mybeam) 00411 mybeam.free_drift(clen) #this is where grating 2 should be 00412 optics[my.G2]=g2=grating("g2", angle=theta1-90, center=mybeam.x0+(0,0,1e-8), 00413 pitch=1740e3, order=1, width=16*inch, thickness=2.0*inch) 00414 00415 optics[my.VR1]=reflector("retro", center=(40*inch, center_height, g2.center[2]), angle=90.0, width=8*inch, thickness=1.0*inch) 00416 00417 out=optics[my.OUTPUT]=reflector("output mirror", center=(8*inch, output_height, 0.0), 00418 width=8.0*inch, thickness=1.0*inch) 00419 focus=optics[my.FOCUS]=lens("output focus", center=out.center+(35*inch, 0, 7*inch), 00420 angle=90-math.atan(0.2)/deg, f=2.0, width=8.0*inch, 00421 height=8.0*inch, thickness=1.0*inch).tilt_off_axis(0) 00422 out.set_direction(g1.center-(0, center_height-output_height, 0), focus) 00423 00424 comp_order=(my.INPUT, my.G1, my.G2, my.VR1, my.G2, my.G1, my.OUTPUT, my.FOCUS) 00425 00426 composite_optic.init(self, "ir compressor", optics, comp_order, None, center=center, angle=0, extras=extras ) 00427 00428 #prepare to handle to downslope in the beam through the compressor while we are still 00429 #not rotated to the funny beam axis 00430 m1label=self.mark_label(my.INPUT) 00431 g1label=self.mark_label(my.G1) 00432 m2label=self.mark_label(my.OUTPUT) 00433 ir_trace=trace_path(self, basebeam.clone()) 00434 path_len=(ir_trace[(m2label,0)].total_drift-ir_trace[(m1label,0)].total_drift) 00435 slope=(output_height-input_height)/path_len 00436 00437 #distance from entrance to first g1 hit 00438 g1_first_distance=(ir_trace[(g1label,0)].total_drift-ir_trace[(m1label,0)].total_drift) 00439 #distance from entrance to second g1 hit 00440 g1_second_distance=(ir_trace[(g1label,1)].total_drift-ir_trace[(m1label,0)].total_drift) 00441 00442 #now, rotate us to the real beam direction 00443 self.update_coordinates(self.center, self.center, general_optics.eulermat(angle, 0, 0)) 00444 00445 #and set up the aiming points 00446 self.g1target1=g1.center+(0, (input_height-center_height)+g1_first_distance*slope, 0) 00447 self.g1target2=g1.center+(0, (input_height-center_height)+g1_second_distance*slope, 0) 00448 out.set_direction(self.g1target2, focus) 00449 def set_entrance_direction(self, look_to):
|