In [1]:
%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 4"
columns = "type distance roc diameter material"
# number of surfaces = 20
lensdata = """
O 0.0 0.0 208.91 AIR
S 20 443.373 160.7 1.49782/82.3
S 14.5 -745.663 160.7 AIR
S 0.5 235.41 154.86 1.49782/82.3
S 21 -599.816 154.86 AIR
S 6.85 -527.848 151.54 1.7495/35.2
S 6 473.787 151.54 AIR
S 1.7 176.9 143.2 1.49782/82.3
S 15 558.189 143.2 AIR
S 102.701 749.672 77.78 1.79504/28.6
S 8 -189.496 76.12 1.51454/54.6
S 3.65 125.271 67.78 AIR
S 12 -148.765 66.12 1.4645/65.8
S 4.8 97.985 66.12 AIR
A 27.388 0 60.292 AIR
S 1 -1754.216 65.7 1.68893/31.1
S 1.5 110 65.7 1.6935/53.8
S 7.75 -317.94 65.7 AIR
S 2 169.454 64.44 1.69895/30.1
S 2.4 113.525 62.78 1.6968/55.6
S 8 -254.06 62.78 AIR
I 112.223 0 43.2 AIR
"""
s = ro.system_from_text(lensdata, columns.split(),
    description=description)
s.fields = 0, .7, 1.
s.object.angle = np.deg2rad(4.085000)
s.update()
print(s)
ro.Analysis(s)
Populating the interactive namespace from numpy and matplotlib
System: US 4
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 4.08 deg
 Pupil:
   Pupil Distance: 643.087
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 77.3832
Image:
 Radius: 21.6
 Update Radius: True
 Pupil:
   Pupil Distance: -127.864
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 33.037
Stop: 14
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf     208.91         basic/air   1.000   1.000   89.30
 1 S         20      443.4      160.7                 -   1.498   1.498   82.30
 2 S       14.5     -745.7      160.7         basic/air   1.000   1.000   89.30
 3 S        0.5      235.4     154.86                 -   1.498   1.498   82.30
 4 S         21     -599.8     154.86         basic/air   1.000   1.000   89.30
 5 S       6.85     -527.8     151.54                 -   1.750   1.750   35.20
 6 S          6      473.8     151.54         basic/air   1.000   1.000   89.30
 7 S        1.7      176.9      143.2                 -   1.498   1.498   82.30
 8 S         15      558.2      143.2         basic/air   1.000   1.000   89.30
 9 S      102.7      749.7      77.78                 -   1.795   1.795   28.60
10 S          8     -189.5      76.12                 -   1.515   1.515   54.60
11 S       3.65      125.3      67.78         basic/air   1.000   1.000   89.30
12 S         12     -148.8      66.12                 -   1.464   1.464   65.80
13 S        4.8      97.98      66.12         basic/air   1.000   1.000   89.30
14 S     27.388        inf     60.292         basic/air   1.000   1.000   89.30
15 S          1      -1754       65.7                 -   1.689   1.689   31.10
16 S        1.5        110       65.7                 -   1.694   1.694   53.80
17 S       7.75     -317.9       65.7         basic/air   1.000   1.000   89.30
18 S          2      169.5      64.44                 -   1.699   1.699   30.10
19 S        2.4      113.5      62.78                 -   1.697   1.697   55.60
20 S          8     -254.1      62.78         basic/air   1.000   1.000   89.30
21 S     112.22        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 4
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 4.08 deg
 Pupil:
   Pupil Distance: 643.087
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 77.3832
Image:
 Radius: 21.6
 Update Radius: True
 Pupil:
   Pupil Distance: -127.864
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 33.037
Stop: 14
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf     208.91         basic/air   1.000   1.000   89.30
 1 S         20      443.4      160.7                 -   1.498   1.498   82.30
 2 S       14.5     -745.7      160.7         basic/air   1.000   1.000   89.30
 3 S        0.5      235.4     154.86                 -   1.498   1.498   82.30
 4 S         21     -599.8     154.86         basic/air   1.000   1.000   89.30
 5 S       6.85     -527.8     151.54                 -   1.750   1.750   35.20
 6 S          6      473.8     151.54         basic/air   1.000   1.000   89.30
 7 S        1.7      176.9      143.2                 -   1.498   1.498   82.30
 8 S         15      558.2      143.2         basic/air   1.000   1.000   89.30
 9 S      102.7      749.7      77.78                 -   1.795   1.795   28.60
10 S          8     -189.5      76.12                 -   1.515   1.515   54.60
11 S       3.65      125.3      67.78         basic/air   1.000   1.000   89.30
12 S         12     -148.8      66.12                 -   1.464   1.464   65.80
13 S        4.8      97.98      66.12         basic/air   1.000   1.000   89.30
14 S     27.388        inf     60.292         basic/air   1.000   1.000   89.30
15 S          1      -1754       65.7                 -   1.689   1.689   31.10
16 S        1.5        110       65.7                 -   1.694   1.694   53.80
17 S       7.75     -317.9       65.7         basic/air   1.000   1.000   89.30
18 S          2      169.5      64.44                 -   1.699   1.699   30.10
19 S        2.4      113.5      62.78                 -   1.697   1.697   55.60
20 S          8     -254.1      62.78         basic/air   1.000   1.000   89.30
21 S     112.38        inf       43.2         basic/air   1.000   1.000   89.30

lagrange: -5.5328
track length: 246.74
object, image height: [45.967  21.4078]
front, back focal length (from PP): [-300.0873  300.0873]
entry, exit pupil height: [77.3832 33.037 ]
entry, exit pupil distance: [623.0869 -15.6411]
front, back focal distance: [-79.7924 112.4429]
front, back principal distance: [ 220.2949 -187.6444]
front, back nodal distance: [ 220.2949 -187.6444]
front, back numerical aperture: [0.     0.2498]
front, back f number: [1.939  4.5417]
front, back working f number: [   inf 2.0024]
front, back airy radius: [   inf 0.0014]
transverse, angular magnification: [-0.      2.3423]

 # T      path         n   axial y  axial nu   chief y  chief nu
 0 S         0         1     77.38         0    -45.97    0.0715
 1 S        20     1.498     77.38  -0.08684    -44.54    0.1215
 2 S      34.5         1     76.54   -0.1379    -43.36    0.1504
 3 S        35     1.498     76.47   -0.2995    -43.29    0.2419
 4 S        56         1     72.27   -0.3595    -39.89     0.275
 5 S     62.85      1.75     69.81   -0.2604    -38.01     0.221
 6 S     68.85         1     68.92   -0.1514    -37.25    0.1621
 7 S     70.55     1.498     68.66   -0.3445    -36.98    0.2661
 8 S     85.55         1     65.21   -0.2864    -34.31    0.2355
 9 S     188.3     1.795     35.81   -0.3244    -10.13    0.2463
10 S     196.3     1.515     34.36   -0.3752    -9.031    0.2596
11 S     199.9         1     33.46   -0.2379    -8.406    0.2251
12 S     211.9     1.464      30.6   -0.1424    -5.705    0.2073
13 S     216.7         1     30.14  0.000386    -5.025    0.1835
14 S     244.1         1     30.15  0.000386-1.324e-14    0.1835
15 S     245.1     1.689     30.15   0.01222    0.1835    0.1836
16 S     246.6     1.694     30.16   0.01097    0.3465    0.1836
17 S     254.3         1     30.21   -0.0549     1.187     0.181
18 S     256.3     1.699      30.1    -0.179     1.549    0.1746
19 S     258.7     1.697     29.84   -0.1784     1.795    0.1747
20 S     266.7         1        29   -0.2579     2.619    0.1675
21 S       379         1   0.06475   -0.2579     21.41    0.1675

 # T       SA3      CMA3      AST3      PTZ3      DIS3     TACHC      TCHC
 0 S         0         0         0         0         0         0         0
 1 S   -0.1766   0.02932 -0.004867  -0.04436  0.008171   -0.2111   0.03504
 2 S   -0.8497    0.7366   -0.6386  -0.02638    0.5765   -0.2875    0.2493
 3 S   0.02235 -0.004005 0.0007177  -0.08354   0.01484   -0.2233   0.04002
 4 S    -7.274     5.175    -3.682  -0.03279     2.643   -0.5417    0.3854
 5 S     8.957     -6.32      4.46   0.04803    -3.181     1.616    -1.141
 6 S-0.0003084  0.004357  -0.06155   0.05352    0.1135  -0.01917    0.2708
 7 S  -0.01669  0.003311-0.0006565   -0.1112   0.02218   -0.2539   0.05035
 8 S   -0.4811    0.4939   -0.5071   0.03523    0.4844   -0.1726    0.1772
 9 S     0.732   -0.6811    0.6337  -0.03497   -0.5571    0.5119   -0.4763
10 S    -1.766    0.9018   -0.4605  -0.03225    0.2516   -0.8004    0.4087
11 S  -0.00411   -0.0222   -0.1199    0.1605    0.2193   0.02356    0.1272
12 S     1.997    -1.186    0.7044    0.1262   -0.4933    0.2531   -0.1503
13 S    0.3694    0.1586   0.06807    0.1915    0.1114     0.173   0.07427
14 S        -0         0        -0         0         0         0         0
15 S  6.42e-05-0.0007008   0.00765   0.01376   -0.2337    0.0257   -0.2806
16 S -0.006061 -0.002409-0.0009578-0.0008602-0.0007227    0.3052    0.1213
17 S   -0.0771   0.09116   -0.1078  -0.07623    0.2176   -0.1333    0.1576
18 S -0.006272 -0.009714  -0.01504   -0.1437   -0.2458   -0.1954   -0.3026
19 S 0.0001616 0.0001216 9.158e-05 0.0003891 0.0003618    0.1942    0.1462
20 S    -1.522    0.6426   -0.2714  -0.09566     0.155   -0.3083    0.1302
21 S         0        -0         0         0         0        -0         0
       -0.1018   0.01047  0.004273  -0.05278    0.1062  -0.04378   0.02343

Out[1]:
<rayopt.analysis.Analysis at 0x164d1467b70>
In [ ]: