A optiland based script which solves for any gregorian or cassegrain aplanatic geometry. Using visisipy Navarro eye model then optimizes a CSF weighted MTF merit function to maximize subjective quality factor.
I'd like to preface this by saying this code is far from production ready and still contains many notes/ bugs but the essential functions have been proven.
Basic usage:
- install all dependencies
- run mainGui.py to start script.
- As a note the first run may take a while from all the imports
- The program should pop up with the initial solving screen which can solve for any 2 mirror aplanat gregorian or cassegrain telescope. The EFL and CA are fixed variables for now which can be changed in the solveAplanat class
5)The initial window should look like this with sliders to change the primary focal length and mirror separation. The bar graph on the right should show only astigmatism on axis for basic verification that the aplanatic sovle did work. The starting geometry is gregorian but the sliders can change it to cassegrain.
6) After defining basic first order geometry hit the graph button in the bottom right. Depending on how the scripts are set up in the console the maingui was run in should start showing merit funciton values and opitmization outputs.
- The way the script is currently set up the optic for the objective is created, a modeled eyepiece is created and the Navarro eye model is inserted before optimization.
8)The main optimization controls are located in the optilandDataGraphs class where different eye models and eyepieces can be inserted here. Their respective settings and additional eyepieces can be added in the imported classes.
-
As the current setup shows the objective is inserted. the eye model is inserted then a few optimizations take place. First the eyepiece and the eye are shifted to find best focus. Next a few iterations of full field wavefront optimization occur to get a basic good design for further optimization. Finally the csf optimization occurs where the minimum tangential or sagittal CSF x MTF is optimized per field resulting in bringing the two mtf results closer together.
-
If the process hangs in the console press space bar to see if the output is just frozen. In the meantime during optimization the console should be outputting a number which ideally increases. This number is the total area under the CSF x MTF curve which we are trying to maximize. After a good result occurs hit the escape key in the console to stop the optimization. The best result will be reinserted into the system and the results graphed.
Here are some sample results.
Before optimization aplanatic gregorian.
Aplanat with WFE optimization before CSF x MTF
And finally aplanat after WFE and CSF x MTF optimization

As you can see from the results and the very basic image simulation the system improved between standard WFE optimization across the field compared to the CSF weighted MTF merit function. None of these simualtions account for accomodation of the eye yet either so there is more room for optimization in the future.