def init(self, theta1, clen, lambda0, center, angle, extras): my=ir_compressor input_height=18*inch output_height=12*inch center_height=(input_height+output_height)/2.0 basebeam=beam((0,input_height,-1.0), qtens(lambda0, w=0.005, r=Infinity)) optics={} optics[my.INPUT]=m1=reflector("input mirror", center=(0, input_height, 0), width=8*inch, angle=-45) optics[my.G1]=g1=grating("g1", angle=theta1+90, center=(52*inch,center_height, 0), pitch=1740e3, order=1, width=16*inch, thickness=2.0*inch) mybeam=basebeam.clone() m1.transport_to_here(mybeam) m1.transform(mybeam) g1.transport_to_here(mybeam) g1.transform(mybeam) mybeam.free_drift(clen) #this is where grating 2 should be optics[my.G2]=g2=grating("g2", angle=theta1-90, center=mybeam.x0+(0,0,1e-8), pitch=1740e3, order=1, width=16*inch, thickness=2.0*inch) optics[my.VR1]=reflector("retro", center=(40*inch, center_height, g2.center[2]), angle=90.0, width=8*inch, thickness=1.0*inch) out=optics[my.OUTPUT]=reflector("output mirror", center=(8*inch, output_height, 0.0), width=8.0*inch, thickness=1.0*inch) focus=optics[my.FOCUS]=lens("output focus", center=out.center+(35*inch, 0, 7*inch), angle=90-math.atan(0.2)/deg, f=2.0, width=8.0*inch, height=8.0*inch, thickness=1.0*inch).tilt_off_axis(0) out.set_direction(g1.center-(0, center_height-output_height, 0), focus) comp_order=(my.INPUT, my.G1, my.G2, my.VR1, my.G2, my.G1, my.OUTPUT, my.FOCUS) composite_optic.init(self, "ir compressor", optics, comp_order, None, center=center, angle=0, extras=extras ) #prepare to handle to downslope in the beam through the compressor while we are still #not rotated to the funny beam axis m1label=self.mark_label(my.INPUT) g1label=self.mark_label(my.G1) m2label=self.mark_label(my.OUTPUT) ir_trace=trace_path(self, basebeam.clone()) path_len=(ir_trace[(m2label,0)].total_drift-ir_trace[(m1label,0)].total_drift) slope=(output_height-input_height)/path_len #distance from entrance to first g1 hit g1_first_distance=(ir_trace[(g1label,0)].total_drift-ir_trace[(m1label,0)].total_drift) #distance from entrance to second g1 hit g1_second_distance=(ir_trace[(g1label,1)].total_drift-ir_trace[(m1label,0)].total_drift) #now, rotate us to the real beam direction self.update_coordinates(self.center, self.center, general_optics.eulermat(angle, 0, 0)) #and set up the aiming points self.g1target1=g1.center+(0, (input_height-center_height)+g1_first_distance*slope, 0) self.g1target2=g1.center+(0, (input_height-center_height)+g1_second_distance*slope, 0) out.set_direction(self.g1target2, focus)
def setup_reflectors_blue(self, basebeam, theta1, clen, grating_spot_offset, pitch=1.5e6, lam0=1.053e-6, inside_retro_err=0, zeta=0): my = blue_compressor y_offset = my.y_offset grate = grating(my.GRATE, angle=theta1, center=(0, y_offset / 2, 0), pitch=pitch, order=1, justify=-.8, height=0.05, width=0.1) littrow, beta = grate.degree_angles(theta1, lam0) vertex_dist = (clen - grating_spot_offset * sin(beta * deg)) * 0.5 retro_beam_offset = grating_spot_offset * math.cos(beta * deg) * 0.5 beam = basebeam.clone().set_lambda(lam0) grate.transport_to_here(beam) grate.transform(beam) return_x = -grating_spot_offset * math.cos(theta1 * deg) vretvertex = Numeric.array((return_x, y_offset / 2, -0.22)) yvec = Numeric.array((0., y_offset, 0.)) ir1, ir2 = self.setup_retro_standard(beam, vertex_dist, retro_beam_offset, inside_retro_err, y_offset / 2) vr1 = reflector('vert retro 1', angle=0, center=vretvertex - yvec / 2, width=0.025, height=0.05, thickness=0.01) vr2 = reflector('vert retro 2', angle=0, center=vretvertex + yvec / 2, width=0.025, height=0.05) vr1.set_direction((return_x, 0, 0), vr2) vr2.set_direction(vr1, (return_x, y_offset, 0)) return { my.GRATE: grate, my.IR1: ir1, my.IR2: ir2, my.VR1: vr1, my.VR2: vr2 }
def setup_reflectors_blue(self, basebeam, theta1, clen, grating_spot_offset, pitch=1.5e6, lam0=1.053e-6, inside_retro_err=0, zeta=0): my=blue_compressor y_offset=my.y_offset grate=grating(my.GRATE, angle=theta1, center=(0,y_offset/2, 0), pitch=pitch, order=1, justify=-.8, height=0.05, width=0.1) littrow, beta=grate.degree_angles(theta1, lam0) vertex_dist=(clen-grating_spot_offset*sin(beta*deg))*0.5 retro_beam_offset=grating_spot_offset*math.cos(beta*deg)*0.5 beam=basebeam.clone().set_lambda(lam0) grate.transport_to_here(beam) grate.transform(beam) return_x=-grating_spot_offset*math.cos(theta1*deg) vretvertex=Numeric.array((return_x, y_offset/2, -0.22)) yvec=Numeric.array((0.,y_offset,0.)) ir1, ir2 = self.setup_retro_standard(beam, vertex_dist, retro_beam_offset, inside_retro_err, y_offset/2) vr1=reflector('vert retro 1', angle=0, center=vretvertex-yvec/2, width=0.025, height=0.05, thickness=0.01) vr2=reflector('vert retro 2', angle=0, center=vretvertex+yvec/2, width=0.025, height=0.05) vr1.set_direction((return_x,0,0), vr2) vr2.set_direction(vr1, (return_x, y_offset, 0)) return {my.GRATE:grate, my.IR1:ir1, my.IR2:ir2, my.VR1:vr1, my.VR2:vr2 }
def init(self, theta1, clen, lambda0, center, angle, extras): my = ir_compressor input_height = 18 * inch output_height = 12 * inch center_height = (input_height + output_height) / 2.0 basebeam = beam((0, input_height, -1.0), qtens(lambda0, w=0.005, r=Infinity)) optics = {} optics[my.INPUT] = m1 = reflector("input mirror", center=(0, input_height, 0), width=8 * inch, angle=-45) optics[my.G1] = g1 = grating("g1", angle=theta1 + 90, center=(52 * inch, center_height, 0), pitch=1740e3, order=1, width=16 * inch, thickness=2.0 * inch) mybeam = basebeam.clone() m1.transport_to_here(mybeam) m1.transform(mybeam) g1.transport_to_here(mybeam) g1.transform(mybeam) mybeam.free_drift(clen) # this is where grating 2 should be optics[my.G2] = g2 = grating("g2", angle=theta1 - 90, center=mybeam.x0 + (0, 0, 1e-8), pitch=1740e3, order=1, width=16 * inch, thickness=2.0 * inch) optics[my.VR1] = reflector("retro", center=(40 * inch, center_height, g2.center[2]), angle=90.0, width=8 * inch, thickness=1.0 * inch) out = optics[my.OUTPUT] = reflector("output mirror", center=(8 * inch, output_height, 0.0), width=8.0 * inch, thickness=1.0 * inch) focus = optics[my.FOCUS] = lens("output focus", center=out.center + (35 * inch, 0, 7 * inch), angle=90 - math.atan(0.2) / deg, f=2.0, width=8.0 * inch, height=8.0 * inch, thickness=1.0 * inch).tilt_off_axis(0) out.set_direction(g1.center - (0, center_height - output_height, 0), focus) comp_order = (my.INPUT, my.G1, my.G2, my.VR1, my.G2, my.G1, my.OUTPUT, my.FOCUS) composite_optic.init(self, "ir compressor", optics, comp_order, None, center=center, angle=0, extras=extras) # prepare to handle to downslope in the beam through the compressor while we are still # not rotated to the funny beam axis m1label = self.mark_label(my.INPUT) g1label = self.mark_label(my.G1) m2label = self.mark_label(my.OUTPUT) ir_trace = trace_path(self, basebeam.clone()) path_len = (ir_trace[(m2label, 0)].total_drift - ir_trace[(m1label, 0)].total_drift) slope = (output_height - input_height) / path_len # distance from entrance to first g1 hit g1_first_distance = (ir_trace[(g1label, 0)].total_drift - ir_trace[(m1label, 0)].total_drift) # distance from entrance to second g1 hit g1_second_distance = (ir_trace[(g1label, 1)].total_drift - ir_trace[(m1label, 0)].total_drift) # now, rotate us to the real beam direction self.update_coordinates(self.center, self.center, general_optics.eulermat(angle, 0, 0)) # and set up the aiming points self.g1target1 = g1.center + (0, (input_height - center_height) + g1_first_distance * slope, 0) self.g1target2 = g1.center + (0, (input_height - center_height) + g1_second_distance * slope, 0) out.set_direction(self.g1target2, focus)