This example shows how to use CodeV convetor to build a F/2 Petzval lens with CodeV seq file

The "petzval.seq" file is in the "CodeV_examples" folder

In [1]:
%matplotlib inline
from opticspy.ray_tracing import *
In [2]:
New_Lens = codev.readseq("petzval.seq",output=True)
Add wavelength 656.3nm done
Add wavelength 587.6nm done
Add wavelength 486.1nm done
Add field angle:0.0 degree done
Add field angle:5.0 degree done
Add field angle:7.0 degree done
-----------------------Add surface:-------------------------------
------------------------------------------------------------------
| Num   |  Radius     |  Thickness   |  Glass           |  STO   |
------------------------------------------------------------------
| 1     |  Infinity   |  Infinity    |  air             |  False |
------------------------------------------------------------------
-----------------------Add surface:-------------------------------
------------------------------------------------------------------
| Num   |  Radius     |  Thickness   |  Glass           |  STO   |
------------------------------------------------------------------
| 2     |  70.6677    |  21.676      |  N-BAK2_schott   |  False |
------------------------------------------------------------------
-----------------------Add surface:-------------------------------
------------------------------------------------------------------
| Num   |  Radius     |  Thickness   |  Glass           |  STO   |
------------------------------------------------------------------
| 3     |  -67.6027   |  3.484       |  F2_schott       |  False |
------------------------------------------------------------------
-----------------------Add surface:-------------------------------
------------------------------------------------------------------
| Num   |  Radius     |  Thickness   |  Glass           |  STO   |
------------------------------------------------------------------
| 4     |  926.7525   |  76.5094     |  air             |  True  |
------------------------------------------------------------------
-----------------------Add surface:-------------------------------
------------------------------------------------------------------
| Num   |  Radius     |  Thickness   |  Glass           |  STO   |
------------------------------------------------------------------
| 5     |  34.3945    |  17.3606     |  N-BK7_schott    |  False |
------------------------------------------------------------------
-----------------------Add surface:-------------------------------
------------------------------------------------------------------
| Num   |  Radius     |  Thickness   |  Glass           |  STO   |
------------------------------------------------------------------
| 6     |  -52.8527   |  3.484       |  N-F2_schott     |  False |
------------------------------------------------------------------
-----------------------Add surface:-------------------------------
------------------------------------------------------------------
| Num   |  Radius     |  Thickness   |  Glass           |  STO   |
------------------------------------------------------------------
| 7     |  233.1069   |  19.3995     |  air             |  False |
------------------------------------------------------------------
-----------------------Add surface:-------------------------------
------------------------------------------------------------------
| Num   |  Radius     |  Thickness   |  Glass           |  STO   |
------------------------------------------------------------------
| 8     |  -34.3945   |  1.9696      |  N-F2_schott     |  False |
------------------------------------------------------------------
-----------------------Add surface:-------------------------------
------------------------------------------------------------------
| Num   |  Radius     |  Thickness   |  Glass           |  STO   |
------------------------------------------------------------------
| 9     |  -244.2675  |  4.0         |  air             |  False |
------------------------------------------------------------------
-----------------------Add surface:-------------------------------
------------------------------------------------------------------
| Num   |  Radius     |  Thickness   |  Glass           |  STO   |
------------------------------------------------------------------
| 10    |  Infinity   |  0.0         |  air             |  False |
------------------------------------------------------------------
In [3]:
New_Lens.lens_info()
New_Lens.list_wavelengths()
New_Lens.list_fields()
New_Lens.FNO = 2
'PetzvallenswithfieldflattenerU.S.Patent2,076,190'
XF
List all wavelength information
Wavelength 486.1 nm
Wavelength 587.6 nm
Wavelength 656.3 nm
list all fields information
Field angle: 0.0
Field angle: 5.0
Field angle: 7.0
In [4]:
New_Lens.refresh_paraxial()
New_Lens.solve_imageposition()
------------Calculating EFL---------------
start surface: 2
end surface: 9
Rear Focal Length f': 95.6714855578
---------Calculating Entrance Pupil Position-----------
STOP Surface 4
STOP thickness 3.48399646385
start surface: 2
end surface: 3
entrance pupil position EP: 20.2616850912
------------Calculating OAL---------------
start surface: 2
end surface: 10
Overall length: 147.883115327
------------Calculating image position---------------
object distance -1000000
start surface: 2
end surface: 9
image position: 2.46732033093
In [5]:
trace.trace_draw_ray(New_Lens)
draw.draw_system(New_Lens)
------------------start drawing lens system-------------
In [6]:
analysis.spotdiagram(New_Lens,[1,2,3],[1,2,3],n=6,grid_type='circular')
RMS 1.08836200975
RMS 0.78825280101
RMS 0.895457823874
Out[6]:
0
In [7]:
analysis.Ray_fan(New_Lens,[1,2,3],[1,2,3])
Out[7]:
0