#!/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 = "JP1994-029897 Example 4 (Nikon 105mm f/4.5 UV-Micro-Nikkor)" columns = "type distance roc diameter material" # number of surfaces = 13 lensdata = """ O 0.0 0.0 34.32 AIR S 20 -32.904 26.4 1.45851/67.93 S 1.331 50.597 26.4 AIR S 3.613 121.007 29.64 1.43388/95.57 S 7.415 -35.246 29.64 AIR S 0.19 31.157 30.18 1.43388/95.57 S 7.605 -70.598 30.18 AIR A 13 0 19.602 AIR S 2.924 -31.157 20.94 1.45851/67.93 S 1.426 43.241 20.94 AIR S 5.989 179.247 23.14 1.43388/95.57 S 8.936 -18.63 23.14 AIR S 0.111 -18.224 23.88 1.45851/67.93 S 1.901 -33.891 23.88 AIR I 82.765 0 41.143 AIR """ s = ro.system_from_text(lensdata, columns.split(), description=description) s.fields = 0, .7, 1. s.object.angle = np.deg2rad(11.700000) s.update() print(s) ro.Analysis(s) # In[ ]: