import numpy as np
import matplotlib.pyplot as plt
from rayopt import *
np.set_printoptions(precision=3)
%pylab inline
Populating the interactive namespace from numpy and matplotlib
s = system_from_yaml("""
description: three lens monochromatic focusing f/1 50mm
stop: 2
wavelengths: [550.0e-9]
object: {angle_deg: 0.02, pupil: {radius: 25}}
elements:
- {material: air, radius: 25}
- {material: SCHOTT/N-BK7, roc: 94.28602, distance: 10, radius: 25}
- {material: air, roc: -392.8918, distance: 8, radius: 25}
- {material: SCHOTT/N-BK7, roc: 43.81682, distance: 6.456843, radius: 23}
- {material: air, roc: 143.1817, distance: 8, radius: 22}
- {material: SCHOTT/N-BK7, roc: 26.17266, distance: 0.1169485, radius: 19}
- {material: air, roc: 33.70628, distance: 5, radius: 18, conic: 0.2594713}
- {material: air, distance: 36.45994, radius: 1}
""")
s.update()
a = Analysis(s)
/home/rj/work/nist/pyrayopt/rayopt/paraxial_trace.py:186: RuntimeWarning: divide by zero encountered in true_divide return self.n[(0, -2), ]/(2*na) /home/rj/work/nist/pyrayopt/rayopt/paraxial_trace.py:191: RuntimeWarning: divide by zero encountered in true_divide return 1.22*self.wavelength/(2*na)/self.system.scale /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: three lens monochromatic focusing f/1 50mm Scale: 1.0 mm Wavelengths: 550 nm Fields: 0, 0.7, 1 Object: Semi-Angle: 0.02 deg Pupil: Pupil Distance: 15.4269 Refractive Index: 1.00028 Radius: 25 Image: Radius: 1 Update Radius: True Pupil: Pupil Distance: -51.0369 Refractive Index: 1.00028 Update Radius: True Radius: 26.2771 Stop: 2 Elements: # T Distance Rad Curv Diameter Material n nd Vd 0 S 0 inf 50 basic/air 1.000 1.000 89.30 1 S 10 94.29 50 SCHOTT/N-BK7 1.519 1.517 64.17 2 S 8 -392.9 50 basic/air 1.000 1.000 89.30 3 S 6.4568 43.82 46 SCHOTT/N-BK7 1.519 1.517 64.17 4 S 8 143.2 44 basic/air 1.000 1.000 89.30 5 S 0.11695 26.17 38 SCHOTT/N-BK7 1.519 1.517 64.17 6 S 5 33.71 36 basic/air 1.000 1.000 89.30 7 S 36.497 inf 2 basic/air 1.000 1.000 89.30 lagrange: -0.0087291 track length: 27.574 object, image height: [ 0.005 0.017] front, back focal length (from PP): [-50.041 50.041] entry, exit pupil height: [ 25. 25.516] entry, exit pupil distance: [ 5.427 -14.577] front, back focal distance: [-43.59 36.487] front, back principal distance: [ 6.451 -13.554] front, back nodal distance: [ 6.451 -13.554] front, back numerical aperture: [ 0. 0.447] front, back f number: [ 1.001 0.981] front, back working f number: [ inf 1.119] front, back airy radius: [ inf 0.001] transverse, angular magnification: [-0. 0.98] # T path n axial y axial nu chief y chief nu 0 S 0 1 25 0 -0.005385 0.0003492 1 S 10 1.519 25 -0.1374 -0.001894 0.0003596 2 S 18 1 24.28 -0.1694 2.168e-19 0.0003596 3 S 24.46 1.519 23.18 -0.4436 0.002321 0.0003321 4 S 32.46 1 20.85 -0.3682 0.004071 0.0003469 5 S 32.57 1.519 20.8 -0.7801 0.004111 0.0002654 6 S 37.57 1 18.23 -0.4997 0.004985 0.0003421 7 S 74.03 1 0.01853 -0.4997 0.01745 0.0003421 # T SA3 CMA3 AST3 PTZ3 DIS3 TACHC TCHC 0 S 0 0 0 0 0 0 0 1 S -0.1048 -0.00013-1.613e-07-2.757e-07-5.421e-10 0 0 2 S -0.1424 0.0002215-3.444e-07-6.616e-08 6.384e-10 -0 0 3 S -0.06914-7.929e-05-9.092e-08-5.932e-07-7.845e-10 0 0 4 S -0.1812 0.0003056-5.154e-07 1.815e-07 5.63e-10 -0 0 5 S 0.1125 0.0001328 1.568e-07-9.931e-07-9.875e-10 0 0 6 S 0.383 4.653e-05-6.765e-07 7.711e-07 7.85e-10 0 0 7 S 0 -0 0 0 0 -0 0 -0.002114 0.0004971-1.632e-06-9.755e-07-3.276e-10 0 0
s = system_from_yaml("""
description: uv focusing f/1 50mm (doi:10.1364/AO.31.004397)
stop: 1
wavelengths: [266.0e-9]
object: {angle_deg: 0.1, pupil: {radius: 15.3}}
elements:
- {material: air}
- {distance: 10, roc: 25.81, material: LITHOSIL-Q, radius: 15.5}
- {distance: 8.595, roc: 18.73, material: air}
- {distance: 8.902, roc: 29.05, material: LITHOSIL-Q}
- {distance: 9.799, roc: -35.88, material: air}
- {distance: 5.659, roc: 13.39, material: LITHOSIL-Q}
- {distance: 4.409, roc: 39.26, material: air}
- {distance: 1.548, roc: -44.54, material: LITHOSIL-Q}
- {distance: 3.461, roc: 39.26, material: air}
- {distance: 13.049, material: air}
""")
s.update()
a = Analysis(s, resize_full=True)
/home/rj/work/nist/pyrayopt/rayopt/paraxial_trace.py:186: RuntimeWarning: divide by zero encountered in true_divide return self.n[(0, -2), ]/(2*na) /home/rj/work/nist/pyrayopt/rayopt/paraxial_trace.py:191: RuntimeWarning: divide by zero encountered in true_divide return 1.22*self.wavelength/(2*na)/self.system.scale /home/rj/src/conda/envs/py35/lib/python3.5/site-packages/numpy/core/function_base.py:107: RuntimeWarning: invalid value encountered in multiply y *= step /home/rj/src/conda/envs/py35/lib/python3.5/site-packages/numpy/core/function_base.py:112: RuntimeWarning: invalid value encountered in add y += start /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 /home/rj/work/nist/pyrayopt/rayopt/analysis.py:382: RuntimeWarning: invalid value encountered in true_divide xd = (a[1] - h)/h
System: uv focusing f/1 50mm (doi:10.1364/AO.31.004397) Scale: 1.0 mm Wavelengths: 266 nm Fields: 0, 0.7, 1 Object: Semi-Angle: 0.1 deg Pupil: Pupil Distance: 10 Refractive Index: 1.0003 Radius: 15.3 Image: Radius: inf Update Radius: True Pupil: Pupil Distance: -59.4061 Refractive Index: 1.0003 Update Radius: True Radius: 29.4953 Stop: 1 Elements: # T Distance Rad Curv Diameter Material n nd Vd 0 S 0 inf inf basic/air 1.000 1.000 89.30 1 S 10 25.81 30.6 SCHOTT/LITHOSIL-Q 1.500 1.458 67.83 2 S 8.595 18.73 26.414 basic/air 1.000 1.000 89.30 3 S 8.902 29.05 28.235 SCHOTT/LITHOSIL-Q 1.500 1.458 67.83 4 S 9.799 -35.88 28.235 basic/air 1.000 1.000 89.30 5 S 5.659 13.39 17.673 SCHOTT/LITHOSIL-Q 1.500 1.458 67.83 6 S 4.409 39.26 15.601 basic/air 1.000 1.000 89.30 7 S 1.548 -44.54 15.458 SCHOTT/LITHOSIL-Q 1.500 1.458 67.83 8 S 3.461 39.26 12.113 basic/air 1.000 1.000 89.30 9 S 13.085 inf 0.109 basic/air 1.000 1.000 89.30 lagrange: -0.026712 track length: 42.373 object, image height: [ 0.017 0.054] front, back focal length (from PP): [-31.237 31.237] entry, exit pupil height: [ 15.3 29.115] entry, exit pupil distance: [ -0. -46.357] front, back focal distance: [-16.41 13.08] front, back principal distance: [ 14.826 -18.157] front, back nodal distance: [ 14.826 -18.157] front, back numerical aperture: [ 0. 0.44] front, back f number: [ 1.021 0.536] front, back working f number: [ inf 1.137] front, back airy radius: [ inf 0.] transverse, angular magnification: [-0. 0.526] # T path n axial y axial nu chief y chief nu 0 S 0 1 15.3 0 -0.01745 0.001746 1 S 10 1.5 15.3 -0.296 0 0.001746 2 S 18.59 1 13.6 0.06666 0.01001 0.002013 3 S 27.5 1.5 14.2 -0.1774 0.02792 0.001533 4 S 37.3 1 13.04 -0.3588 0.03793 0.001005 5 S 42.95 1.5 11.01 -0.7693 0.04362-0.0006218 6 S 47.36 1 8.746 -0.6581 0.04179 -9.03e-05 7 S 48.91 1.5 7.727 -0.5715 0.04165 0.0003767 8 S 52.37 1 6.409 -0.49 0.04252 0.0009175 9 S 65.42 1 0.01696 -0.49 0.05449 0.0009175 # T SA3 CMA3 AST3 PTZ3 DIS3 TACHC TCHC 0 S 0 0 0 0 0 0 0 1 S -0.7222 -0.002126 -6.26e-06-9.386e-06-4.607e-08 0 0 2 S 1.73 0.005557 1.784e-05 1.293e-05 9.883e-08 0 0 3 S -0.6501 -0.00348-1.863e-05-8.339e-06-1.444e-07 0 0 4 S -1.941-0.0001416-1.033e-08-6.751e-06-4.933e-10 -0 -0 5 S 0.03986 0.0003667 3.373e-06-1.809e-05-1.354e-07 0 0 6 S -0.5334 0.001194-2.673e-06 6.17e-06-7.829e-09 -0 0 7 S 2.2 0.002713 3.346e-06 5.439e-06 1.083e-08 -0 -0 8 S -0.1643 0.001006-6.163e-06 6.17e-06-4.204e-11 -0 0 9 S 0 -0 0 0 0 -0 0 -0.04037 0.005089-9.176e-06-1.185e-05-2.245e-07 0 0
s.edge_thickness(), s.origins[:, 2]
(array([ 0. , 15.024, 9.02 , 7.114, 3.244, 11.883, 1.862, 0.09 , 4.607, 12.615]), array([ 0. , 10. , 18.595, 27.497, 37.296, 42.955, 47.364, 48.912, 52.373, 65.458]))