%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
# 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"
# Following uses Hikari glass types where possible
# The aspherical elements do not appear to have a good match
# probably because they have molded plastic?
# There is also a discrepancy in the element with
# index 1.883 - the catalog lists vd as 40.69
#
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 J-LASKH2
S 6.0 354.9744 39.6 J-FK5
S 1.5 42.4134 35.1 AIR
S 4.1038 290.8467 34.0 J-SF8
S 1.5 31.6359 33.0 AIR
A 6.0 0 28.4 AIR
S 6.0 -30.7873 30.0 J-SF10
S 1.7 35.1427 33.5 J-LASF08A
S 7.0 -131.1407 33.5 AIR
S 0.1 118.7661 33.8 J-LASF08A
S 6.0 -44.2318 33.8 J-LLF6
S 1.5 44.2683 33.8 1.74443/49.53
S 6.0 -77.2943 33.8 AIR
I 38.7 0 42.42 AIR
"""
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 28.4 AIR
S 6.0 -30.7873 30.0 1.72825/28.46
S 1.7 35.1427 33.5 1.883/40.77
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.74443/49.53
S 6.0 -77.2943 33.8 AIR
I 38.7 0 42.42 AIR
"""
s = ro.system_from_text(text, columns.split(),
description=description)
s.object.angle = np.deg2rad(20.0)
# κ A4 A6 A8 A10
# 1st surface 0.5721 1.10084E-07 6.21998E-10 -4.25694E-13 0.00000E+00
# κ A4 A6 A8 A10
# 15th 14.1597 8.65514E-06 4.15194E-09 1.25812E-11 1.22728E-14
## 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.15194E-09, 1.25812E-11, 1.22728E-14]
s.fields = 0, .7, 1.
#s.wavelengths = [587.5618e-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.2324 Image: Radius: 21.2 Update Radius: True Pupil: Pupil Distance: -68.8432 Refractive Index: 1.00028 Update Radius: True Radius: 24.0065 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 28.4 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.77 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
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.2324 Image: Radius: 21.2 Update Radius: True Pupil: Pupil Distance: -68.8432 Refractive Index: 1.00028 Update Radius: True Radius: 24.0065 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 28.4 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.77 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.722 inf 42.42 basic/air 1.000 1.000 89.30 lagrange: -7.5386 track length: 53.504 object, image height: [12.8163 21.6123] front, back focal length (from PP): [-58.0351 58.0351] entry, exit pupil height: [20.2324 24.0065] entry, exit pupil distance: [ 29.4064 -30.1432] front, back focal distance: [-19.4996 38.7069] front, back principal distance: [ 38.5355 -19.3282] front, back nodal distance: [ 38.5355 -19.3282] front, back numerical aperture: [0. 0.3293] front, back f number: [1.4342 1.2087] front, back working f number: [ inf 1.5189] front, back airy radius: [ inf 0.0011] transverse, angular magnification: [-0. 0.8428] # T path n axial y axial nu chief y chief nu 0 S 20 1 20.23 0 -12.82 0.3726 1 S 25 1.744 20.23 -0.2848 -10.95 0.5268 2 S 31 1 19.25 -0.2224 -9.142 0.4971 3 S 31.1 1.755 19.23 -0.5819 -9.092 0.6671 4 S 37.1 1.487 17.24 -0.5689 -6.811 0.662 5 S 38.6 1 16.67 -0.3774 -6.144 0.5914 6 S 42.7 1.689 15.12 -0.4132 -3.717 0.6002 7 S 44.2 1 14.75 -0.09207 -3.184 0.5309 8 S 50.2 1 14.2 -0.09207 2.809e-15 0.5309 9 S 56.2 1.728 13.65 0.2306 3.184 0.6062 10 S 57.9 1.883 13.87 0.1695 3.781 0.5895 11 S 64.9 1 14.5 0.07191 5.972 0.5493 12 S 65 1.883 14.51 -0.03595 6.027 0.5045 13 S 71 1.532 14.4 -0.1503 7.635 0.4439 14 S 72.5 1.744 14.25 -0.2188 8.07 0.4051 15 S 78.5 1 13.5 -0.3487 9.463 0.314 16 S 117.2 1 0.006154 -0.3487 21.61 0.314 # T SA3 CMA3 AST3 PTZ3 DIS3 TACHC TCHC 0 S 0 0 0 0 0 0 0 1 S -0.03747 -0.367 0.03148 -0.6573 -0.373 -0.1913 -0.08262 2 S -0.06801 0.2247 -0.7424 0.1515 1.952 -0.0658 0.2174 3 S 0.05932 0.06348 0.06793 -0.8675 -0.8556 -0.1151 -0.1232 4 S -0.4156 0.5301 -0.6762 0.02352 0.8325 -0.08734 0.1114 5 S-0.0007064 -0.0201 -0.572 0.6289 1.619 0.003492 0.09938 6 S 0.5332 -0.948 1.686 -0.1142 -2.795 0.1846 -0.3282 7 S 0.1566 0.18 0.2068 1.05 1.444 0.2072 0.2381 8 S 0 -0 0 0 0 -0 0 9 S 0.9493 -0.7578 0.6049 1.114 -1.372 0.3101 -0.2476 10 S -0.4874 -0.4229 -0.3669 -0.1102 -0.414 0.12 0.1041 11 S 0.0007501 -0.009757 0.1269 -0.2911 2.136 -0.01852 0.2409 12 S -0.06429 -0.1987 -0.6143 -0.3215 -2.893 -0.09312 -0.2879 13 S -0.4685 0.1296 -0.03586 -0.2243 0.07198 -0.1183 0.03273 14 S -0.0188 -0.03965 -0.08365 -0.1465 -0.4855 -0.021 -0.0443 15 S -0.02361 1.548 0.5127 -0.4495 0.7335 -0.1744 0.06385 16 S 0 -0 0 0 0 -0 0 0.1147 -0.088 0.1451 -0.2142 -0.3984 -0.0595 -0.005875
<rayopt.analysis.Analysis at 0x7f5fc7bd3780>