In [6]:
%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 [7]:
# 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 = "Doublegauss-Nikkor-Haruo-58mmf1.4-JP2013-019993A"
columns = "type distance roc diameter material"
text = """
O 20      0   100 AIR
S 5.0 52.8577    47.2 1.74443/49.53
S 6.0   229.3475    47.2 AIR
S 0.1 40.3738 39.6 1.755/52.34
S 6.0 354.9744  39.6 1.48749/70.31
S 1.5 42.4134 35.1 AIR
S 4.1038 290.8467 34.0 1.68893/31.16
S 1.5 31.6359 33.0 AIR
A 6.0  0   29.0 AIR
S 6.0 -30.7873 30.0 1.72825/28.46
S 1.7 35.1427 33.5 1.883/40.66
S 7.0 -131.1407 33.5 AIR
S 0.1 118.7661 33.8 1.883/40.66
S 6.0 -44.2318 33.8 1.53172/48.78
S 1.5 44.2683 33.8 1.7443/49.53
S 6.0 -77.2943 33.8 AIR
I 38.7  0    42.42 AIR
"""
In [8]:
s = ro.system_from_text(text, columns.split(),
    description=description)
s.object.angle = np.deg2rad(20)

## Aspheric data
## Note 1.0 has been subtracted from k because rayopt adds it
s[1].conic = -0.4279
s[1].aspherics = [0, 1.10084E-07, 6.21998E-10, -4.25694E-13]
s[15].conic = 13.1597
s[15].aspherics = [0, 8.65514E-06, 4.15940E-09, 1.25812E-11, 1.22728E-14]

s.fields = 0, .7, 1.
#s.wavelengths = [587.5618e-9]
In [9]:
s.update()
#s.paraxial.resize()
print(s)
System: Doublegauss-Nikkor-Haruo-58mmf1.4-JP2013-019993A
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 20 deg
 Pupil:
   Pupil Distance: 34.4064
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 20.6598
Image:
 Radius: 21.2
 Update Radius: True
 Pupil:
   Pupil Distance: -68.8401
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 24.5107
Stop: 8
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S         20        inf        100         basic/air   1.000   1.000   89.30
 1 S          5      52.86       47.2                 -   1.744   1.744   49.53
 2 S          6      229.3       47.2         basic/air   1.000   1.000   89.30
 3 S        0.1      40.37       39.6                 -   1.755   1.755   52.34
 4 S          6        355       39.6                 -   1.487   1.487   70.31
 5 S        1.5      42.41       35.1         basic/air   1.000   1.000   89.30
 6 S     4.1038      290.8         34                 -   1.689   1.689   31.16
 7 S        1.5      31.64         33         basic/air   1.000   1.000   89.30
 8 S          6        inf         29         basic/air   1.000   1.000   89.30
 9 S          6     -30.79         30                 -   1.728   1.728   28.46
10 S        1.7      35.14       33.5                 -   1.883   1.883   40.66
11 S          7     -131.1       33.5         basic/air   1.000   1.000   89.30
12 S        0.1      118.8       33.8                 -   1.883   1.883   40.66
13 S          6     -44.23       33.8                 -   1.532   1.532   48.78
14 S        1.5      44.27       33.8                 -   1.744   1.744   49.53
15 S          6     -77.29       33.8         basic/air   1.000   1.000   89.30
16 S       38.7        inf      42.42         basic/air   1.000   1.000   89.30

In [10]:
ro.Analysis(s)
System: Doublegauss-Nikkor-Haruo-58mmf1.4-JP2013-019993A
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 20 deg
 Pupil:
   Pupil Distance: 34.4064
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 20.6598
Image:
 Radius: 21.2
 Update Radius: True
 Pupil:
   Pupil Distance: -68.8401
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 24.5107
Stop: 8
Elements:
 # T   Distance   Rad Curv   Diameter          Material       n      nd      Vd
 0 S         20        inf        100         basic/air   1.000   1.000   89.30
 1 S          5      52.86       47.2                 -   1.744   1.744   49.53
 2 S          6      229.3       47.2         basic/air   1.000   1.000   89.30
 3 S        0.1      40.37       39.6                 -   1.755   1.755   52.34
 4 S          6        355       39.6                 -   1.487   1.487   70.31
 5 S        1.5      42.41       35.1         basic/air   1.000   1.000   89.30
 6 S     4.1038      290.8         34                 -   1.689   1.689   31.16
 7 S        1.5      31.64         33         basic/air   1.000   1.000   89.30
 8 S          6        inf         29         basic/air   1.000   1.000   89.30
 9 S          6     -30.79         30                 -   1.728   1.728   28.46
10 S        1.7      35.14       33.5                 -   1.883   1.883   40.66
11 S          7     -131.1       33.5         basic/air   1.000   1.000   89.30
12 S        0.1      118.8       33.8                 -   1.883   1.883   40.66
13 S          6     -44.23       33.8                 -   1.532   1.532   48.78
14 S        1.5      44.27       33.8                 -   1.744   1.744   49.53
15 S          6     -77.29       33.8         basic/air   1.000   1.000   89.30
16 S     38.727        inf      42.42         basic/air   1.000   1.000   89.30

lagrange: -7.6978
track length: 53.504
object, image height: [12.8163 21.614 ]
front, back focal length (from PP): [-58.0457  58.0457]
entry, exit pupil height: [20.6598 24.5107]
entry, exit pupil distance: [ 29.4064 -30.1401]
front, back focal distance: [-19.5144  38.7142]
front, back principal distance: [ 38.5313 -19.3315]
front, back nodal distance: [ 38.5313 -19.3315]
front, back numerical aperture: [0.     0.3354]
front, back f number: [1.4048 1.1841]
front, back working f number: [   inf 1.4911]
front, back airy radius: [   inf 0.0011]
transverse, angular magnification: [-0.      0.8429]

 # T      path         n   axial y  axial nu   chief y  chief nu
 0 S        20         1     20.66         0    -12.82    0.3726
 1 S        25     1.744     20.66   -0.2909    -10.95    0.5268
 2 S        31         1     19.66   -0.2271    -9.142    0.4971
 3 S      31.1     1.755     19.64   -0.5941    -9.092    0.6671
 4 S      37.1     1.487     17.61   -0.5809    -6.811     0.662
 5 S      38.6         1     17.02   -0.3854    -6.144    0.5914
 6 S      42.7     1.689     15.44   -0.4219    -3.717    0.6002
 7 S      44.2         1     15.06  -0.09401    -3.184    0.5309
 8 S      50.2         1      14.5  -0.09401 2.809e-15    0.5309
 9 S      56.2     1.728     13.94    0.2355     3.184    0.6062
10 S      57.9     1.883     14.17    0.1731     3.781    0.5895
11 S      64.9         1     14.81   0.07343     5.972    0.5493
12 S        65     1.883     14.82  -0.03671     6.027    0.5045
13 S        71     1.532      14.7   -0.1535     7.635    0.4439
14 S      72.5     1.744     14.55   -0.2233      8.07    0.4052
15 S      78.5         1     13.78    -0.356     9.463    0.3141
16 S     117.2         1   0.00889    -0.356     21.61    0.3141

 # T       SA3      CMA3      AST3      PTZ3      DIS3     TACHC      TCHC
 0 S         0         0         0         0         0         0         0
 1 S   -0.0399   -0.3827   0.03214   -0.6712    -0.373   -0.1954  -0.08262
 2 S  -0.07242    0.2343   -0.7581    0.1547     1.952  -0.06719    0.2174
 3 S   0.06316    0.0662   0.06937   -0.8859   -0.8557   -0.1175   -0.1232
 4 S   -0.4425    0.5528   -0.6905   0.02402    0.8325  -0.08919    0.1114
 5 S-0.0007522  -0.02096   -0.5842    0.6423     1.619  0.003567   0.09939
 6 S    0.5677   -0.9886     1.722   -0.1166    -2.795    0.1885   -0.3283
 7 S    0.1668    0.1877    0.2112     1.072     1.444    0.2116    0.2381
 8 S         0        -0         0         0         0        -0         0
 9 S     1.011   -0.7902    0.6177     1.138    -1.372    0.3167   -0.2476
10 S    -0.519    -0.441   -0.3747   -0.1126    -0.414    0.1214    0.1031
11 S 0.0007987  -0.01017    0.1296   -0.2973     2.136  -0.01896    0.2416
12 S  -0.06846   -0.2072   -0.6274   -0.3283    -2.893   -0.0951   -0.2879
13 S   -0.4989    0.1352  -0.03662   -0.2291   0.07198   -0.1208   0.03273
14 S  -0.02001  -0.04133  -0.08539   -0.1495   -0.4853  -0.02143  -0.04428
15 S  -0.02467     1.614    0.5234    -0.459    0.7336   -0.1781   0.06386
16 S         0        -0         0         0         0        -0         0
        0.1227  -0.09197    0.1481   -0.2186   -0.3981  -0.06191 -0.006173

Out[10]:
<rayopt.analysis.Analysis at 0x7fdb6c8a8be0>
In [ ]: