Skip to content

yuuutosasa/hswfs

 
 

Repository files navigation

hswfs: A virtual Hartmann-Shack wavefront sensor

Python 3.8 Documentation Status License: MIT

hswfs is a Python package which provides a minimalistic simulation of a Hartmann-Shack Wavefront Sensor. A HSWFS is a popular and conceptually simple type of wavefront sensor that can be used to measure the abberations of a wavefront. It is commonly used in the adaptive optics systems of larger telescopes, which correct the image for the perturbations introduced by the turbulent movement of the air in the Earth's atmosphere.

Among other things, hswfs includes the following features:

  • Generate random wavefront sensor data.
  • Fit the wavefront using Zernike polynomials of arbitrary order (hswfs uses sympy to compute expressions of arbitrary Zernike polynomials and their derivatives in both polar and Cartesian coordinates).
  • Compute the point spread function (PSF) from a wavefront.

⚡ Quickstart

To get started, clone this repository and install hswfs as a Python package:

git clone git@github.com:timothygebhard/hswfs.git
cd hswfs
pip install .

🔭 Example

Here is an example result, showing a virtual wavefront sensor with the shifts measured in each subaperture, and the respective reconstructed wavefront and point spread function:

Example Results

This example was created by the hswfs_example.py script in the demo directory. This script should provide a good starting point to familiarize yourself with the functionality of hswfs.

📚 Documentation

The documentation for hswfs is available on ReadTheDocs.

🐭 Tests

hswfs comes with a series of unit tests, which can be run as follows:

pytest tests

🎉 Contributions

Contributions to hswfs are always very welcome! Whether you have found a bug, or want to enhance hswfs's functionality, please feel free to open an issue here on GitHub, or send a pull request.

⚠️ License and Warranty

hswfs is provided under the permissive MIT License, which gives you a lot of freedom to use it for your own work.

Please note, however, that hswfs is provided as is, without any guarantees regarding completeness or correctness. If you break your telescope or AO system, that's on you! 😉

About

A virtual Hartmann-Shack wavefront sensor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%