#!/usr/bin/env python # coding: utf-8 # In[1]: get_ipython().run_line_magic('pylab', 'inline') import warnings import numpy as np import matplotlib.pyplot as plt import rayopt as ro warnings.simplefilter("ignore", FutureWarning) np.seterr(divide="ignore", invalid="ignore") np.set_printoptions(precision=4) description = "US 7,411,745 Example 3 (Nikkor 200mm F2 AFS)" columns = "type distance roc diameter material" # number of surfaces = 23 lensdata = """ O 0.0 0.0 138.788 AIR S 20 104.204 106.76 1.49782/82.6 S 20 -630.89 106.76 AIR S 0.3 88.701 95.76 1.49782/82.6 S 21 -270.095 93.7 1.7481/52.3 S 4 128.345 83.98 AIR S 15.39 71.441 73.74 1.44679/91 S 8 174.32 73.74 AIR S 1 74.005 67.86 1.7481/52.3 S 3 34.121 58.04 1.49782/82.6 S 15 126.546 58.04 AIR S 5.5 -957.711 50.24 1.80454/39.6 S 4.8 -100.138 48.64 1.51454/54.6 S 3 55.554 42.24 AIR S 8 -109.151 41.42 1.80384/33.9 S 6 -51.923 40.82 1.6228/57 S 3 54.98 37.54 AIR A 15.5239 0 36.68 AIR S 1.2 111.154 37.94 1.7481/52.3 S 4.5 -121.699 37.94 AIR S 2.7 -49.128 37.94 1.72825/38.5 S 3 -104.898 37.94 AIR S 8 413.276 39.74 1.64/60.1 S 5 -69.215 39.74 AIR I 59.4575 0 43.2 AIR """ s = ro.system_from_text(lensdata, columns.split(), description=description) s.fields = 0, .7, 1. s.object.angle = np.deg2rad(6.310000) s.update() print(s) ro.Analysis(s) # In[ ]: