Lens

class pyvsim.Toolbox.Lens[source]

This class represents an objective lens. The implemented model is a thick, pupil-centric lens as described by Aggarwal and Ahuja .

This means that the center of projection is assumed to be at the center of the entrance pupil.

This class generates the starting vectors for the ray tracing procedure. One caveat is that it is not possible to execute ray tracing from the back of the lens (i.e. from the sensor to the lens), as the rays are assumed straight between these two points. This can be a problem when modelling stacked lenses, that have to be substituted by an equivalent one.

Methods

F = None

Lens focal length

PinholeAft = None

“Virtual pinhole” position (to meet the center of projection)

PinholeFore = None

Center of projection position

aperture = None

f-stop

clearData()[source]

As the data from the Primitives.Part class that has to be cleaned is used only for ray tracing, the parent method is not called.

The notable points, however, are recalculated.

color = None

Lens body color (for display only)

diameter = None

Lens body diameter (for display only)

display()[source]

This method creates a plot showing the position of the lens notable planes (the two main planes, the pupils and the focusing offset). This is intended for debugging purposes, or better understanding how the lens work.

distortionParameters = None

Radial distortion parameters

flangeFocalDistance = None

Lens flange focal distance

focusingOffset = None

Assuming a lens with no floating elements, this is the displacement needed to allow focusing at a certain position

length = None

Lens body length (for display only)

lensDistortion(vectors)[source]

TODO - Implementation of radial distortion model

macro = None

Selects between normal and macro mode (allows objects to be nearer the lens than the sensor)

rayVector(p)[source]

Given a set of points (e.g. in the sensor), will return a list of vectors representing the direction to be followed by ray tracing.

This Page