In [ ]:
from pyoptools.all import *
from numpy import pi
In [ ]:
L=library.Edmund.get("32494")
C=CCD()
S=System(complist=[(L,(0,0,156.),(0,-pi,0)),(C,(0,0,570),(.001,0,0))],n=1.)
R=point_source_c(span=(0.06,0.06),wavelength=.65)
S.ray_add(R)
S.propagate()
Plot3D(S,center=(0,0,300), size=(600,100),scale=2,rot=[(0,0,-3*pi/8),(0,3*pi/8,0)])#
TODO: When generating the documantation automatically, the methods related to get_optical_path_map... are not working. If the example is run in a normal notebook tthey work. I dont understand what is the problem. Needs to be fixed.
In [ ]:
%pylab inline
#imshow(C.get_optical_path_map())
#colorbar()
In [ ]:
#poly,error=C.get_optical_path_map_lsq(order=2)
In [ ]:
#print(error)
#print(poly)
In [ ]:
def opsystem(lp):
L=library.Edmund.get("32494")
C=CCD()
S=System(complist=[(L,(0,0,lp),(0,-pi,0)),(C,(0,0,570),(0,0,0))],n=1.)
R=point_source_c(span=(0.06,0.06),wavelength=.65)
S.ray_add(R)
S.propagate()
X,Y,Z=C.get_optical_path_data()
return array(Z).std()
In [ ]:
#opsystem(158)
In [ ]:
#from scipy.optimize import fmin
#fmin(opsystem,158)
In [ ]: