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 = "WO2019-220618 Example 9 (Nikkor Z 50mm f/1.8 S)"
columns = "type distance roc diameter material"
# number of surfaces = 26
lensdata = """
O 0.0 0.0 46.28 AIR
S 20 -48.06457 35.6 1.6727/32.2
S 2 50.03333 34.12 1.94595/18
S 2.861 105 34.12 AIR
S 2.805 -226.31231 34.12 1.72916/54.6
S 6.827 -47.98013 34.12 AIR
S 0.644 36.6491 34.28 1.56093/36.6
S 0.1 36.85687 34.46 1.804/46.6
S 5.622 217.9278 34.46 AIR
S 0.2 28.49361 32.98 1.59319/67.9
S 7.332 -161.37986 28.88 1.64769/33.7
S 1.5 20.99038 24.62 AIR
A 5.164 0 22.698 AIR
S 13.02 -23.41799 21.44 1.64769/33.7
S 1.1 998.77224 24.28 AIR
S 0.2 85.12299 27.74 1.77377/47.2
S 5 -35.29338 27.74 AIR
S 2.485 -73.80381 32.32 1.49782/82.6
S 6.4 -23.23519 32.32 AIR
S 6.356 -177.7544 35.28 1.94595/18
S 2.927 -63.69645 35.28 1.64769/33.7
S 1.9 -482.01125 35.28 AIR
S 2.887 -50.20764 35.44 1.64769/33.7
S 1.9 0 37.24 AIR
S 10.5 0 44.62 1.5168/64.1
S 1.6 0 44.62 AIR
I 1 0 43.4 AIR
"""
s = ro.system_from_text(lensdata, columns.split(),
    description=description)
s.fields = 0, .7, 1.
s.object.angle = np.deg2rad(22.940000)
s[6].conic = 0
s[6].aspherics = [0, -4.74106e-07, -3.40824e-10, 2.15394e-12, -1.54492e-15, 0, 0]
s[15].conic = 0
s[15].aspherics = [0, -1.95205e-07, 1.94342e-08, -8.61846e-11, -2.07763e-13, 0, 0]
s[16].conic = 0
s[16].aspherics = [0, 1.47643e-05, 2.08671e-08, 8.44852e-11, -6.9321e-13, 0, 0]
s.update()
print(s)
ro.Analysis(s)
Populating the interactive namespace from numpy and matplotlib
System: WO2019-220618 Example 9 (Nikkor Z 50mm f/1.8 S)
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 22.9 deg
 Pupil:
   Pupil Distance: 44.6719
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 14.2245
Image:
 Radius: 21.7
 Update Radius: True
 Pupil:
   Pupil Distance: -49.6068
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 13.674
Stop: 12
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf      46.28         basic/air   1.000   1.000   89.30
 1 S         20     -48.06       35.6                 -   1.673   1.673   32.20
 2 S          2      50.03      34.12                 -   1.946   1.946   18.00
 3 S      2.861        105      34.12         basic/air   1.000   1.000   89.30
 4 S      2.805     -226.3      34.12                 -   1.729   1.729   54.60
 5 S      6.827     -47.98      34.12         basic/air   1.000   1.000   89.30
 6 S      0.644      36.65      34.28                 -   1.561   1.561   36.60
 7 S        0.1      36.86      34.46                 -   1.804   1.804   46.60
 8 S      5.622      217.9      34.46         basic/air   1.000   1.000   89.30
 9 S        0.2      28.49      32.98                 -   1.593   1.593   67.90
10 S      7.332     -161.4      28.88                 -   1.648   1.648   33.70
11 S        1.5      20.99      24.62         basic/air   1.000   1.000   89.30
12 S      5.164        inf     22.698         basic/air   1.000   1.000   89.30
13 S      13.02     -23.42      21.44                 -   1.648   1.648   33.70
14 S        1.1      998.8      24.28         basic/air   1.000   1.000   89.30
15 S        0.2      85.12      27.74                 -   1.774   1.774   47.20
16 S          5     -35.29      27.74         basic/air   1.000   1.000   89.30
17 S      2.485      -73.8      32.32                 -   1.498   1.498   82.60
18 S        6.4     -23.24      32.32         basic/air   1.000   1.000   89.30
19 S      6.356     -177.8      35.28                 -   1.946   1.946   18.00
20 S      2.927      -63.7      35.28                 -   1.648   1.648   33.70
21 S        1.9       -482      35.28         basic/air   1.000   1.000   89.30
22 S      2.887     -50.21      35.44                 -   1.648   1.648   33.70
23 S        1.9        inf      37.24         basic/air   1.000   1.000   89.30
24 S       10.5        inf      44.62                 -   1.517   1.517   64.10
25 S        1.6        inf      44.62         basic/air   1.000   1.000   89.30
26 S          1        inf       43.4         basic/air   1.000   1.000   89.30

System: WO2019-220618 Example 9 (Nikkor Z 50mm f/1.8 S)
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 22.9 deg
 Pupil:
   Pupil Distance: 44.6719
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 14.2245
Image:
 Radius: 21.7
 Update Radius: True
 Pupil:
   Pupil Distance: -49.6068
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 13.674
Stop: 12
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf      46.28         basic/air   1.000   1.000   89.30
 1 S         20     -48.06       35.6                 -   1.673   1.673   32.20
 2 S          2      50.03      34.12                 -   1.946   1.946   18.00
 3 S      2.861        105      34.12         basic/air   1.000   1.000   89.30
 4 S      2.805     -226.3      34.12                 -   1.729   1.729   54.60
 5 S      6.827     -47.98      34.12         basic/air   1.000   1.000   89.30
 6 S      0.644      36.65      34.28                 -   1.561   1.561   36.60
 7 S        0.1      36.86      34.46                 -   1.804   1.804   46.60
 8 S      5.622      217.9      34.46         basic/air   1.000   1.000   89.30
 9 S        0.2      28.49      32.98                 -   1.593   1.593   67.90
10 S      7.332     -161.4      28.88                 -   1.648   1.648   33.70
11 S        1.5      20.99      24.62         basic/air   1.000   1.000   89.30
12 S      5.164        inf     22.698         basic/air   1.000   1.000   89.30
13 S      13.02     -23.42      21.44                 -   1.648   1.648   33.70
14 S        1.1      998.8      24.28         basic/air   1.000   1.000   89.30
15 S        0.2      85.12      27.74                 -   1.774   1.774   47.20
16 S          5     -35.29      27.74         basic/air   1.000   1.000   89.30
17 S      2.485      -73.8      32.32                 -   1.498   1.498   82.60
18 S        6.4     -23.24      32.32         basic/air   1.000   1.000   89.30
19 S      6.356     -177.8      35.28                 -   1.946   1.946   18.00
20 S      2.927      -63.7      35.28                 -   1.648   1.648   33.70
21 S        1.9       -482      35.28         basic/air   1.000   1.000   89.30
22 S      2.887     -50.21      35.44                 -   1.648   1.648   33.70
23 S        1.9        inf      37.24         basic/air   1.000   1.000   89.30
24 S       10.5        inf      44.62                 -   1.517   1.517   64.10
25 S        1.6        inf      44.62         basic/air   1.000   1.000   89.30
26 S     1.0106        inf       43.4         basic/air   1.000   1.000   89.30

lagrange: -6.2168
track length: 91.33
object, image height: [19.5184 22.5472]
front, back focal length (from PP): [-51.6408  51.6408]
entry, exit pupil height: [14.2245 13.674 ]
entry, exit pupil distance: [ 24.6719 -48.6068]
front, back focal distance: [-29.04    1.035]
front, back principal distance: [ 22.6007 -50.6058]
front, back nodal distance: [ 22.6007 -50.6058]
front, back numerical aperture: [0.     0.2656]
front, back f number: [1.8152 1.8883]
front, back working f number: [   inf 1.8828]
front, back airy radius: [   inf 0.0013]
transverse, angular magnification: [-0.      1.0403]

 # T      path         n   axial y  axial nu   chief y  chief nu
 0 S         0         1     14.22         0    -19.52     0.437
 1 S        20     1.673     14.22     0.199    -10.78    0.2862
 2 S        22     1.946     14.46      0.12    -10.44    0.3432
 3 S     24.86         1     14.64    0.2519    -9.933    0.2538
 4 S     27.67     1.729     15.35    0.3013    -9.221    0.2241
 5 S     34.49         1     16.53    0.0501    -8.337    0.3507
 6 S     35.14     1.561     16.57   -0.2033    -8.111    0.4748
 7 S     35.24     1.804     16.55   -0.3125     -8.08    0.5281
 8 S     40.86         1     15.58   -0.2551    -6.435    0.5044
 9 S     41.06     1.593     15.53   -0.5782    -6.334    0.6362
10 S     48.39     1.648     12.87   -0.5738    -3.406     0.635
11 S     49.89         1     12.35   -0.1931    -2.828    0.5478
12 S     55.06         1     11.35   -0.1931-2.728e-16    0.5478
13 S     68.08     1.648     8.836   0.05122      7.13    0.7449
14 S     69.17         1      8.87   0.05697     7.627    0.7498
15 S     69.38     1.774     8.882  -0.02374     7.777    0.6792
16 S     74.38         1     8.815   -0.2169     9.692    0.4668
17 S     76.86     1.498     8.276   -0.1611     10.85    0.5399
18 S     83.26         1     7.587   -0.3236     13.16    0.2582
19 S     89.62     1.946     5.531   -0.2942      14.8    0.3369
20 S     92.54     1.648     5.089    -0.318     15.31    0.2652
21 S     94.44         1     4.722   -0.3243     15.61    0.2442
22 S     97.33     1.648     3.786   -0.2755     16.32    0.4546
23 S     99.23         1     3.468   -0.2755     16.84    0.4546
24 S     109.7     1.517    0.5758   -0.2755     21.61    0.4546
25 S     111.3         1    0.2852   -0.2755     22.09    0.4546
26 S     112.3         1  0.009715   -0.2755     22.55    0.4546

 # T       SA3      CMA3      AST3      PTZ3      DIS3     TACHC      TCHC
 0 S         0         0         0         0         0         0         0
 1 S    0.1608   -0.3592    0.8025     0.586    -3.102    0.1907   -0.4262
 2 S   -0.4817   0.04426 -0.004066   -0.1176   0.01118   -0.5197   0.04775
 3 S    0.8944    0.3638     0.148    0.3243    0.1921     0.561    0.2282
 4 S   -0.1423   -0.2277   -0.3644    0.1305   -0.3744  -0.07907   -0.1266
 5 S   -0.1319    0.2349   -0.4182   -0.6156      1.84   -0.1364    0.2428
 6 S   -0.7215   -0.4028  0.002499   -0.6867   -0.2282   -0.2962  -0.07629
 7 S  -0.09349  -0.02491 -0.006635   -0.1641  -0.04549  0.007609  0.002027
 8 S   -0.1512    0.3912    -1.012    0.1432     2.248  -0.09916    0.2565
 9 S   0.06428   0.06248   0.06074   -0.9151   -0.8306  -0.08954  -0.08705
10 S    0.1906    -0.181    0.1719  0.009016   -0.1718    0.2034   -0.1932
11 S   0.06441    0.0673   0.07032     1.312     1.444    0.2064    0.2157
12 S         0         0         0         0         0        -0         0
13 S     1.105    -0.471    0.2008     1.176   -0.5868    0.2132  -0.09089
14 S  0.002655   0.03055    0.3514   0.02756     4.359    0.0247    0.2842
15 S   -0.0134    -0.129   -0.7245   -0.3589    -5.695  -0.04801   -0.2504
16 S    0.2715       1.4     1.086   -0.8657     1.737   -0.1379   0.05673
17 S    0.2356   -0.2289    0.2224    0.3154   -0.5224   0.03971  -0.03858
18 S    -1.464    -0.694   -0.3291    -1.002    -0.631  -0.07194  -0.03411
19 S    0.3101   -0.1529   0.07538    0.1916   -0.1316    0.1922  -0.09473
20 S  -0.07359  -0.02139 -0.006219   -0.1024  -0.03156   -0.1273  -0.03701
21 S   -0.1979    0.1255  -0.07956  -0.05712   0.08666  -0.06673   0.04231
22 S    0.2443   0.04939  0.009985    0.5483    0.1129   0.06401   0.01294
23 S  -0.08302     0.137    -0.226         0     0.373  -0.04041   0.06669
24 S   0.01234  -0.02035   0.03359        -0  -0.05542  0.003057 -0.005044
25 S -0.006109   0.01008  -0.01663         0   0.02745 -0.001514  0.002498
26 S         0        -0         0         0         0        -0         0
     -0.004177  0.002859   0.04776   -0.1219   0.02463 -0.007838 -0.001679

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