/Simulator-of-Optical-Quality

This package simulates different optical quality for telescope or lenses acquisition systems

Primary LanguagePythonApache License 2.0Apache-2.0

Optical Systems Quality Simulator

This project aims to democratize physical and mathematical concepts that various industries uses to design optical systems, from smartphones to Eath Observation satellites.

With this python project, the user could:

  • Simulate different optical systems, as telescopes or lenses, with key parameters, i.e. aperture radius, secondary mirror obstruction, focal length, pixel size, light wavelength.
  • Generate optical quality metrics visualizations, i.e. Point spread Function, Modulation Transfer Function.
  • Add and understand optical aberrations which are inherent to any acquisition system manufacturing.

Acknowledgements

In this project we are using physical and mathematical concepts developped and improved since Thomas Young's interference experiment described in his paper in 1801 On the theory of light and colours where he illustrated the wave property of light, , enriching Isaac Newton' s corpuscular theory of light.

young interferences illustrations Frauhnofer diffraction Zernike aberration illustration Young' s illustration on light interference, light propagation through a partially obstructed plane, F. Zernike' s illustration of optical aberration

From Joseph von Fraunhofer who helped to modelize the propagation of the light for far field, as a wave, through a partly blocked plane, with the Fraunhofer diffraction equation. To Frits Zernike, who was awarded with the Nobel Prize for Physics in 1952 for his work on modelizing optical aberrations through phase contrast polynomial. The code is mainly based on those 3 scientific papers / books:

Installation

As a recommendation, you could install this project with a virtual environment as venv

  git clone https://github.com/flp3/Simulator-of-Optical-Quality.git
  cd Simulator-of-Optical-Quality

  pip install virtualenv
  python -m venv venv
  venv\Scripts\activate

  pip install .

Demo

For anyone interested into simulating and getting nice visualization without getting into the code, you could find the command line interface useful: cli.py

Some nice commands are already deployed:

python .\src\cli.py --help
Options:
  -h, --help  Show this message and exit.

Commands:
  visualize-aberrations                    visualize the optical aberrations
  visualize-apertures                      visualize the instrument aperture
  visualize-diffraction                    visualize the light diffraction through an aperture
  visualize-system-with-aberrations        visualize the light propagation through an
                                             acquisition system with optical aberrations

For example we could

  • visualize the impact of different optical aberrations on the light' s phase as a wave passing through an open disk (as a lens):
python .\src\cli.py visualize-aberrations --zernike_azimuth 2 --zernike_radial 2

Optical aberrations

  • visualize the light propagation through a lens of 15mm of radius with some defocus aberration and see the Point spread function, and its Modulation function:
python .\src\cli.py visualize-system-with-aberrations l --radius 15 --wavelength 800e-9 --focal_length 0.1 --pixel_size 1.5e-6

light propagation example

  • Simulate the image quality of a Cassgrain Telescope satellite, at 500km altitude orbit, capturing image of the earth with a ground sampled distance of 0.85m per pixel, and a bit of alisaing as the MTF at Nyquisit, i.e. the sampling frequency, would be around 10-15% with some optical aberrations:
python .\src\cli.py visualize-system-with-aberrations t --radius 150 --wavelength 800e-9 --focal_length 2.3 --pixel_size 4e-6

Image quality simulation for a EO satellite