Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Raytrace Simulation

The critical API for raytrace simulation are the psiXvalue(x,y) and psiYvalue(x,y), which gives the two elements of ψ(x,y)\nabla\psi(x,y). These are defined by the Lens class.

Subclasses of PsiFunctionLens class implement psiXvalue(x,y) and psiYvalue(x,y) by calculating algebraic expressions for the partial derivatives of ψ\psi. To enable raytrace simulation with new lens models, all that is needed is a subclass implementing these two functions.

Sampled lenses implement psiXvalue(x,y) and psiYvalue(x,y) using differentiation filters. To make a new subclass of PsiFunctionLens work with sampled simulation (using the SampledPsiFunctionLens), all that is need is the psiValue(x,y) function which evaluates ψ\psi.