In [2]:
%pylab inline
import warnings
import numpy as np
import matplotlib.pyplot as plt
import rayopt as ro
warnings.simplefilter("ignore", FutureWarning)
np.seterr(divide="ignore", invalid="ignore")
np.set_printoptions(precision=4)
description = "US 3,536,379 Example 1 (Leica Telyt-S 800mm f/6.3) - without aperture stop"
columns = "type distance roc diameter material"
# number of surfaces = 5
lensdata = """
O 0.0 0.0 181.168 AIR
S 20 411.328 139.36 1.67245/45.8
S 9.6 256.033 139.36 1.54408/73
S 20 -256.033 139.36 1.57125/55.8
S 9.6 -2699.02 139.36 AIR
I 0 0 43.2 AIR
"""
s = ro.system_from_text(lensdata, columns.split(),
    description=description)
s.fields = 0, .7, 1.
s.object.angle = np.deg2rad(1.535000)
s.update()
print(s)
ro.Analysis(s)
Populating the interactive namespace from numpy and matplotlib
System: US 3
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 1.53 deg
 Pupil:
   Pupil Distance: 20
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 69.68
Image:
 Radius: 21.6
 Update Radius: True
 Pupil:
   Pupil Distance: -24.8863
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 69.7076
Stop: 1
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf     181.17         basic/air   1.000   1.000   89.30
 1 S         20      411.3     139.36                 -   1.672   1.672   45.80
 2 S        9.6        256     139.36                 -   1.544   1.544   73.00
 3 S         20       -256     139.36                 -   1.571   1.571   55.80
 4 S        9.6      -2699     139.36         basic/air   1.000   1.000   89.30
 5 S          0        inf       43.2         basic/air   1.000   1.000   89.30

c:\software\python37\lib\site-packages\rayopt\analysis.py:316: UserWarning: No contour levels were found within the data range.
  axo.contour(x, y, o, v, cmap=plt.cm.RdBu_r)
System: US 3
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 1.53 deg
 Pupil:
   Pupil Distance: 20
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 69.68
Image:
 Radius: 21.6
 Update Radius: True
 Pupil:
   Pupil Distance: -24.8863
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 69.7076
Stop: 1
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf     181.17         basic/air   1.000   1.000   89.30
 1 S         20      411.3     139.36                 -   1.672   1.672   45.80
 2 S        9.6        256     139.36                 -   1.544   1.544   73.00
 3 S         20       -256     139.36                 -   1.571   1.571   55.80
 4 S        9.6      -2699     139.36         basic/air   1.000   1.000   89.30
 5 S     782.76        inf       43.2         basic/air   1.000   1.000   89.30

lagrange: -1.868
track length: 39.2
object, image height: [0.536  0.6667]
front, back focal length (from PP): [-807.3095  807.3095]
entry, exit pupil height: [69.68   69.7076]
entry, exit pupil distance: [-6.8482e-16 -2.4886e+01]
front, back focal distance: [-806.7666  782.5257]
front, back principal distance: [  0.5429 -24.7838]
front, back nodal distance: [  0.5429 -24.7838]
front, back numerical aperture: [0.    0.086]
front, back f number: [5.793  5.7907]
front, back working f number: [   inf 5.8145]
front, back airy radius: [   inf 0.0042]
transverse, angular magnification: [-0.      0.9996]

 # T      path         n   axial y  axial nu   chief y  chief nu
 0 S         0         1     69.68         0    -0.536   0.02681
 1 S        20     1.672     69.68   -0.1139 1.835e-17   0.02681
 2 S      29.6     1.544     69.03  -0.07926    0.1539   0.02689
 3 S      49.6     1.571        68  -0.07204    0.5021   0.02694
 4 S      59.2         1     67.56  -0.08634    0.6667    0.0268
 5 S      59.2         1     67.56  -0.08634    0.6667    0.0268

 # T       SA3      CMA3      AST3      PTZ3      DIS3     TACHC      TCHC
 0 S         0         0         0         0         0         0         0
 1 S  -0.01453   -0.0023-0.0003638-0.0006083-0.0001538    -0.037 -0.005853
 2 S   0.01045  0.000862 7.114e-05 0.0001209 1.585e-05   0.03281  0.002708
 3 S   0.01181-0.0005755 2.806e-05 2.724e-05-2.696e-06   0.02005-0.0009777
 4 S  -0.00854  0.002036-0.0004853-8.381e-05 0.0001357  -0.01749  0.004169
 5 S         0        -0         0         0         0        -0         0
    -0.0008239 2.284e-05-0.0007499-0.0005439-4.956e-06 -0.001617 4.657e-05

Out[2]:
<rayopt.analysis.Analysis at 0x22cf9f18978>
In [4]:
description = "US 3,536,379 Example 1 (Leica Telyt-S 800mm f/6.3) - with aperture stop"
columns = "type distance roc diameter material"
# number of surfaces = 5
lensdata = """
O 0.0 0.0 181.168 AIR
S 20 411.328 139.36 1.67245/45.8
S 9.6 256.033 139.36 1.54408/73
S 20 -256.033 139.36 1.57125/55.8
S 9.6 -2699.02 139.36 AIR
A 516.8 0 44.755 AIR
I 261.22 0 43.2 AIR
"""
s = ro.system_from_text(lensdata, columns.split(),
    description=description)
s.fields = 0, .7, 1.
s.object.angle = np.deg2rad(1.530000)
s.update()
print(s)
ro.Analysis(s)
System: US 3
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 1.53 deg
 Pupil:
   Pupil Distance: 1663.72
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 67.9303
Image:
 Radius: 21.6
 Update Radius: True
 Pupil:
   Pupil Distance: -261.22
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 22.3775
Stop: 5
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf     181.17         basic/air   1.000   1.000   89.30
 1 S         20      411.3     139.36                 -   1.672   1.672   45.80
 2 S        9.6        256     139.36                 -   1.544   1.544   73.00
 3 S         20       -256     139.36                 -   1.571   1.571   55.80
 4 S        9.6      -2699     139.36         basic/air   1.000   1.000   89.30
 5 S      516.8        inf     44.755         basic/air   1.000   1.000   89.30
 6 S     261.22        inf       43.2         basic/air   1.000   1.000   89.30

System: US 3
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 1.53 deg
 Pupil:
   Pupil Distance: 1663.72
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 67.9303
Image:
 Radius: 21.6
 Update Radius: True
 Pupil:
   Pupil Distance: -261.22
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 22.3775
Stop: 5
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf     181.17         basic/air   1.000   1.000   89.30
 1 S         20      411.3     139.36                 -   1.672   1.672   45.80
 2 S        9.6        256     139.36                 -   1.544   1.544   73.00
 3 S         20       -256     139.36                 -   1.571   1.571   55.80
 4 S        9.6      -2699     139.36         basic/air   1.000   1.000   89.30
 5 S      516.8        inf     44.755         basic/air   1.000   1.000   89.30
 6 S     265.95        inf       43.2         basic/air   1.000   1.000   89.30

lagrange: -1.8151
track length: 556
object, image height: [44.4431 21.1827]
front, back focal length (from PP): [-807.3095  807.3095]
entry, exit pupil height: [67.9303 22.3775]
entry, exit pupil distance: [ 1.6437e+03 -4.7089e-14]
front, back focal distance: [-806.7666  265.8689]
front, back principal distance: [   0.5429 -541.4406]
front, back nodal distance: [   0.5429 -541.4406]
front, back numerical aperture: [0.     0.0839]
front, back f number: [ 5.9422 18.0384]
front, back working f number: [   inf 5.9632]
front, back airy radius: [   inf 0.0043]
transverse, angular magnification: [-0.      3.0357]

 # T      path         n   axial y  axial nu   chief y  chief nu
 0 S         0         1     67.93         0    -44.44   0.02672
 1 S        20     1.672     67.93    -0.111    -43.91   0.09847
 2 S      29.6     1.544     67.29  -0.07727    -43.34   0.07674
 3 S      49.6     1.571     66.29  -0.07023    -42.35   0.07225
 4 S      59.2         1     65.86  -0.08417    -41.91   0.08111
 5 S       576         1     22.38  -0.08417 3.819e-15   0.08111
 6 S     837.2         1    0.3974  -0.08417     21.18   0.08111

 # T       SA3      CMA3      AST3      PTZ3      DIS3     TACHC      TCHC
 0 S         0         0         0         0         0         0         0
 1 S   -0.4293     0.208   -0.1008  -0.01878   0.05796     -1.15    0.5572
 2 S    0.3085   -0.1734   0.09744  0.003733  -0.05686      1.02   -0.5731
 3 S    0.3487   -0.2428     0.169 0.0008409   -0.1183    0.6232   -0.4339
 4 S   -0.2522    0.2245   -0.1998 -0.002588    0.1802   -0.5435    0.4838
 5 S         0        -0         0         0         0        -0         0
 6 S         0        -0         0         0         0        -0         0
      -0.02433   0.01642  -0.03421  -0.01679   0.06303  -0.05025   0.03396

Out[4]:
<rayopt.analysis.Analysis at 0x22c91e53d30>
In [ ]: