Real Ray Tracing Example: Microscope. This example is immature. Because an microscope system is a finite conjugate system and it should be defined by NA, etc. But opticspy shows some ability to trace it.

In [1]:
%matplotlib inline
from opticspy.ray_tracing import *
In [2]:
New_Lens = codev.readseq("microscope.seq")
New_Lens.lens_info()
Add wavelength 656.3nm done
Add wavelength 546.1nm done
Add wavelength 486.1nm done
Add field angle:0.0 degree done
Add field angle:2.0 degree done
Add field angle:3.8 degree done
Add surface:  1
Add surface:  2
Add surface:  3
Add surface:  4
Add surface:  5
Add surface:  6
Add surface:  7
Add surface:  8
Add surface:  9
Add surface:  10
Add surface:  11
Add surface:  12
Add surface:  13
Add surface:  14
Add surface:  15
Add surface:  16
Add surface:  17
Add surface:  18
Add surface:  19
'40XPOWER,0.70NAPLAN-ACHROMAT'
XF
In [3]:
New_Lens.FNO = 0.7
New_Lens.refresh_paraxial()
trace.trace_draw_ray(New_Lens)
draw.draw_system(New_Lens)
------------Calculating EFL---------------
start surface: 2
end surface: 18
Rear Focal Length f': 4.27844093988
---------Calculating Entrance Pupil Position-----------
STOP Surface 6
STOP thickness 12.1150406847
start surface: 2
end surface: 5
entrance pupil position EP: 15.2000485292
------------Calculating OAL---------------
start surface: 2
end surface: 19
Overall length: 45.1671135398
------------------start drawing lens system-------------
In [4]:
analysis.spotdiagram(New_Lens,[1,2,3],[1,2,3],n=12,grid_type='grid')
RMS 0.569417542786
RMS 0.564127682197
RMS 0.54977199717
Out[4]:
0
In [5]:
analysis.Ray_fan(New_Lens,[1,2,3],[1,2,3])
Out[5]:
0