ImagingPath.marginalRays
- raytracing.ImagingPath.marginalRays(self, y=0)
This function calculates the marginal rays for a height y at object. The marginal rays for height y are the rays that hit the upper and lower edges of the aperture stop. There are always two marginal rays for any point on the object. They are symmetric on either side of the optic axis only when y=0, in which case they are called the axial rays (or just axial ray).
- Parameters:
y (float) – The starting height of the marginal rays at the object (default=0) In general, this could be any height, not just y=0. However, we usually want y=0 which is implicitly called “the axial ray (of the system)”,
- Returns:
marginalRays – The properties (i.e. heights and the angles of the marginal rays.). If the default value is used at the input (y=0), both rays will be symmetrically oriented on either side of the optical axis.
- Return type:
list of object of Ray class
Examples
>>> from raytracing import * >>> path = ImagingPath() # define an imaging path >>> # use append() to add elements to the imaging path >>> path.append(Space(d=20)) >>> path.append(Lens(f=20,diameter=2,label="f=20")) >>> path.append(Space(d=30)) >>> path.append(Lens(f=10,diameter=10,label="f=10")) >>> path.append(Space(d=10)) >>> print( 'the first marginal ray is:\n', path.marginalRays()[0]) the first marginal ray is: y = 0.000 theta = 0.050 z = 0.000 >>> print( 'the second marginal ray is:\n', path.marginalRays()[1]) the second marginal ray is: y = 0.000 theta = -0.050 z = 0.000
As it can be seen in the example, the marginal rays at y=0 are symmetrically oriented on either side of the optical axis.
See also
raytracing.ImagingPath.axialRay,raytracing.ImagingPath.chiefRay,raytracing.ImagingPath.principalRayNotes
The calculation is simple: obtain the transfer matrix to the aperture stop, then we know that the input ray (which we are looking for) will end at y= +/-(diameter/2) at the aperture stop. We return the largest (positive) angle first, for convenience.