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 8767319 Example 1 (AF-S Nikkor 85mm f/1.4G)"
columns = "type distance roc diameter material"
# number of surfaces = 20
lensdata = """
O 0.0 0.0 80.236 AIR
S 20 54.231 61.72 1.62041/60.3
S 9.43 281.169 61.72 AIR
S 0.3 39.221 53.5 1.804/46.6
S 9.64 54.944 48.14 AIR
S 3.708 72.063 44.93 1.8061/33.3
S 2.09 26.207 38.5 AIR
S 17.306 55.974 36.35 1.83481/42.7
S 2.31 105.851 36.35 AIR
A 2.814 0 33.999 AIR
S 5.935 -40.001 34.21 1.69895/30.1
S 1.2 67.072 34.21 AIR
S 5.137 -426.237 36.35 1.883/40.8
S 3.07 -71.448 36.35 AIR
S 0.15 71.673 37.42 1.72916/54.7
S 6.873 -58.34 37.42 AIR
S 1.7 -66.6 35.28 1.90366/31.3
S 3.7 -37.963 35.28 1.64769/33.8
S 1.69 51.067 35.28 AIR
S 2.267 85.957 33.49 1.834/37.2
S 6 -85.957 33.49 AIR
I 41.05 0 43.26 AIR
"""
s = ro.system_from_text(lensdata, columns.split(),
    description=description)
s.fields = 0, .7, 1.
s.object.angle = np.deg2rad(14.333000)
s.update()
print(s)
ro.Analysis(s)
Populating the interactive namespace from numpy and matplotlib
System: US 8
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 14.3 deg
 Pupil:
   Pupil Distance: 95.2516
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 29.4227
Image:
 Radius: 21.6
 Update Radius: True
 Pupil:
   Pupil Distance: -90.7722
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 31.4295
Stop: 9
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf     80.236         basic/air   1.000   1.000   89.30
 1 S         20      54.23      61.72                 -   1.620   1.620   60.30
 2 S       9.43      281.2      61.72         basic/air   1.000   1.000   89.30
 3 S        0.3      39.22       53.5                 -   1.804   1.804   46.60
 4 S       9.64      54.94      48.14         basic/air   1.000   1.000   89.30
 5 S      3.708      72.06      44.93                 -   1.806   1.806   33.30
 6 S       2.09      26.21       38.5         basic/air   1.000   1.000   89.30
 7 S     17.306      55.97      36.35                 -   1.835   1.835   42.70
 8 S       2.31      105.9      36.35         basic/air   1.000   1.000   89.30
 9 S      2.814        inf     33.999         basic/air   1.000   1.000   89.30
10 S      5.935        -40      34.21                 -   1.699   1.699   30.10
11 S        1.2      67.07      34.21         basic/air   1.000   1.000   89.30
12 S      5.137     -426.2      36.35                 -   1.883   1.883   40.80
13 S       3.07     -71.45      36.35         basic/air   1.000   1.000   89.30
14 S       0.15      71.67      37.42                 -   1.729   1.729   54.70
15 S      6.873     -58.34      37.42         basic/air   1.000   1.000   89.30
16 S        1.7      -66.6      35.28                 -   1.904   1.904   31.30
17 S        3.7     -37.96      35.28                 -   1.648   1.648   33.80
18 S       1.69      51.07      35.28         basic/air   1.000   1.000   89.30
19 S      2.267      85.96      33.49                 -   1.834   1.834   37.20
20 S          6     -85.96      33.49         basic/air   1.000   1.000   89.30
21 S      41.05        inf      43.26         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 8
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 14.3 deg
 Pupil:
   Pupil Distance: 95.2516
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 29.4227
Image:
 Radius: 21.6
 Update Radius: True
 Pupil:
   Pupil Distance: -90.7722
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 31.4295
Stop: 9
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S          0        inf     80.236         basic/air   1.000   1.000   89.30
 1 S         20      54.23      61.72                 -   1.620   1.620   60.30
 2 S       9.43      281.2      61.72         basic/air   1.000   1.000   89.30
 3 S        0.3      39.22       53.5                 -   1.804   1.804   46.60
 4 S       9.64      54.94      48.14         basic/air   1.000   1.000   89.30
 5 S      3.708      72.06      44.93                 -   1.806   1.806   33.30
 6 S       2.09      26.21       38.5         basic/air   1.000   1.000   89.30
 7 S     17.306      55.97      36.35                 -   1.835   1.835   42.70
 8 S       2.31      105.9      36.35         basic/air   1.000   1.000   89.30
 9 S      2.814        inf     33.999         basic/air   1.000   1.000   89.30
10 S      5.935        -40      34.21                 -   1.699   1.699   30.10
11 S        1.2      67.07      34.21         basic/air   1.000   1.000   89.30
12 S      5.137     -426.2      36.35                 -   1.883   1.883   40.80
13 S       3.07     -71.45      36.35         basic/air   1.000   1.000   89.30
14 S       0.15      71.67      37.42                 -   1.729   1.729   54.70
15 S      6.873     -58.34      37.42         basic/air   1.000   1.000   89.30
16 S        1.7      -66.6      35.28                 -   1.904   1.904   31.30
17 S        3.7     -37.96      35.28                 -   1.648   1.648   33.80
18 S       1.69      51.07      35.28         basic/air   1.000   1.000   89.30
19 S      2.267      85.96      33.49                 -   1.834   1.834   37.20
20 S          6     -85.96      33.49         basic/air   1.000   1.000   89.30
21 S     41.076        inf      43.26         basic/air   1.000   1.000   89.30

lagrange: -7.6041
track length: 85.32
object, image height: [24.6104 21.9556]
front, back focal length (from PP): [-85.0248  85.0248]
entry, exit pupil height: [29.4227 31.4295]
entry, exit pupil distance: [ 75.2516 -49.7222]
front, back focal distance: [-4.343  41.0905]
front, back principal distance: [ 80.6818 -43.9343]
front, back nodal distance: [ 80.6818 -43.9343]
front, back numerical aperture: [0.     0.3271]
front, back f number: [1.4449 1.3526]
front, back working f number: [  inf 1.529]
front, back airy radius: [   inf 0.0011]
transverse, angular magnification: [-0.      0.9361]

 # T      path         n   axial y  axial nu   chief y  chief nu
 0 S         0         1     29.42         0    -24.61    0.2584
 1 S        20      1.62     29.42   -0.3364    -19.44    0.4808
 2 S     29.43         1     27.46   -0.2759    -16.65    0.4441
 3 S     29.73     1.804     27.38    -0.837    -16.51    0.7824
 4 S     39.37         1     22.91   -0.5019    -12.33    0.6021
 5 S     43.08     1.806     21.05   -0.7372     -10.1     0.715
 6 S     45.17         1      20.2   -0.1163    -9.272    0.4299
 7 S     62.47     1.835     18.18   -0.3874    -1.834    0.4572
 8 S     64.78         1      17.7   -0.2479    -1.258    0.4473
 9 S      67.6         1        17   -0.2479 2.395e-15    0.4473
10 S     73.53     1.699     15.53   0.02338     2.654    0.4937
11 S     74.73         1     15.55    0.1853     3.003     0.525
12 S     79.87     1.883      16.5    0.2195     5.699    0.5368
13 S     82.94         1     16.85   0.01124     6.574    0.4555
14 S     83.09     1.729     16.86   -0.1602     6.642     0.388
15 S     89.96         1     16.22   -0.3628     8.184    0.2857
16 S     91.66     1.904      15.6   -0.1512      8.67    0.4033
17 S     95.36     1.648     15.31   -0.2544     9.454    0.3396
18 S     97.05         1     15.05  -0.06363     9.802    0.4639
19 S     99.32     1.834      14.9   -0.2082     10.85    0.3586
20 S     105.3         1     14.22   -0.3461     12.03    0.2419
21 S     146.4         1   0.01794   -0.3461     21.96    0.2419

 # T       SA3      CMA3      AST3      PTZ3      DIS3     TACHC      TCHC
 0 S         0         0         0         0         0         0         0
 1 S    -1.603    0.2959  -0.05462   -0.5889    0.1188   -0.2927   0.05404
 2 S   -0.1858    0.4012   -0.8667    0.1136     1.627  -0.08966    0.1937
 3 S    0.1308  0.007104 0.0003859    -0.948  -0.05148   -0.3193  -0.01735
 4 S  -0.05812    0.2588    -1.152    0.6767     2.118  -0.05363    0.2388
 5 S    0.3682   -0.8111     1.786   -0.5167    -2.797    0.1708   -0.3761
 6 S     1.372    0.1593    0.0185     1.421    0.1671    0.5115   0.05939
 7 S  0.001287  0.002448  0.004659   -0.6781    -1.281   -0.1167   -0.2221
 8 S  -0.02203     0.119   -0.6425    0.3586     1.533  -0.04388     0.237
 9 S         0        -0         0         0         0        -0         0
10 S     2.321     -1.39    0.8323     0.858    -1.012    0.3898   -0.2334
11 S    0.6917    0.9447      1.29    0.5117     2.461    0.2559    0.3494
12 S  -0.06312   -0.2203   -0.7686   0.09178    -2.362  -0.08024     -0.28
13 S  -0.06226    0.1007   -0.1629   -0.5476     1.149   -0.1257    0.2033
14 S  -0.09583   -0.2131    -0.474   -0.4908    -2.146  -0.09245   -0.2056
15 S    -2.973    0.6745    -0.153    -0.603    0.1715   -0.2313   0.05248
16 S     2.578   -0.6714    0.1748    0.5946   -0.2004    0.4079   -0.1062
17 S   -0.9702  -0.07468 -0.005748   -0.1794  -0.01425   -0.1436  -0.01106
18 S   0.03495   0.09919    0.2814    0.6421     2.621    0.1168    0.3313
19 S 0.0004402  0.002366   0.01272   -0.4414    -2.304  -0.05775   -0.3104
20 S    -1.527    0.3044  -0.06067   -0.4414    0.1001   -0.2568   0.05119
21 S         0        -0         0         0         0        -0         0
      -0.06183  -0.01085   0.06035   -0.1674   -0.1015  -0.05121  0.008301

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