In [3]:
%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 = "US5402268-EX1"
columns = "type distance roc diameter material"
# number of surfaces = 22
lensdata = """
O 0.0 0.0 66.898 AIR
S 20 197.971 51.46 1.80384/33.89
S 2.5 85.604 51.15 1.49782/82.52
S 7 -206.085 51.15 AIR
S 0.3 71.626 52.3 1.49782/82.52
S 6 432.817 52.3 AIR
S 6.6432 79.137 49.26 1.79631/40.9
S 2.5 39.959 45.69 1.60311/60.64
S 8.8 484.258 45.69 AIR
S 5.1405 196.475 39.05 1.6228/57.03
S 2 31.414 36.3 1.80384/33.89
S 5 62.33 33.81 AIR
S 3.7 -105.523 33.81 1.80518/25.41
S 4 -59.02 32.89 1.62041/60.14
S 2 49.151 32.89 AIR
A 42.5742 0 30.387 AIR
S 2.55 1213.45 31.93 1.68893/31.08
S 2 69.615 31.93 1.62041/60.14
S 6 -59.143 31.93 AIR
S 46.5 -72.715 29.05 1.77279/49.45
S 2.5 -436.246 29.05 AIR
S 0.4 86.92 32.81 1.54814/45.87
S 6 815.561 32.81 AIR
I 58.9638 0 43.2 AIR
"""
s = ro.system_from_text(lensdata, columns.split(),
    description=description)
s.fields = 0, .7, 1.
s.object.angle = np.deg2rad(6.165000)
s.update()
print(s)
ro.Analysis(s)
Populating the interactive namespace from numpy and matplotlib
System: US5402268-EX1
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 6.17 deg
 Pupil:
   Pupil Distance: 201.477
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 25.2786
Image:
 Radius: 21.6
 Update Radius: True
 Pupil:
   Pupil Distance: -112.214
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 14.1869
Stop: 15
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf     66.898         basic/air   1.000   1.000   89.30
 1 S         20        198      51.46                 -   1.804   1.804   33.89
 2 S        2.5       85.6      51.15                 -   1.498   1.498   82.52
 3 S          7     -206.1      51.15         basic/air   1.000   1.000   89.30
 4 S        0.3      71.63       52.3                 -   1.498   1.498   82.52
 5 S          6      432.8       52.3         basic/air   1.000   1.000   89.30
 6 S     6.6432      79.14      49.26                 -   1.796   1.796   40.90
 7 S        2.5      39.96      45.69                 -   1.603   1.603   60.64
 8 S        8.8      484.3      45.69         basic/air   1.000   1.000   89.30
 9 S     5.1405      196.5      39.05                 -   1.623   1.623   57.03
10 S          2      31.41       36.3                 -   1.804   1.804   33.89
11 S          5      62.33      33.81         basic/air   1.000   1.000   89.30
12 S        3.7     -105.5      33.81                 -   1.805   1.805   25.41
13 S          4     -59.02      32.89                 -   1.620   1.620   60.14
14 S          2      49.15      32.89         basic/air   1.000   1.000   89.30
15 S     42.574        inf     30.387         basic/air   1.000   1.000   89.30
16 S       2.55       1213      31.93                 -   1.689   1.689   31.08
17 S          2      69.61      31.93                 -   1.620   1.620   60.14
18 S          6     -59.14      31.93         basic/air   1.000   1.000   89.30
19 S       46.5     -72.72      29.05                 -   1.773   1.773   49.45
20 S        2.5     -436.2      29.05         basic/air   1.000   1.000   89.30
21 S        0.4      86.92      32.81                 -   1.548   1.548   45.87
22 S          6      815.6      32.81         basic/air   1.000   1.000   89.30
23 S     58.964        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: US5402268-EX1
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 6.17 deg
 Pupil:
   Pupil Distance: 201.477
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 25.2786
Image:
 Radius: 21.6
 Update Radius: True
 Pupil:
   Pupil Distance: -112.214
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 14.1869
Stop: 15
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf     66.898         basic/air   1.000   1.000   89.30
 1 S         20        198      51.46                 -   1.804   1.804   33.89
 2 S        2.5       85.6      51.15                 -   1.498   1.498   82.52
 3 S          7     -206.1      51.15         basic/air   1.000   1.000   89.30
 4 S        0.3      71.63       52.3                 -   1.498   1.498   82.52
 5 S          6      432.8       52.3         basic/air   1.000   1.000   89.30
 6 S     6.6432      79.14      49.26                 -   1.796   1.796   40.90
 7 S        2.5      39.96      45.69                 -   1.603   1.603   60.64
 8 S        8.8      484.3      45.69         basic/air   1.000   1.000   89.30
 9 S     5.1405      196.5      39.05                 -   1.623   1.623   57.03
10 S          2      31.41       36.3                 -   1.804   1.804   33.89
11 S          5      62.33      33.81         basic/air   1.000   1.000   89.30
12 S        3.7     -105.5      33.81                 -   1.805   1.805   25.41
13 S          4     -59.02      32.89                 -   1.620   1.620   60.14
14 S          2      49.15      32.89         basic/air   1.000   1.000   89.30
15 S     42.574        inf     30.387         basic/air   1.000   1.000   89.30
16 S       2.55       1213      31.93                 -   1.689   1.689   31.08
17 S          2      69.61      31.93                 -   1.620   1.620   60.14
18 S          6     -59.14      31.93         basic/air   1.000   1.000   89.30
19 S       46.5     -72.72      29.05                 -   1.773   1.773   49.45
20 S        2.5     -436.2      29.05         basic/air   1.000   1.000   89.30
21 S        0.4      86.92      32.81                 -   1.548   1.548   45.87
22 S          6      815.6      32.81         basic/air   1.000   1.000   89.30
23 S     59.229        inf       43.2         basic/air   1.000   1.000   89.30

lagrange: -2.7366
track length: 164.11
object, image height: [21.8055 21.6397]
front, back focal length (from PP): [-200.4596  200.4596]
entry, exit pupil height: [25.2786 14.1869]
entry, exit pupil distance: [181.4774 -53.2503]
front, back focal distance: [-175.6579   59.2357]
front, back principal distance: [  24.8017 -141.2239]
front, back nodal distance: [  24.8017 -141.2239]
front, back numerical aperture: [0.     0.1251]
front, back f number: [3.965 7.065]
front, back working f number: [   inf 3.9964]
front, back airy radius: [   inf 0.0029]
transverse, angular magnification: [-0.      1.7818]

 # T      path         n   axial y  axial nu   chief y  chief nu
 0 S         0         1     25.28         0    -21.81    0.1083
 1 S        20     1.804     25.28   -0.1026    -19.64     0.188
 2 S      22.5     1.498     25.14  -0.01275    -19.38    0.1187
 3 S      29.5         1     25.08  -0.07329    -18.83    0.1641
 4 S      29.8     1.498     25.05   -0.2473    -18.78    0.2946
 5 S      35.8         1     24.06   -0.2197     -17.6    0.2743
 6 S     42.44     1.796     22.61   -0.4471    -15.77     0.433
 7 S     44.94     1.603     21.98   -0.3408    -15.17    0.3597
 8 S     53.74         1     20.11   -0.3157     -13.2    0.3432
 9 S     58.88     1.623     18.49   -0.3743    -11.43    0.3795
10 S     60.88     1.804     18.03   -0.4782    -10.97    0.4427
11 S     65.88         1      16.7   -0.2629    -9.739    0.3171
12 S     69.58     1.805     15.73   -0.1429    -8.566    0.2518
13 S     73.58      1.62     15.41   -0.1911    -8.008    0.2768
14 S     75.58         1     15.18 0.0003608    -7.666    0.1801
15 S     118.2         1     15.19 0.0003608 1.099e-14    0.1801
16 S     120.7     1.689     15.19 -0.008262    0.4592    0.1799
17 S     122.7      1.62     15.18  0.006684    0.6722    0.1805
18 S     128.7         1     15.21   -0.1528     1.341    0.1665
19 S     175.2     1.773     8.107  -0.06667     9.079    0.2629
20 S     177.7         1     8.013  -0.08086      9.45    0.2462
21 S     178.1     1.548      7.98   -0.1312     9.548     0.186
22 S     184.1         1     7.472   -0.1261     10.27    0.1929
23 S     243.1         1   0.03636   -0.1261     21.64    0.1929

 # T       SA3      CMA3      AST3      PTZ3      DIS3     TACHC      TCHC
 0 S         0         0         0         0         0         0         0
 1 S  -0.05141 -0.003631-0.0002564  -0.06661 -0.004722   -0.3357  -0.02371
 2 S    0.4686   -0.2418    0.1248   0.03918  -0.08463    0.7743   -0.3996
 3 S   -0.2547    0.3338   -0.4374  -0.04771    0.6357   -0.1556    0.2039
 4 S   -0.2804   0.09942  -0.03525   -0.1373   0.06117   -0.2206    0.0782
 5 S   -0.2799    0.3987   -0.5679   0.02272    0.7765   -0.1256     0.179
 6 S   0.03159   0.03585   0.04068   -0.1658   -0.1419   -0.1279   -0.1452
 7 S    0.1515   -0.0697   0.03207   0.04971  -0.03763     0.436   -0.2006
 8 S    -1.094      1.26    -1.453   0.02299     1.648   -0.2704    0.3116
 9 S    0.6225   -0.8007      1.03   -0.0578     -1.25    0.2179   -0.2803
10 S   -0.1069   0.03588  -0.01205  -0.05829   0.02362   -0.5098    0.1712
11 S-0.0002049 -0.006366   -0.1977    0.2116      0.43   0.00899    0.2792
12 S     2.311    -2.234      2.16    0.1251    -2.209    0.8994   -0.8695
13 S   -0.6658    0.5383   -0.4352  -0.03169    0.3775   -0.8377    0.6773
14 S    0.4199   0.03272   0.00255    0.2305   0.01816    0.2362   0.01841
15 S        -0        -0        -0         0         0         0         0
16 S-3.249e-05-0.0004551 -0.006375 -0.009947   -0.2286  -0.02032   -0.2846
17 S   0.04237   0.02308   0.01257   0.01065   0.01265    0.2922    0.1592
18 S     -1.57    0.5504    -0.193   -0.1915    0.1349   -0.3138      0.11
19 S    0.2944  -0.04631  0.007283    0.1774  -0.02905    0.1493  -0.02348
20 S  -0.01859   0.04206  -0.09517  -0.02957    0.2822   -0.0554    0.1254
21 S 9.921e-05  0.003218    0.1044   -0.1205   -0.5241 -0.005345   -0.1734
22 S  -0.02884   0.05066    -0.089   0.01284    0.1338  -0.05333   0.09368
23 S         0        -0         0         0         0        -0         0
     -0.008517  0.001622 -0.007932  -0.01411   0.02372  -0.01719  0.006654

Out[3]:
<rayopt.analysis.Analysis at 0x27dd6d0f9e8>
In [ ]: