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 [19]:
# 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-Wakamiya-50mmf1.4-US4448497"
columns = "type distance roc diameter material"
text = """
O 20      0   100 AIR
S 5.0 78.360    76.0 1.79668/45.5
S 9.8837   469.477    76.0 AIR
S 0.1938 50.297 64.0 1.77279/49.4
S 9.1085 74.376  62.0 AIR
S 2.9457 138.143 60.0 1.6727/32.2
S 2.3256 34.326 51.0 AIR
A 16.0698  0   49.6 AIR
S 13.0 -34.407 48.8 1.74/28.3
S 1.938 -2906.977 57.0 1.77279/49.4
S 12.403 -59.047 60.0 AIR
S 0.3876 -150.890 66.8 1.78797/47.5
S 8.333 -57.890 67.8 AIR
S 0.1938 284.630 66.0 1.78797/47.5
S 5.0388 -253.217 66.0 AIR
I 74.1  0    86.53 AIR
"""
In [20]:
s = ro.system_from_text(text, columns.split(),
    description=description)
s.object.angle = np.deg2rad(20)
s.fields = 0, .7, 1.
#s.wavelengths = [587.5618e-9]
In [21]:
s.update()
print(s)
System: Doublegauss-Nikkor-Wakamiya-50mmf1.4-US4448497
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 20 deg
 Pupil:
   Pupil Distance: 54.9467
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 35.4158
Image:
 Radius: 43.3
 Update Radius: True
 Pupil:
   Pupil Distance: -132.271
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 46.8801
Stop: 7
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      78.36         76                 -   1.797   1.797   45.50
 2 S     9.8837      469.5         76         basic/air   1.000   1.000   89.30
 3 S     0.1938       50.3         64                 -   1.773   1.773   49.40
 4 S     9.1085      74.38         62         basic/air   1.000   1.000   89.30
 5 S     2.9457      138.1         60                 -   1.673   1.673   32.20
 6 S     2.3256      34.33         51         basic/air   1.000   1.000   89.30
 7 S      16.07        inf       49.6         basic/air   1.000   1.000   89.30
 8 S         13     -34.41       48.8                 -   1.740   1.740   28.30
 9 S      1.938      -2907         57                 -   1.773   1.773   49.40
10 S     12.403     -59.05         60         basic/air   1.000   1.000   89.30
11 S     0.3876     -150.9       66.8                 -   1.788   1.788   47.50
12 S      8.333     -57.89       67.8         basic/air   1.000   1.000   89.30
13 S     0.1938      284.6         66                 -   1.788   1.788   47.50
14 S     5.0388     -253.2         66         basic/air   1.000   1.000   89.30
15 S       74.1        inf      86.53         basic/air   1.000   1.000   89.30

In [22]:
ro.Analysis(s)
System: Doublegauss-Nikkor-Wakamiya-50mmf1.4-US4448497
Scale: 1.0 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 20 deg
 Pupil:
   Pupil Distance: 54.9467
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 35.4158
Image:
 Radius: 43.3
 Update Radius: True
 Pupil:
   Pupil Distance: -132.271
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 46.8801
Stop: 7
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      78.36         76                 -   1.797   1.797   45.50
 2 S     9.8837      469.5         76         basic/air   1.000   1.000   89.30
 3 S     0.1938       50.3         64                 -   1.773   1.773   49.40
 4 S     9.1085      74.38         62         basic/air   1.000   1.000   89.30
 5 S     2.9457      138.1         60                 -   1.673   1.673   32.20
 6 S     2.3256      34.33         51         basic/air   1.000   1.000   89.30
 7 S      16.07        inf       49.6         basic/air   1.000   1.000   89.30
 8 S         13     -34.41       48.8                 -   1.740   1.740   28.30
 9 S      1.938      -2907         57                 -   1.773   1.773   49.40
10 S     12.403     -59.05         60         basic/air   1.000   1.000   89.30
11 S     0.3876     -150.9       66.8                 -   1.788   1.788   47.50
12 S      8.333     -57.89       67.8         basic/air   1.000   1.000   89.30
13 S     0.1938      284.6         66                 -   1.788   1.788   47.50
14 S     5.0388     -253.2         66         basic/air   1.000   1.000   89.30
15 S     73.839        inf      86.53         basic/air   1.000   1.000   89.30

lagrange: -13.196
track length: 81.821
object, image height: [20.4675 37.2216]
front, back focal length (from PP): [-99.8556  99.8556]
entry, exit pupil height: [35.4158 46.8801]
entry, exit pupil distance: [ 49.9467 -58.1709]
front, back focal distance: [-25.4826  73.9882]
front, back principal distance: [ 74.373  -25.8675]
front, back nodal distance: [ 74.373  -25.8675]
front, back numerical aperture: [0.     0.3344]
front, back f number: [1.4098 1.065 ]
front, back working f number: [   inf 1.4958]
front, back airy radius: [   inf 0.0011]
transverse, angular magnification: [-0.      0.7555]

 # T      path         n   axial y  axial nu   chief y  chief nu
 0 S        20         1     35.42         0    -20.47    0.3726
 1 S        25     1.797     35.42   -0.3599     -18.6    0.5617
 2 S     34.88         1     33.44   -0.3032    -15.52    0.5354
 3 S     35.08     1.773     33.38   -0.8159    -15.41    0.7721
 4 S     44.19         1     29.19   -0.5127    -11.44    0.6532
 5 S     47.13     1.673     27.68   -0.6474    -9.521    0.6995
 6 S     49.46         1     26.78   -0.1229    -8.548    0.5321
 7 S     65.53         1      24.8   -0.1229 1.378e-15    0.5321
 8 S     78.53      1.74      23.2    0.3759     6.915    0.6808
 9 S     80.47     1.773     23.62    0.3762     7.674    0.6809
10 S     92.87         1     26.25    0.0327     12.44    0.5181
11 S     93.26     1.788     26.27    0.1698     12.64    0.5841
12 S     101.6         1     27.06   -0.1983     15.36    0.3751
13 S     101.8     1.788     27.02   -0.2731     15.43    0.3324
14 S     106.8         1     26.25   -0.3548     16.37    0.2815
15 S     180.9         1  -0.03239   -0.3548     37.22    0.2815

 # T       SA3      CMA3      AST3      PTZ3      DIS3     TACHC      TCHC
 0 S         0         0         0         0         0         0         0
 1 S    -1.138   -0.3402   -0.1017    -1.389   -0.4454   -0.4401   -0.1315
 2 S   -0.4861     1.053    -2.279    0.2318     4.433   -0.2132    0.4615
 3 S    0.2659    0.1688    0.1072    -2.127    -1.282   -0.2994   -0.1901
 4 S   -0.1504    0.6247    -2.594     1.438     4.801   -0.0873    0.3626
 5 S      1.07    -2.002     3.745   -0.7145    -5.668    0.3044   -0.5695
 6 S     1.771    0.7623    0.3282     2.875     1.379    0.6199    0.2669
 7 S         0        -0         0         0         0        -0         0
 8 S     5.141    -2.134    0.8859     3.034    -1.627    0.7842   -0.3255
 9 S  -0.01947  -0.03639  -0.06802  0.000898   -0.1255    0.1495    0.2795
10 S   -0.5469    0.4081   -0.3045    -1.812     1.579   -0.2691    0.2008
11 S   0.01514  -0.04651    0.1429    0.7168     -2.64   0.09718   -0.2985
12 S    -4.253    0.7006   -0.1154    -1.868    0.3269   -0.4713   0.07766
13 S   0.04595   -0.1908    0.7923     -0.38    -1.712   0.07308   -0.3035
14 S    -2.094    0.9904   -0.4684   -0.4272    0.4235   -0.3148    0.1489
15 S        -0         0        -0         0         0         0        -0
       -0.3793  -0.04215    0.0695    -0.421   -0.5584  -0.06707  -0.02076

Out[22]:
<rayopt.analysis.Analysis at 0x7fe3e0f717f0>
In [ ]: