rayoptics.elem.profiles module
Module for different surface profile shapes
- intersect_parabola(cv, p, d, z_dir=1.0)[source]
Intersect a parabolid, starting from an arbitrary point.
- Parameters:
cv – vertex curvature
p – start point of the ray in the profile’s coordinate system
d – direction cosine of the ray in the profile’s coordinate system
z_dir – +1 if propagation positive direction, -1 if otherwise
- class SurfaceProfile[source]
Bases:
object
Base class for surface profiles.
- profile(sd, dir=1, steps=6)[source]
Return a 2d polyline approximating the surface profile.
- Parameters:
sd – semi-diameter of the profile
dir – +1 for profile from neg to postive direction, -1 if otherwise
steps – number of points to generate
- intersect(p0, d, eps, z_dir)[source]
Intersect a profile, starting from an arbitrary point.
- Parameters:
p0 – start point of the ray in the profile’s coordinate system
d – direction cosine of the ray in the profile’s coordinate system
z_dir – +1 if propagation positive direction, -1 if otherwise
eps – numeric tolerance for convergence of any iterative procedure
- Returns:
distance to intersection point s1, intersection point p
- Return type:
- Raises:
- intersect_welford(p, d, eps, z_dir)[source]
Intersect a profile, starting from an arbitrary point.
From Welford, Aberrations of Optical Systems (ISBN-10: 0852745648), eqs 4.34 thru 4.41.
- Parameters:
p0 – start point of the ray in the profile’s coordinate system
d – direction cosine of the ray in the profile’s coordinate system
z_dir – +1 if propagation positive direction, -1 if otherwise
eps – numeric tolerance for convergence of any iterative procedure
- Returns:
distance to intersection point s1, intersection point p
- Return type:
- Raises:
- intersect_spencer(p0, d, eps, z_dir)[source]
Intersect a profile, starting from an arbitrary point.
From Spencer and Murty, General Ray-Tracing Procedure
- Parameters:
p0 – start point of the ray in the profile’s coordinate system
d – direction cosine of the ray in the profile’s coordinate system
z_dir – +1 if propagation positive direction, -1 if otherwise
eps – numeric tolerance for convergence of any iterative procedure
- Returns:
distance to intersection point s1, intersection point p
- Return type:
- Raises:
- intersect_scipy(p0, d, eps, z_dir)[source]
Intersect a profile, starting from an arbitrary point.
- Parameters:
p0 – start point of the ray in the profile’s coordinate system
d – direction cosine of the ray in the profile’s coordinate system
z_dir – +1 if propagation positive direction, -1 if otherwise
eps – numeric tolerance for convergence of any iterative procedure
- Returns:
distance to intersection point s1, intersection point p
- Return type:
- Raises:
- class Spherical(c=0.0, r=None)[source]
Bases:
SurfaceProfile
Spherical surface profile parameterized by curvature.
- __init__(c=0.0, r=None)[source]
initialize a Spherical profile.
- Parameters:
c – curvature
r – radius of curvature. If zero, taken as planar. If r is specified, it overrides any input for c (curvature).
- property r
- class Conic(c=0.0, cc=0.0, r=None, ec=None)[source]
Bases:
SurfaceProfile
Conic surface profile parameterized by curvature and conic constant.
Conics produced for conic constant values:
cc > 0.0: oblate spheroid
cc = 0.0: sphere
cc < 0.0 and > -1.0: ellipsoid
cc = -1.0: paraboloid
cc < -1.0: hyperboloid
- __init__(c=0.0, cc=0.0, r=None, ec=None)[source]
initialize a Conic profile.
- Parameters:
c – curvature
r – radius of curvature. If zero, taken as planar. If r is specified, it overrides any input for c (curvature).
cc – conic constant
ec – conic asphere (= cc + 1). If ec is specified, it overrides any input for the conic constant (cc).
- property r
- property ec
- append_pt_to_2d_profile(surface_profile, y, poly_profile)[source]
calc surface sag at y and append to poly if ok, else return None
- class EvenPolynomial(c=0.0, cc=0.0, r=None, ec=None, coefs=None)[source]
Bases:
SurfaceProfile
Even Polynomial asphere up to 20th order, on base conic.
- __init__(c=0.0, cc=0.0, r=None, ec=None, coefs=None)[source]
initialize a EvenPolynomial profile.
- Parameters:
c – curvature
r – radius of curvature. If zero, taken as planar. If r is specified, it overrides any input for c (curvature).
cc – conic constant
ec – conic asphere (= cc + 1). If ec is specified, it overrides any input for the conic constant (cc).
coefs – a list of even power coefficents, starting with the quadratic term, and not exceeding the 20th order term.
- property r
- property ec
- class RadialPolynomial(c=0.0, cc=None, r=None, ec=1.0, coefs=None)[source]
Bases:
SurfaceProfile
Radial Polynomial asphere, on base conic.
- Conics produced for conic asphere values:
ec > 1.0: oblate spheroid ec = 1.0: sphere ec > 0.0 and < 1.0: ellipsoid ec = 0.0: paraboloid ec < 0.0: hyperboloid
- initial_size = 10
- __init__(c=0.0, cc=None, r=None, ec=1.0, coefs=None)[source]
initialize a RadialPolynomial profile.
- Parameters:
c – curvature
r – radius of curvature. If zero, taken as planar. If r is specified, it overrides any input for c (curvature).
ec – conic asphere.
cc – conic constant (= ec - 1). If cc is specified, it overrides any input for the conic asphere (ec).
coefs – a list of radial coefficents, starting with the constant term, (and not exceeding the 10th order term).
- property r
- property cc
- class YToroid(c=0.0, cR=0, cc=0.0, r=None, rR=None, ec=None, coefs=None)[source]
Bases:
SurfaceProfile
Y Aspheric toroid, up to 20th order, on base conic.
- __init__(c=0.0, cR=0, cc=0.0, r=None, rR=None, ec=None, coefs=None)[source]
initialize a EvenPolynomial profile.
- Parameters:
c – curvature
r – radius of curvature. If zero, taken as planar. If r is specified, it overrides any input for c (curvature).
cR – toric sweep radius of curvature
rR – toric sweep radius
cc – conic constant
ec – conic asphere (= cc + 1). If ec is specified, it overrides any input for the conic constant (cc).
coefs – a list of even power coefficents, starting with the quadratic term, and not exceeding the 20th order term.
- property r
- property rR
- property ec
- class XToroid(c=0.0, cR=0, cc=0.0, r=None, rR=None, ec=None, coefs=None)[source]
Bases:
YToroid
X Aspheric toroid, up to 20th order, on base conic. Leverage YToroid
- __init__(c=0.0, cR=0, cc=0.0, r=None, rR=None, ec=None, coefs=None)[source]
initialize a EvenPolynomial profile.
- Parameters:
c – curvature
r – radius of curvature. If zero, taken as planar. If r is specified, it overrides any input for c (curvature).
cR – toric sweep radius of curvature
rR – toric sweep radius
cc – conic constant
ec – conic asphere (= cc + 1). If ec is specified, it overrides any input for the conic constant (cc).
coefs – a list of even power coefficents, starting with the quadratic term, and not exceeding the 20th order term.