In [1]:
%pylab inline
import warnings
import numpy as np
import matplotlib.pyplot as plt

import rayopt as ro

# ignore matplotlib and numpy warning each other
warnings.simplefilter("ignore", FutureWarning)
# ignore floating point exceptions
np.seterr(divide="ignore", invalid="ignore")
# by default only print 4 significant digits
np.set_printoptions(precision=4)
Populating the interactive namespace from numpy and matplotlib
In [39]:
# It appears that rayopt requires distance rather than
# thickness quoted in patent literature
# So we have to move the thickness value one row down
# 
# The first surface represents the Object (O)
# The last surface represents the Image (I)

description = "Retrofocus-Nikkor-Matsui-28mmf3.5-US4099805A"
columns = "type distance roc diameter material"
text = """
O 20      0   150 AIR
S 20.0 386.719    130 1.62374/47.0
S 9.199   1871.551    130.0 AIR
S 0.343 167.545 110.0 1.62041/60.3
S 4.909 55.370  80.0 AIR
S 93.708 85.216 50.0 1.70154/41.1
S 9.611 -197.175 50.0 AIR
A 2.222  0   43.1 AIR
S 17.0 -77.840 56.0 1.7552/27.5
S 15.466 120.630 49.85 AIR
S 3.776 -265.822 49.85 1.62041/60.3
S 9.268 -64.116 56.0 AIR
S 0.343 285.350 64.0 1.58913/61.2
S 8.581 -150.156 64.0 AIR
I 133.975 0  148.78 AIR
"""
In [40]:
s = ro.system_from_text(text, columns.split(), description=description)
s.object.angle = np.deg2rad(36.0)
s.fields = 0, .7, 1.
#s.wavelengths = [587.5618e-9]
In [41]:
s.update()
print(s)
System: Retrofocus-Nikkor-Matsui-28mmf3.5-US4099805A
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 36 deg
 Pupil:
   Pupil Distance: 95.2413
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 14.6487
Image:
 Radius: 74.4
 Update Radius: True
 Pupil:
   Pupil Distance: -194.478
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 28.476
Stop: 7
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S         20        inf        150         basic/air   1.000   1.000   89.30
 1 S         20      386.7        130                 -   1.624   1.624   47.00
 2 S      9.199       1872        130         basic/air   1.000   1.000   89.30
 3 S      0.343      167.5        110                 -   1.620   1.620   60.30
 4 S      4.909      55.37         80         basic/air   1.000   1.000   89.30
 5 S     93.708      85.22         50                 -   1.702   1.702   41.10
 6 S      9.611     -197.2         50         basic/air   1.000   1.000   89.30
 7 S      2.222        inf       43.1         basic/air   1.000   1.000   89.30
 8 S         17     -77.84         56                 -   1.755   1.755   27.50
 9 S     15.466      120.6      49.85         basic/air   1.000   1.000   89.30
10 S      3.776     -265.8      49.85                 -   1.620   1.620   60.30
11 S      9.268     -64.12         56         basic/air   1.000   1.000   89.30
12 S      0.343      285.4         64                 -   1.589   1.589   61.20
13 S      8.581     -150.2         64         basic/air   1.000   1.000   89.30
14 S     133.97        inf     148.78         basic/air   1.000   1.000   89.30

In [42]:
ro.Analysis(s)
System: Retrofocus-Nikkor-Matsui-28mmf3.5-US4099805A
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 36 deg
 Pupil:
   Pupil Distance: 95.2413
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 14.6487
Image:
 Radius: 74.4
 Update Radius: True
 Pupil:
   Pupil Distance: -194.478
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 28.476
Stop: 7
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S         20        inf        150         basic/air   1.000   1.000   89.30
 1 S         20      386.7        130                 -   1.624   1.624   47.00
 2 S      9.199       1872        130         basic/air   1.000   1.000   89.30
 3 S      0.343      167.5        110                 -   1.620   1.620   60.30
 4 S      4.909      55.37         80         basic/air   1.000   1.000   89.30
 5 S     93.708      85.22         50                 -   1.702   1.702   41.10
 6 S      9.611     -197.2         50         basic/air   1.000   1.000   89.30
 7 S      2.222        inf       43.1         basic/air   1.000   1.000   89.30
 8 S         17     -77.84         56                 -   1.755   1.755   27.50
 9 S     15.466      120.6      49.85         basic/air   1.000   1.000   89.30
10 S      3.776     -265.8      49.85                 -   1.620   1.620   60.30
11 S      9.268     -64.12         56         basic/air   1.000   1.000   89.30
12 S      0.343      285.4         64                 -   1.589   1.589   61.20
13 S      8.581     -150.2         64         basic/air   1.000   1.000   89.30
14 S     133.71        inf     148.78         basic/air   1.000   1.000   89.30

lagrange: -11.834
track length: 174.43
object, image height: [76.9219 80.801 ]
front, back focal length (from PP): [-100.1271  100.1271]
entry, exit pupil height: [14.6487 28.476 ]
entry, exit pupil distance: [ 75.2413 -60.5034]
front, back focal distance: [ 23.727  134.0988]
front, back principal distance: [123.8541  33.9718]
front, back nodal distance: [123.8541  33.9718]
front, back numerical aperture: [0.     0.1448]
front, back f number: [3.4176 1.7581]
front, back working f number: [  inf 3.454]
front, back airy radius: [   inf 0.0025]
transverse, angular magnification: [-0.      0.5144]

 # T      path         n   axial y  axial nu   chief y  chief nu
 0 S        20         1     14.65         0    -76.92    0.8079
 1 S        40     1.624     14.65  -0.02362    -60.77    0.9058
 2 S      49.2         1     14.51  -0.01878    -55.64    0.8873
 3 S     49.54      1.62     14.51  -0.07248    -55.33     1.092
 4 S     54.45         1     14.29   0.08755    -52.02    0.5095
 5 S     148.2     1.702     22.49  -0.09753    -4.297    0.5448
 6 S     157.8         1     21.94   -0.1756     -1.22    0.5492
 7 S       160         1     21.55   -0.1756 -2.33e-14    0.5492
 8 S       177     1.755     18.57  0.004501     9.333    0.6397
 9 S     192.5         1     18.61    0.1209     14.97    0.7334
10 S     196.2      1.62     19.06    0.1654     17.74    0.7747
11 S     205.5         1     20.01  -0.02811     22.17    0.5603
12 S     205.8     1.589        20  -0.06938     22.36    0.5142
13 S     214.4         1     19.62   -0.1463     25.14    0.4156
14 S     348.4         1   0.02355   -0.1463      80.8    0.4156

 # T       SA3      CMA3      AST3      PTZ3      DIS3     TACHC      TCHC
 0 S         0         0         0         0         0         0         0
 1 S-0.0006431  -0.01104   -0.1897   -0.4746    -11.41  -0.03097   -0.5319
 2 S-5.909e-05  0.004597   -0.3576   0.09806     20.19 -0.008925    0.6944
 3 S -0.002013  -0.01653   -0.1357    -1.092    -10.08  -0.04265   -0.3501
 4 S     0.671   -0.8354      1.04     3.304    -5.408     0.214   -0.2665
 5 S     -1.15    -1.502    -1.961    -2.312    -5.578   -0.5414   -0.7069
 6 S   -0.8739     1.692    -3.275   -0.9991     8.274   -0.4309    0.8343
 7 S         0         0         0         0         0        -0         0
 8 S     1.923    -1.993     2.066     2.641    -4.878    0.8212   -0.8511
 9 S    0.5745      1.79     5.577     1.704     22.69    0.5469     1.704
10 S  -0.00912   -0.1235    -1.674    0.6881    -13.35  -0.04065   -0.5506
11 S   -0.7204     0.454   -0.2862    -2.853     1.978    -0.295    0.1859
12 S 7.496e-05   0.00114   0.01734   -0.6207    -9.177  -0.03472    -0.528
13 S   -0.6109    0.5471     -0.49     -1.18     1.495   -0.2248    0.2013
14 S         0        -0         0         0         0        -0         0
       -0.1981  0.007202    0.3319    -1.095    -5.252  -0.06782   -0.1653

Out[42]:
<rayopt.analysis.Analysis at 0x7f2f50b5bcc0>
In [ ]: