In [4]:
%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 = "JP2017-227799 Example 1 (AF-S Nikkor 28mm f/1.4E ED)"
columns = "type distance roc diameter material"
# number of surfaces = 27
lensdata = """
O 0.0 0.0 72.956 AIR
S 20 70.017 56.12 1.68893/31.2
S 2.5 29.64 47.62 AIR
S 10.58 94.105 45.32 1.713/53.9
S 2.4 31.773 43.72 1.5138/53
S 0.05 27.197 43.72 AIR
S 9.49 164.736 42.03 1.84666/23.8
S 4.94 -131.025 42.03 AIR
S 4.85 -46.832 41.19 1.56883/56
S 2.15 134.737 42.24 1.883/40.8
S 4.17 -366.912 42.24 AIR
S 3.03 70.316 41.34 1.7725/49.6
S 7.09 -99.338 41.34 AIR
S 7.7 55.349 38.06 1.72916/54.7
S 4.2 289.177 38.06 AIR
S 0.15 111.31 37.14 1.6968/55.5
S 4 -158.345 37.14 AIR
S 0.15 322.096 35.08 1.59282/68.6
S 5.79 -37.124 35.08 1.738/32.3
S 1.5 37.221 28.94 AIR
A 5.6 0 26.647 AIR
S 5.78 -24.127 27.96 1.8061/33.3
S 1.3 47.257 31.41 1.8322/40.1
S 5.35 -131.725 31.41 AIR
S 0.3 64.397 32.73 1.59282/68.6
S 8.98 -28.781 32.73 AIR
S 0.15 -280.388 32.67 1.6935/53.2
S 3.71 -55.502 32.67 AIR
I 38.47 0 43.2 AIR
"""
s = ro.system_from_text(lensdata, columns.split(),
    description=description)
s.fields = 0, .7, 1.
s.object.angle = np.deg2rad(37.710000)
s[5].conic = -1.81201
s[5].aspherics = [0, 5.08e-06, -6.2e-09, 1.16e-11, -2.04e-14, 1.91e-17, 0]
s[23].conic = 0
s[23].aspherics = [0, 3.39e-06, -1.04e-09, 5.15e-11, 1.18e-14, -1.11e-16, 0]
s[26].conic = 0
s[26].aspherics = [0, -1.45e-05, -2.75e-08, 4.09e-11, -1.22e-13, 2.18e-15, -3.26e-18]
s[27].conic = 1.61294
s[27].aspherics = [0, -4.87e-06, -2.36e-08, 7.19e-11, -3.12e-13, 2.12e-15, -2.42e-18]
s.update()
print(s)
ro.Analysis(s)
Populating the interactive namespace from numpy and matplotlib
System: JP2017-227799 Example 1 (AF-S Nikkor 28mm f/1.4E ED)
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 37.7 deg
 Pupil:
   Pupil Distance: 54.0386
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 10.0662
Image:
 Radius: 21.6
 Update Radius: True
 Pupil:
   Pupil Distance: -73.6497
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 26.0825
Stop: 20
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf     72.956         basic/air   1.000   1.000   89.30
 1 S         20      70.02      56.12                 -   1.689   1.689   31.20
 2 S        2.5      29.64      47.62         basic/air   1.000   1.000   89.30
 3 S      10.58      94.11      45.32                 -   1.713   1.713   53.90
 4 S        2.4      31.77      43.72                 -   1.514   1.514   53.00
 5 S       0.05       27.2      43.72         basic/air   1.000   1.000   89.30
 6 S       9.49      164.7      42.03                 -   1.847   1.847   23.80
 7 S       4.94       -131      42.03         basic/air   1.000   1.000   89.30
 8 S       4.85     -46.83      41.19                 -   1.569   1.569   56.00
 9 S       2.15      134.7      42.24                 -   1.883   1.883   40.80
10 S       4.17     -366.9      42.24         basic/air   1.000   1.000   89.30
11 S       3.03      70.32      41.34                 -   1.772   1.772   49.60
12 S       7.09     -99.34      41.34         basic/air   1.000   1.000   89.30
13 S        7.7      55.35      38.06                 -   1.729   1.729   54.70
14 S        4.2      289.2      38.06         basic/air   1.000   1.000   89.30
15 S       0.15      111.3      37.14                 -   1.697   1.697   55.50
16 S          4     -158.3      37.14         basic/air   1.000   1.000   89.30
17 S       0.15      322.1      35.08                 -   1.593   1.593   68.60
18 S       5.79     -37.12      35.08                 -   1.738   1.738   32.30
19 S        1.5      37.22      28.94         basic/air   1.000   1.000   89.30
20 S        5.6        inf     26.647         basic/air   1.000   1.000   89.30
21 S       5.78     -24.13      27.96                 -   1.806   1.806   33.30
22 S        1.3      47.26      31.41                 -   1.832   1.832   40.10
23 S       5.35     -131.7      31.41         basic/air   1.000   1.000   89.30
24 S        0.3       64.4      32.73                 -   1.593   1.593   68.60
25 S       8.98     -28.78      32.73         basic/air   1.000   1.000   89.30
26 S       0.15     -280.4      32.67                 -   1.694   1.694   53.20
27 S       3.71      -55.5      32.67         basic/air   1.000   1.000   89.30
28 S      38.47        inf       43.2         basic/air   1.000   1.000   89.30

System: JP2017-227799 Example 1 (AF-S Nikkor 28mm f/1.4E ED)
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 37.7 deg
 Pupil:
   Pupil Distance: 54.0386
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 10.0662
Image:
 Radius: 21.6
 Update Radius: True
 Pupil:
   Pupil Distance: -73.6497
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 26.0825
Stop: 20
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf     72.956         basic/air   1.000   1.000   89.30
 1 S         20      70.02      56.12                 -   1.689   1.689   31.20
 2 S        2.5      29.64      47.62         basic/air   1.000   1.000   89.30
 3 S      10.58      94.11      45.32                 -   1.713   1.713   53.90
 4 S        2.4      31.77      43.72                 -   1.514   1.514   53.00
 5 S       0.05       27.2      43.72         basic/air   1.000   1.000   89.30
 6 S       9.49      164.7      42.03                 -   1.847   1.847   23.80
 7 S       4.94       -131      42.03         basic/air   1.000   1.000   89.30
 8 S       4.85     -46.83      41.19                 -   1.569   1.569   56.00
 9 S       2.15      134.7      42.24                 -   1.883   1.883   40.80
10 S       4.17     -366.9      42.24         basic/air   1.000   1.000   89.30
11 S       3.03      70.32      41.34                 -   1.772   1.772   49.60
12 S       7.09     -99.34      41.34         basic/air   1.000   1.000   89.30
13 S        7.7      55.35      38.06                 -   1.729   1.729   54.70
14 S        4.2      289.2      38.06         basic/air   1.000   1.000   89.30
15 S       0.15      111.3      37.14                 -   1.697   1.697   55.50
16 S          4     -158.3      37.14         basic/air   1.000   1.000   89.30
17 S       0.15      322.1      35.08                 -   1.593   1.593   68.60
18 S       5.79     -37.12      35.08                 -   1.738   1.738   32.30
19 S        1.5      37.22      28.94         basic/air   1.000   1.000   89.30
20 S        5.6        inf     26.647         basic/air   1.000   1.000   89.30
21 S       5.78     -24.13      27.96                 -   1.806   1.806   33.30
22 S        1.3      47.26      31.41                 -   1.832   1.832   40.10
23 S       5.35     -131.7      31.41         basic/air   1.000   1.000   89.30
24 S        0.3       64.4      32.73                 -   1.593   1.593   68.60
25 S       8.98     -28.78      32.73         basic/air   1.000   1.000   89.30
26 S       0.15     -280.4      32.67                 -   1.694   1.694   53.20
27 S       3.71      -55.5      32.67         basic/air   1.000   1.000   89.30
28 S     38.476        inf       43.2         basic/air   1.000   1.000   89.30

lagrange: -8.8023
track length: 105.91
object, image height: [47.2405 24.8483]
front, back focal length (from PP): [-28.4392  28.4392]
entry, exit pupil height: [10.0662 26.0825]
entry, exit pupil distance: [ 34.0386 -35.1797]
front, back focal distance: [23.0564 38.4986]
front, back principal distance: [51.4957 10.0594]
front, back nodal distance: [51.4957 10.0594]
front, back numerical aperture: [0.     0.3338]
front, back f number: [1.4126 0.5452]
front, back working f number: [   inf 1.4985]
front, back airy radius: [   inf 0.0011]
transverse, angular magnification: [-0.      0.3859]

 # T      path         n   axial y  axial nu   chief y  chief nu
 0 S         0         1     10.07         0    -47.24    0.8744
 1 S        20     1.689     10.07  -0.09901    -29.76     1.167
 2 S      22.5         1      9.92    0.1315    -28.03    0.5159
 3 S     33.08     1.713     11.31   0.04581    -22.57    0.6868
 4 S     35.48     1.514     11.37    0.1171    -21.61    0.5514
 5 S     35.53         1     11.38     0.332    -21.59    0.1437
 6 S     45.02     1.847     14.53    0.2573    -20.23    0.2476
 7 S     49.96         1     15.22     0.159    -19.57     0.374
 8 S     54.81     1.569     15.99    0.3531    -17.75    0.1585
 9 S     56.96     1.883     16.47    0.3147    -17.54    0.1994
10 S     61.13         1     17.17    0.2734    -17.09    0.2405
11 S     64.16     1.772        18   0.07577    -16.37    0.4202
12 S     71.25         1      18.3  -0.06648    -14.68    0.5344
13 S     78.95     1.729     17.79   -0.3007    -10.57    0.6736
14 S     83.15         1     17.06   -0.2577    -8.935    0.6511
15 S      83.3     1.697     17.02   -0.3642    -8.838    0.7064
16 S      87.3         1     16.16   -0.4353    -7.172    0.7379
17 S     87.45     1.593     16.09   -0.4649    -7.062    0.7509
18 S     93.24     1.738      14.4   -0.4086    -4.332     0.734
19 S     94.74         1     14.05   -0.1301    -3.699    0.6607
20 S     100.3         1     13.32   -0.1301 4.012e-15    0.6607
21 S     106.1     1.806     12.57    0.2898     3.818    0.7882
22 S     107.4     1.832     12.78    0.2828     4.385    0.7857
23 S     112.8         1     13.61    0.1968     6.679    0.7436
24 S     113.1     1.593     13.67   0.07109     6.902      0.68
25 S     122.1         1     14.07   -0.2185     10.74     0.459
26 S     122.2     1.694     14.03   -0.1838     10.81    0.4857
27 S     125.9         1     13.63   -0.3541     11.87    0.3375
28 S     164.4         1    0.0139   -0.3541     24.85    0.3375

 # T       SA3      CMA3      AST3      PTZ3      DIS3     TACHC      TCHC
 0 S         0         0         0         0         0         0         0
 1 S   -0.0102  -0.03187  -0.09957   -0.6367      -2.3  -0.05343   -0.1669
 2 S    0.5055   -0.4663      0.43     1.504    -1.784    0.1706   -0.1574
 3 S   -0.1171   -0.1284   -0.1408   -0.4834   -0.6844  -0.06203  -0.06801
 4 S    0.2475   -0.1796    0.1303    0.2644   -0.2864    0.0279  -0.02024
 5 S     1.938    -1.061   -0.2556     1.364     1.269    0.1543   -0.1337
 6 S   -0.9279  -0.04604 -0.002284   -0.3042  -0.01521   -0.3319  -0.01647
 7 S  0.003294   0.04022    0.4911   -0.3824     1.327   0.03546     0.433
 8 S  -0.01162   0.04796    -0.198     0.846    -2.675   0.05328     -0.22
 9 S   -0.3777   0.03168 -0.002657  -0.08632  0.007463   -0.1272   0.01067
10 S    0.2296    0.2908    0.3685   -0.1397    0.2899    0.1262    0.1599
11 S    -1.774  -0.02573-0.0003732   -0.6774 -0.009832   -0.2362 -0.003427
12 S   -0.1471    0.4002    -1.089   -0.4795     4.267   -0.1138    0.3096
13 S   -0.0557  -0.07501    -0.101   -0.8326    -1.257  -0.09866   -0.1328
14 S   -0.1493    0.4659    -1.454    0.1594     4.039  -0.07374    0.2301
15 S   0.03458   -0.1886     1.029   -0.4032    -3.413   0.03724   -0.2031
16 S    -2.032     2.962    -4.317   -0.2834     6.705   -0.1813    0.2643
17 S    0.8493    -1.578     2.932   -0.1263    -5.214   0.09493   -0.1764
18 S     1.144   -0.9897    0.8561    0.1545   -0.8742      0.34   -0.2941
19 S  0.006394    0.0145   0.03287     1.247     2.901    0.1291    0.2926
20 S         0        -0         0         0         0        -0         0
21 S     1.647    -1.271    0.9802     2.022    -2.316    0.3097   -0.2389
22 S  -0.05044  -0.06194  -0.07606  -0.01825   -0.1158    0.0583   0.07159
23 S      1.11    0.6757       1.3   -0.3769      5.02   0.04067    0.3013
24 S   -0.5445    -1.132    -2.355   -0.6316    -6.211  -0.08557    -0.178
25 S    -2.448    0.2972  -0.03608    -1.413    0.1759   -0.1523   0.01849
26 S     4.622     3.044      3.15    0.1596    0.9135   0.08186   -0.1282
27 S    -3.639     -1.01    -1.324   -0.8063   -0.8955   -0.1776   0.03658
28 S         0        -0         0         0         0        -0         0
       0.05322   0.02522    0.2485   -0.3611    -1.137   -0.0341  -0.00959

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