%pylab inline
import numpy as np
import matplotlib.pyplot as plt
from rayopt import (system_from_text, Analysis, GeometricTrace,
FiniteConjugate, ParaxialTrace, system_from_yaml,
system_to_yaml, material)
np.set_printoptions(precision=5)
Populating the interactive namespace from numpy and matplotlib
#http://www23.ipdl.inpit.go.jp/PDF/display/JPA_2004252119.pdf?id=3157&N0005=Gi2hcLBJttACDHWHBtdb&N0000=2010
data = """
0 0 55.220116 vacuum
1 0 22 1.560326
2 217.81507 41.369924 vacuum
3 -110.20051 28.395633 1.560326
4 -534.64554 1 vacuum
5 -1154.39307 36.204587 1.560326
6 -245.0683 1 vacuum
7 -1205.19394 31.003215 1.560326
8 -304.03524 1 vacuum
9 178223 33.134122 1.560326
10 -401.85185 1 vacuum
11 417.31243 33.242793 1.560326
12 367146 1.408409 vacuum
13 207.84791 32.000971 1.560326
14 350.13557 56.711517 vacuum
15 278.75361 28 1.560326
16 1904.04591 1.044627 vacuum
17 384.97401 45 1.560326
18 133.57481 11.656644 vacuum
19 197.26967 28 1.560326
20 128.99066 14.928217 vacuum
21 298.51649 26.680522 1.560326
22 176.6658 40.173261 vacuum
23 -132.85744 14 1.560326
24 237.43968 34.261836 vacuum
25 -151.41779 17.028254 1.560326
26 -701.12574 1.001519 vacuum
27 1005.39892 46.42613 1.560326
28 -211.68827 1 vacuum
29 -198734.9274 24 1.560326
30 1671.38643 16.227509 vacuum
31 -2955.04842 43.469645 1.560326
32 -250.70248 1 vacuum
33 264.25831 47.031538 1.560326
34 1783.1703 20.61046 vacuum
35 0 25.289518 vacuum
36 -937.67133 30 1.560326
37 283.72819 15.677718 vacuum
38 438.86854 38.67981 1.560326
39 -2259.35066 17.354437 vacuum
40 -754.04899 37.299609 1.560326
41 -285.86973 1 vacuum
42 256.17897 49.953643 1.560326
43 1532.85523 1 vacuum
44 186.621 36.602206 1.560326
45 305.34179 1 vacuum
46 149.991 51.987691 1.560326
47 399.2913 1.677104 vacuum
48 231.30867 42.004997 1.501455
49 299.00944 8.301104 vacuum
50 2955.5 45.45 1.501455
51 0 10.491218 vacuum
52 0 0 vacuum
"""
columns = "num roc distance material"
s = system_from_text(data, columns.split(),
shifts={"distance": 1}, wavelengths=[193.306e-9],
description="NA=0.85 yi=13.8mm, λ=193nm (ArF) JP-2004-252119(A)",
object=FiniteConjugate(radius=13.8*4, pupil=dict(
type="na", na=.85/4, telecentric=True, aim=False)))
s[2].aspherics = [0, -1.1125e-7, 3.34964e-12, -1.42684e-16,
3.9882e-21, 8.17347e-25, -6.87665e-29]
s[5].aspherics = [0, 5.34237e-9, -9.72667e-14, -5.84808e-18,
2.99174e-22, 1.01762e-26, -6.74726e-31]
s[16].aspherics = [0, 6.19191e-8, -1.21235e-12, 6.91135e-17,
-2.36561e-21, 9.73120e-26, -7.46736e-31]
s[22].aspherics = [0, -9.31073e-8, 1.78564e-12, -2.04348e-16,
2.06669e-21, -9.25172e-27, -1.78357e-28]
s[25].aspherics = [0, 3.05599e-8, 1.37059e-12, 5.03086e-17,
6.8284e-21, -1.43214e-25, 8.69884e-29]
s[30].aspherics = [0, 4.18743e-8, -3.11379e-13, -8.18948e-18,
2.43208e-22, -9.63937e-29, -6.69019e-32]
s[47].aspherics = [0, 4.47622e-9, 1.15439e-13, -1.90126e-17,
8.91857e-22, -3.27673e-26, 8.56793e-31]
s.stop = 35
s[s.stop].radius = 180.6/2*1.35
s[0].radius = s.object.radius
s[0].distance = 0
s.update()
s.paraxial.resize()
g = GeometricTrace(s)
g.rays_clipping((0, 1))
fig, ax = plt.subplots(figsize=(20, 8))
s.plot(ax)
g.plot(ax)
print(s)
#print(system_to_yaml(s))
System: NA=0.85 yi=13.8mm, λ=193nm (ArF) JP-2004-252119(A) Scale: 1.0 mm Wavelengths: 193 nm Fields: 0, 0.7, 1 Object: Radius: 55.2 Pupil: Pupil Distance: 2423.12 Telecentric: True NA: 0.2125 Image: Radius: 0 Update Radius: True Pupil: Pupil Distance: 2758.92 Update Radius: True Radius: -2426.48 Stop: 35 Elements: # T Distance Rad Curv Diameter Material n nd Vd 0 S 0 inf 110.4 basic/vacuum 1.000 1.000 inf 1 S 55.22 inf 131.9 - 1.560 1.560 inf 2 S 22 217.8 137.39 basic/vacuum 1.000 1.000 inf 3 S 41.37 -110.2 168.12 - 1.560 1.560 inf 4 S 28.396 -534.6 197.2 basic/vacuum 1.000 1.000 inf 5 S 1 -1154 198.59 - 1.560 1.560 inf 6 S 36.205 -245.1 233.1 basic/vacuum 1.000 1.000 inf 7 S 1 -1205 234.05 - 1.560 1.560 inf 8 S 31.003 -304 255.18 basic/vacuum 1.000 1.000 inf 9 S 1 1.782e+05 255.77 - 1.560 1.560 inf 10 S 33.134 -401.9 268.35 basic/vacuum 1.000 1.000 inf 11 S 1 417.3 268.56 - 1.560 1.560 inf 12 S 33.243 3.671e+05 265.52 basic/vacuum 1.000 1.000 inf 13 S 1.4084 207.8 265.32 - 1.560 1.560 inf 14 S 32.001 350.1 247.74 basic/vacuum 1.000 1.000 inf 15 S 56.712 278.8 221.59 - 1.560 1.560 inf 16 S 28 1904 205.32 basic/vacuum 1.000 1.000 inf 17 S 1.0446 385 204.44 - 1.560 1.560 inf 18 S 45 133.6 171.46 basic/vacuum 1.000 1.000 inf 19 S 11.657 197.3 166.51 - 1.560 1.560 inf 20 S 28 129 150.41 basic/vacuum 1.000 1.000 inf 21 S 14.928 298.5 146.77 - 1.560 1.560 inf 22 S 26.681 176.7 137.89 basic/vacuum 1.000 1.000 inf 23 S 40.173 -132.9 134.59 - 1.560 1.560 inf 24 S 14 237.4 138.94 basic/vacuum 1.000 1.000 inf 25 S 34.262 -151.4 166.81 - 1.560 1.560 inf 26 S 17.028 -701.1 182.42 basic/vacuum 1.000 1.000 inf 27 S 1.0015 1005 183.71 - 1.560 1.560 inf 28 S 46.426 -211.7 218.89 basic/vacuum 1.000 1.000 inf 29 S 1 -1.987e+05 219.5 - 1.560 1.560 inf 30 S 24 1671 228.78 basic/vacuum 1.000 1.000 inf 31 S 16.228 -2955 239.82 - 1.560 1.560 inf 32 S 43.47 -250.7 260.05 basic/vacuum 1.000 1.000 inf 33 S 1 264.3 260.19 - 1.560 1.560 inf 34 S 47.032 1783 247.92 basic/vacuum 1.000 1.000 inf 35 S 20.61 inf 241.14 basic/vacuum 1.000 1.000 inf 36 S 25.29 -937.7 242.89 - 1.560 1.560 inf 37 S 30 283.7 247.01 basic/vacuum 1.000 1.000 inf 38 S 15.678 438.9 258.01 - 1.560 1.560 inf 39 S 38.68 -2259 267.25 basic/vacuum 1.000 1.000 inf 40 S 17.354 -754 272.57 - 1.560 1.560 inf 41 S 37.3 -285.9 284.73 basic/vacuum 1.000 1.000 inf 42 S 1 256.2 284.68 - 1.560 1.560 inf 43 S 49.954 1533 263.18 basic/vacuum 1.000 1.000 inf 44 S 1 186.6 262.6 - 1.560 1.560 inf 45 S 36.602 305.3 230.6 basic/vacuum 1.000 1.000 inf 46 S 1 150 229.66 - 1.560 1.560 inf 47 S 51.988 399.3 169.72 basic/vacuum 1.000 1.000 inf 48 S 1.6771 231.3 167.11 - 1.501 1.501 inf 49 S 42.005 299 113.31 basic/vacuum 1.000 1.000 inf 50 S 8.3011 2956 98.923 - 1.501 1.501 inf 51 S 45.45 inf 45.957 basic/vacuum 1.000 1.000 inf 52 S 10.491 inf 27.6 basic/vacuum 1.000 1.000 inf
a = Analysis(s)
/home/rj/work/nist/pyrayopt/rayopt/elements.py:208: RuntimeWarning: invalid value encountered in less_equal good = np.square(y[:, :2]).sum(1) <= self.radius**2
System: NA=0.85 yi=13.8mm, λ=193nm (ArF) JP-2004-252119(A) Scale: 1.0 mm Wavelengths: 193 nm Fields: 0, 0.7, 1 Object: Radius: 55.2 Pupil: Pupil Distance: 2423.12 Telecentric: True NA: 0.2125 Image: Radius: 13.8 Update Radius: True Pupil: Pupil Distance: 2758.92 Update Radius: True Radius: -2399.89 Stop: 35 Elements: # T Distance Rad Curv Diameter Material n nd Vd 0 S 0 inf 110.4 basic/vacuum 1.000 1.000 inf 1 S 55.22 inf 131.9 - 1.560 1.560 inf 2 S 22 217.8 137.39 basic/vacuum 1.000 1.000 inf 3 S 41.37 -110.2 168.12 - 1.560 1.560 inf 4 S 28.396 -534.6 197.2 basic/vacuum 1.000 1.000 inf 5 S 1 -1154 198.59 - 1.560 1.560 inf 6 S 36.205 -245.1 233.1 basic/vacuum 1.000 1.000 inf 7 S 1 -1205 234.05 - 1.560 1.560 inf 8 S 31.003 -304 255.18 basic/vacuum 1.000 1.000 inf 9 S 1 1.782e+05 255.77 - 1.560 1.560 inf 10 S 33.134 -401.9 268.35 basic/vacuum 1.000 1.000 inf 11 S 1 417.3 268.56 - 1.560 1.560 inf 12 S 33.243 3.671e+05 265.52 basic/vacuum 1.000 1.000 inf 13 S 1.4084 207.8 265.32 - 1.560 1.560 inf 14 S 32.001 350.1 247.74 basic/vacuum 1.000 1.000 inf 15 S 56.712 278.8 221.59 - 1.560 1.560 inf 16 S 28 1904 205.32 basic/vacuum 1.000 1.000 inf 17 S 1.0446 385 204.44 - 1.560 1.560 inf 18 S 45 133.6 171.46 basic/vacuum 1.000 1.000 inf 19 S 11.657 197.3 166.51 - 1.560 1.560 inf 20 S 28 129 150.41 basic/vacuum 1.000 1.000 inf 21 S 14.928 298.5 146.77 - 1.560 1.560 inf 22 S 26.681 176.7 137.89 basic/vacuum 1.000 1.000 inf 23 S 40.173 -132.9 134.59 - 1.560 1.560 inf 24 S 14 237.4 138.94 basic/vacuum 1.000 1.000 inf 25 S 34.262 -151.4 166.81 - 1.560 1.560 inf 26 S 17.028 -701.1 182.42 basic/vacuum 1.000 1.000 inf 27 S 1.0015 1005 183.71 - 1.560 1.560 inf 28 S 46.426 -211.7 218.89 basic/vacuum 1.000 1.000 inf 29 S 1 -1.987e+05 219.5 - 1.560 1.560 inf 30 S 24 1671 228.78 basic/vacuum 1.000 1.000 inf 31 S 16.228 -2955 239.82 - 1.560 1.560 inf 32 S 43.47 -250.7 260.05 basic/vacuum 1.000 1.000 inf 33 S 1 264.3 260.19 - 1.560 1.560 inf 34 S 47.032 1783 247.92 basic/vacuum 1.000 1.000 inf 35 S 20.61 inf 241.14 basic/vacuum 1.000 1.000 inf 36 S 25.29 -937.7 242.89 - 1.560 1.560 inf 37 S 30 283.7 247.01 basic/vacuum 1.000 1.000 inf 38 S 15.678 438.9 258.01 - 1.560 1.560 inf 39 S 38.68 -2259 267.25 basic/vacuum 1.000 1.000 inf 40 S 17.354 -754 272.57 - 1.560 1.560 inf 41 S 37.3 -285.9 284.73 basic/vacuum 1.000 1.000 inf 42 S 1 256.2 284.68 - 1.560 1.560 inf 43 S 49.954 1533 263.18 basic/vacuum 1.000 1.000 inf 44 S 1 186.6 262.6 - 1.560 1.560 inf 45 S 36.602 305.3 230.6 basic/vacuum 1.000 1.000 inf 46 S 1 150 229.66 - 1.560 1.560 inf 47 S 51.988 399.3 169.72 basic/vacuum 1.000 1.000 inf 48 S 1.6771 231.3 167.11 - 1.501 1.501 inf 49 S 42.005 299 113.31 basic/vacuum 1.000 1.000 inf 50 S 8.3011 2956 98.923 - 1.501 1.501 inf 51 S 45.45 inf 45.957 basic/vacuum 1.000 1.000 inf 52 S 10.491 inf 27.6 basic/vacuum 1.000 1.000 inf lagrange: -12.004 track length: 1184.3 object, image height: [ 55.2 13.79998] front, back focal length (from PP): [-640.96234 640.96234] entry, exit pupil height: [ 526.94724 2399.89414] entry, exit pupil distance: [ 2367.89673 2769.40798] front, back focal distance: [ 2508.63349 -149.74907] front, back principal distance: [ 3149.59583 -790.7114 ] front, back nodal distance: [ 3149.59583 -790.7114 ] front, back numerical aperture: [ 0.2125 0.85 ] front, back f number: [ 0.60818 0.13354] front, back working f number: [ 2.35294 0.58823] front, back airy radius: [ 0.00055 0.00014] transverse, angular magnification: [-0.25 -0.21957] # T path n axial y axial nu chief y chief nu 0 S 0 1 0 0.2175 -55.2 0.02278 1 S 55.22 1.56 12.01 0.2175 -53.94 0.02278 2 S 77.22 1 15.07 0.2562 -53.62 -0.1152 3 S 118.6 1.56 25.68 0.3868 -58.38 -0.412 4 S 147 1 32.71 0.3525 -65.88 -0.343 5 S 148 1.56 33.07 0.3686 -66.23 -0.3751 6 S 184.2 1 41.62 0.2734 -74.93 -0.2038 7 S 185.2 1.56 41.89 0.2929 -75.13 -0.2387 8 S 216.2 1 47.71 0.2049 -79.88 -0.09152 9 S 217.2 1.56 47.92 0.2048 -79.97 -0.09127 10 S 250.3 1 52.27 0.1319 -81.91 0.02294 11 S 251.3 1.56 52.4 0.06157 -81.88 0.1329 12 S 284.6 1 53.71 0.06165 -79.05 0.1328 13 S 286 1.56 53.8 -0.08338 -78.87 0.3454 14 S 318 1 52.09-2.434e-05 -71.78 0.2305 15 S 374.7 1.56 52.08 -0.1047 -58.71 0.3485 16 S 402.7 1 50.21 -0.08995 -52.46 0.3331 17 S 403.7 1.56 50.11 -0.1629 -52.11 0.4089 18 S 448.7 1 45.41 0.02762 -40.32 0.2398 19 S 460.4 1.56 45.74 -0.1023 -37.52 0.3464 20 S 488.4 1 43.9 0.08841 -31.3 0.2104 21 S 503.3 1.56 45.22 0.003533 -28.16 0.2633 22 S 530 1 45.28 0.1471 -23.66 0.1882 23 S 570.2 1.56 51.19 0.3631 -16.1 0.1203 24 S 584.2 1 54.45 0.4915 -15.02 0.08486 25 S 618.4 1.56 71.29 0.7554 -12.11 0.04003 26 S 635.5 1 79.53 0.6918 -11.68 0.04936 27 S 636.5 1.56 80.23 0.6471 -11.63 0.05584 28 S 682.9 1 99.48 0.3838 -9.966 0.08222 29 S 683.9 1.56 99.86 0.384 -9.884 0.08219 30 S 707.9 1 105.8 0.4195 -8.619 0.0793 31 S 724.1 1.56 112.6 0.4409 -7.333 0.07791 32 S 767.6 1 124.9 0.1618 -5.162 0.08945 33 S 768.6 1.56 125 -0.1033 -5.072 0.1002 34 S 815.6 1 121.9 -0.065 -2.052 0.09956 35 S 836.2 1 120.6 -0.065-8.749e-14 0.09956 36 S 861.5 1.56 118.9 0.006066 2.518 0.1011 37 S 891.5 1 119 0.2412 4.461 0.1099 38 S 907.2 1.56 122.8 0.08434 6.184 0.102 39 S 945.9 1 124.9 0.05337 8.712 0.09982 40 S 963.2 1.56 125.8 0.1469 10.44 0.1076 41 S 1001 1 129.4 -0.1067 13.02 0.08207 42 S 1002 1.56 129.2 -0.3894 13.1 0.05342 43 S 1051 1 116.8 -0.3467 14.81 0.05883 44 S 1052 1.56 116.4 -0.6963 14.87 0.0142 45 S 1089 1 100.1 -0.5126 15.2 0.04209 46 S 1090 1.56 99.59 -0.8846 15.24 -0.01485 47 S 1142 1 70.11 -0.7862 14.75 0.005844 48 S 1144 1.501 68.8 -0.9353 14.76 -0.02615 49 S 1186 1 42.63 -0.8639 14.03 -0.002626 50 S 1194 1.501 35.46 -0.8699 14 -0.005002 51 S 1240 1 9.126 -0.8699 13.85 -0.005002 52 S 1250 1 3.025e-05 -0.8699 13.8 -0.005002 # T SA3 CMA3 AST3 PTZ3 DIS3 TACHC TCHC 0 S 0 0 0 0 0 0 0 1 S -0.04183 -0.004382 -0.000459 -0-4.808e-05 0 0 2 S 0.1384 -0.1174 0.001554 0.1366 0.3049 0 -0 3 S-0.0007772 -0.01386 -0.2471 0.2699 0.4071 0 0 4 S 0.309 -0.2331 0.1758 -0.05563 -0.09067 0 -0 5 S -0.4174 0.3866 -0.3778 0.02577 0.3845 0 -0 6 S 0.03132 0.03082 0.03034 -0.1214 -0.0896 0 0 7 S -0.21 0.1245 -0.07377 0.02468 0.0291 0 -0 8 S 0.005353 0.01909 0.06805 -0.09783 -0.1062 0 0 9 S -0.1402 0.06281 -0.02815-0.0001669 0.01269 0 -0 10 S 4.958e-06 0.0006051 0.07384 -0.07402 -0.02118 0 0 11 S -0.2129 0.1433 -0.09643 -0.07128 0.1129 0 -0 12 S 0.004286 0.009194 0.01972 8.102e-05 0.04248 0 0 13 S -0.3045 0.2344 -0.1804 -0.1431 0.249 0 -0 14 S 0.02267 0.003884 0.0006656 0.08495 0.01467 0 0 15 S -0.04492 -0.004781-0.0005088 -0.1067 -0.01141 0 0 16 S 1.008 -1.033 0.9801 0.01562 -0.6237 -0 0 17 S 0.001074 0.005279 0.02595 -0.07726 -0.2522 0 0 18 S 0.3335 -0.05625 0.009488 0.2227 -0.03916 0 -0 19 S -0.1232 -0.02356 -0.004506 -0.1508 -0.02969 0 0 20 S 0.605 -0.04556 0.003432 0.2306 -0.01762 0 -0 21 S -0.1301 -0.06293 -0.03044 -0.09964 -0.06293 0 0 22 S -0.3913 0.6101 -0.2642 0.1684 0.1681 0 0 23 S 0.003291 -0.004275 0.005554 0.2239 -0.2981 -0 0 24 S 5.569 0.1668 0.004998 0.1253 0.003902 0 0 25 S -2.037 0.3202 -0.2606 0.1964 -0.03354 0 0 26 S 5.835 0.666 0.07602 -0.04242 0.003835 0 0 27 S -11.7 -0.5729 -0.02807 -0.02958 -0.002824 0 0 28 S 0.0501 -0.07517 0.1128 -0.1405 0.04159 -0 0 29 S -1.906 -0.4091 -0.08782 0.0001497 -0.01882 0 0 30 S 17.21 -0.5308 0.1772 0.0178 0.008863 0 0 31 S -2.245 -0.4813 -0.1032 0.01007 -0.01997 0 0 32 S -0.1565 0.05123 -0.01677 -0.1186 0.04431 -0 0 33 S -5.916 -0.6546 -0.07244 -0.1126 -0.02047 0 0 34 S-1.791e-05-0.0005238 -0.01532 0.01668 0.03992 0 0 35 S 0 0 0 0 0 -0 0 36 S 0.1698 -0.08574 0.0433 0.03172 -0.03789 -0 0 37 S 7.129 1.355 0.2576 0.1048 0.0689 0 0 38 S -3.958 -0.9417 -0.2241 -0.06778 -0.06944 0 0 39 S 4.968e-06 -0.000248 0.01238 -0.01317 0.03922 -0 0 40 S 0.00649 -0.004915 0.003722 0.03945 -0.03269 -0 0 41 S -3.882 0.2537 -0.01658 -0.104 0.007883 -0 0 42 S -0.6263 -0.2097 -0.0702 -0.1161 -0.06238 0 0 43 S -0.917 0.2322 -0.05881 0.0194 0.009979 -0 0 44 S 0.3122 0.1559 0.0779 -0.1594 -0.04071 0 0 45 S -0.4449 0.2213 -0.11 0.09741 0.006276 -0 0 46 S 0.1958 0.1858 0.1764 -0.1983 -0.02078 0 0 47 S -6.075 0.5038 -0.01886 0.07449-0.0004404 -0 0 48 S 3.508 -0.4998 0.07121 -0.1196 0.006894 -0 0 49 S -5.723 0.3514 -0.02157 0.09252 -0.004355 -0 0 50 S 7.069 -0.01753 4.347e-05 -0.00936 2.31e-05 -0 0 51 S -1.921 -0.01105-6.352e-05 0-3.653e-07 -0 -0 52 S 0 0 0 0 0 -0 -0 0.0002152 4.861e-05-0.0001148 6.336e-05 0.0002317 0 0
s.paraxial.number_of_points/1e15
15.425279333239747