Pyrate is a program for scientific optical lens design. It traces rays through an optical system and optimizes its properties, e.g. lens radii.
The merit function to be minimized during optimization can vastly vary depending on the type of objective and constraints. During the design process, the merit function is changed a lot, as the system must fulfill ever more requirements when approaching production readiness.
We present a variable container, storing the variable value, its status, and possible constraints. The status is used to indicate whether the variable shall be optimized or not. Designers often use only parts of the available variables, especially in early design stages.
Before optimization, the highest hierarchy object collects all containers from its children and grandchildren, wraps them to a format usable by scipy.minimize and optimizes the system with the current merit function.
We show several examples of optical systems optimized with our program.