Prism #123
Replies: 1 comment 4 replies
-
Hello @ahochwal, I apologize for the delay in responding, I was on the road. Here's an example with a right angle prism. The prism rendering in the lens picture is wrong, but the ray paths are (and should be) correct. Sequential models of many prisms may be built using decenter data on the prism surfaces. Since the lens picture will be wrong, there are some list_* options in the seq_model such as list_sg() and list_gbl_tfrms() that list the decenter data with the system interfaces and gaps, and a listing of the global surface coords of the interface vertices. The notebook is in my ray-optics-notebooks repo. Feel free to ask questions. Thanks Investigate issue #123How do you construct a prism in ray-optics?Example 1: a right angle prism with a reflecting hypotenuse surface%matplotlib inline
# use widget to enable interactive figures.
#%matplotlib widget isdark = False from rayoptics.environment import * Create model from scratchopm = OpticalModel()
opm.radius_mode = True
sm = opm['seq_model']
osp = opm['optical_spec']
pm = opm['parax_model']
em = opm['ele_model']
pt = opm['part_tree']
ar = opm['analysis_results'] Optical Specs: f/5, 500mm efl, 1 deg fov, visual, monochromaticpupil_diameter = 100.
pupil_radius = pupil_diameter/2
osp.pupil = PupilSpec(osp, key=['object', 'pupil'], value=pupil_diameter)
osp.field_of_view = FieldSpec(osp, key=['object', 'angle'], value=1,
is_relative=True, flds=[0.0, 1.0])
# wavelength for analysis: green, e-line
osp.spectral_region = WvlSpec([('e', 1.0)], ref_wl=0)
listobj(osp)
Set up initial system - a singletsm.do_apertures = False
sm.gaps[0].thi = 1e+11
efl = 500.
opm.add_lens(lbl='L1', power=1/efl, bending=.75, th=12.5, sd=105./2, med='N-BK7,Schott', t=500.)
sm.stop_surface = 1
opm.update_model() sm.list_model()
sm.ifcs[-2].optical_power = pm.pwr_slope_solve(pm.ax, -2, -pupil_radius/efl)
opm.update_model(src_model=sm)
sm.gaps[-1].thi += pm.thi_ht_solve(pm.ax, -1, 0.)
opm.update_model(src_model=sm) sm.list_model()
pm.first_order_data()
pm.list_model()
layout_plt = plt.figure(FigureClass=InteractiveLayout, opt_model=opm, is_dark=isdark).plot() ta_plt = plt.figure(FigureClass=RayFanFigure, opt_model=opm, data_type='Ray',
scale_type=Fit.User_Scale, user_scale_value=1., dpi=130, is_dark=isdark).plot() add plane-parallel platesm.gaps[-1].thi = 300.
opm.add_lens(lbl='L1', power=0.0, th=75, sd=75./2, med='N-BK7,Schott', t=125.)
opm.update_model()
sm.gaps[-1].thi += pm.thi_ht_solve(pm.ax, -1, 0.)
opm.update_model(src_model=sm) sm.list_model()
layout_plt = plt.figure(FigureClass=InteractiveLayout, opt_model=opm, is_dark=isdark).plot() ta_plt = plt.figure(FigureClass=RayFanFigure, opt_model=opm, data_type='Ray',
scale_type=Fit.User_Scale, user_scale_value=1., dpi=130, is_dark=isdark).plot() insert a reflecting surface as the prism hypotenusesm.set_cur_surface(3)
sm.gaps[3].thi = 37.5
sm.add_surface([0, -37.5, 'refl'])
sm.ifcs[sm.cur_surface].decenter = srf.DecenterData('bend', alpha=45.)
opm.update_model()
sm.gaps[-1].thi += pm.thi_ht_solve(pm.ax, -1, 0.)
opm.update_model(src_model=sm) sm.list_sg()
sm.list_gbl_tfrms()
layout_plt = plt.figure(FigureClass=InteractiveLayout, opt_model=opm, is_dark=isdark).plot() ta_plt = plt.figure(FigureClass=RayFanFigure, opt_model=opm, data_type='Ray',
scale_type=Fit.User_Scale, user_scale_value=1., dpi=130, is_dark=isdark).plot() |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for the package.
I failed to create a prism inside an optical model. Could you briefly outline how to do that.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions