Mirror and lens in an imperfect system #165
-
I'm attempting to build a complex system to include some Monte Carlo tolerancing analysis. The bits that are getting me stuck are mostly the effect of a mirror and what happens to the elements after the mirror. I've simplified my optical chain to those parts. I would very much like to solve this issue. I also need to put in my own array of starting rays so I've included some of the code for that as well. `opm = OpticalModel() osp['pupil'] = PupilSpec(osp, key=['object', 'pupil'], value=40) BFL = 10 opm.system_spec.dimensions = 'mm' sm.gaps[0].thi=1e-3 sm.add_surface([1e6, BFL, 'air']) opm.add_dummy_plane(idx=1) sm.add_surface([1e6, BFL/2, 'air']) sm.add_surface([1e4, 10, 'N-BK7','Schott', 10]) opm.update_model() fig = plt.figure(FigureClass=InteractiveLayout, opt_model=opm, is_dark=False, do_draw_rays=False, do_draw_beams=False, do_draw_edge_rays=False) def plot_ray(ray): for m, pos in enumerate([-1, 0, 1]): This is the result. Clearly reflection off the mirror is not correct and the lens just disappears. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 31 replies
-
Beta Was this translation helpful? Give feedback.
-
Thank you. I will include your suggestions in my code now. I have another question too. I would like the 45 degree fold mirror to be able to adjust over a small range so that I can assess some tolerancing issues. However, it moves the optic axis when I change it's angle. How do I change the mirror angle but not change the position and orientation of the lenses above it? |
Beta Was this translation helpful? Give feedback.
-
I've been charging ahead with some other issues and decided to get back to your previous comments and suggestions to be on the same page. However, I'm executing this code coped from above from 4 days ago:
And am getting this error: UnboundLocalError: local variable 'slp0' referenced before assignment |
Beta Was this translation helpful? Give feedback.
-
Is there a way to restart the model without restarting my python kernel? |
Beta Was this translation helpful? Give feedback.
-
Most of my issues have been resolved by moving to python 3.12 and getting the most recent version of rayoptics 0.95. For compatibility with some other packages, I was trying to stick with python 3.8. |
Beta Was this translation helpful? Give feedback.
-
How can I access the ray data for the rays that are traced automatically in the plots? |
Beta Was this translation helpful? Give feedback.
assume you have the following:
The boundary defining rays for each field point are saved in a list of RayBundles called
ray_shapes
.Each RayBundle has a dict called
rayset
. It contains 5 rays, labeled '00', '+Y', '-Y', '+X', '-X'.If you use ray fans, they're saved for each field in a list of RayFanBundles called
rayfan_shapes
.Each RayFanBundle has a fan of rays in the fan called
ray_fan
. This is a RayFan and the list of rays is the fi…