In [28]:
%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
c:\software\python37\lib\site-packages\IPython\core\magics\pylab.py:160: UserWarning: pylab import has clobbered these variables: ['text']
`%matplotlib` prevents importing * from pylab and numpy
  "\n`%matplotlib` prevents importing * from pylab and numpy"
In [29]:
# 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.2  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 [30]:
s = ro.system_from_text(text, columns.split(),
    description=description, scale=0.5e-3)
s.object.angle = np.deg2rad(23)
s.fields = 0, .7, 1.
#s.wavelengths = [587.5618e-9]
In [31]:
s.update()
print(s)
System: Doublegauss-Nikkor-Wakamiya-50mmf1.4-US4448497
Scale: 0.5 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 23 deg
 Pupil:
   Pupil Distance: 54.9467
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 35.1302
Image:
 Radius: 43.3
 Update Radius: True
 Pupil:
   Pupil Distance: -132.271
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 46.502
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.2         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 [32]:
ro.Analysis(s)
System: Doublegauss-Nikkor-Wakamiya-50mmf1.4-US4448497
Scale: 0.5 mm
Wavelengths: 588, 656, 486 nm
Fields: 0, 0.7, 1
Object:
 Semi-Angle: 23 deg
 Pupil:
   Pupil Distance: 54.9467
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 35.1302
Image:
 Radius: 43.3
 Update Radius: True
 Pupil:
   Pupil Distance: -132.271
   Refractive Index: 1.00028
   Update Radius: True
   Radius: 46.502
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.2         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.837        inf      86.53         basic/air   1.000   1.000   89.30

lagrange: -15.401
track length: 81.821
object, image height: [24.0826 43.7959]
front, back focal length (from PP): [-99.8556  99.8556]
entry, exit pupil height: [35.1302 46.502 ]
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.332]
front, back f number: [1.4212 1.0737]
front, back working f number: [   inf 1.5066]
front, back airy radius: [   inf 0.0022]
transverse, angular magnification: [-0.      0.7555]

 # T      path         n   axial y  axial nu   chief y  chief nu
 0 S        20         1     35.13         0    -24.08    0.4384
 1 S        25     1.797     35.13    -0.357    -21.89    0.6609
 2 S     34.88         1     33.17   -0.3008    -18.26    0.6299
 3 S     35.08     1.773     33.11   -0.8093    -18.13    0.9084
 4 S     44.19         1     28.95   -0.5086    -13.47    0.7686
 5 S     47.13     1.673     27.45   -0.6422     -11.2    0.8231
 6 S     49.46         1     26.56   -0.1219    -10.06    0.6261
 7 S     65.53         1      24.6   -0.1219 1.168e-14    0.6261
 8 S     78.53      1.74     23.02    0.3729     8.137     0.801
 9 S     80.47     1.773     23.43    0.3731     9.029    0.8011
10 S     92.87         1     26.04   0.03243     14.63    0.6097
11 S     93.26     1.788     26.05    0.1684     14.87    0.6873
12 S     101.6         1     26.84   -0.1967     18.07    0.4414
13 S     101.8     1.788      26.8   -0.2709     18.16    0.3911
14 S     106.8         1     26.04   -0.3519     19.26    0.3312
15 S     180.9         1  -0.03213   -0.3519      43.8    0.3312

 # T       SA3      CMA3      AST3      PTZ3      DIS3     TACHC      TCHC
 0 S         0         0         0         0         0         0         0
 1 S    -1.111   -0.3938   -0.1396    -1.907   -0.7256   -0.4366   -0.1548
 2 S   -0.4745     1.219     -3.13    0.3183     7.221   -0.2114    0.5431
 3 S    0.2596    0.1954    0.1472    -2.921    -2.089    -0.297   -0.2237
 4 S   -0.1468    0.7232    -3.563     1.975     7.821   -0.0866    0.4266
 5 S     1.044    -2.318     5.142   -0.9812    -9.234     0.302   -0.6701
 6 S     1.728    0.8826    0.4507     3.949     2.247    0.6149     0.314
 7 S         0        -0         0         0         0        -0         0
 8 S     5.017    -2.471     1.217     4.166    -2.651    0.7778    -0.383
 9 S    -0.019  -0.04213  -0.09341  0.001233   -0.2044    0.1483    0.3288
10 S   -0.5338    0.4725   -0.4182    -2.488     2.573    -0.267    0.2363
11 S   0.01478  -0.05385    0.1962    0.9844    -4.301   0.09639   -0.3512
12 S     -4.15    0.8112   -0.1585    -2.566    0.5325   -0.4675   0.09137
13 S   0.04485   -0.2209     1.088   -0.5219    -2.789   0.07249   -0.3571
14 S    -2.044     1.147   -0.6432   -0.5866    0.6899   -0.3123    0.1752
15 S        -0         0        -0         0         0         0        -0
       -0.3702   -0.0488   0.09545   -0.5782   -0.9096  -0.06652  -0.02442

Out[32]:
<rayopt.analysis.Analysis at 0x155ec121208>
In [ ]: