A useful set of tools for Adaptive Optics in Python

AOtools, updated 🕥 2023-01-27 14:57:03


Useful tools for Adaptive Optics analysis for the Python Programming Language. If using this code for a publication please cite the aotools paper <https://www.osapublishing.org/oe/abstract.cfm?uri=oe-27-22-31316>_ (M. J. Townson, O. J. D. Farley, G. Orban de Xivry, J. Osborn, and A. P. Reeves, "AOtools: a Python package for adaptive optics modelling and analysis," Opt. Express 27, 31316-31329 (2019))

.. image:: https://anaconda.org/aotools/aotools/badges/installer/conda.svg :target: https://conda.anaconda.org/aotools

.. image:: https://github.com/AOtools/aotools/actions/workflows/unit_test.yml/badge.svg :target: https://github.com/AOtools/aotools/actions/workflows/unit_test.yml

.. image:: https://ci.appveyor.com/api/projects/status/hru9gl4jekcwtm6l/branch/master?svg=true :target: https://ci.appveyor.com/project/Soapy/aotools/branch/master

.. image:: https://codecov.io/gh/AOtools/aotools/branch/master/graph/badge.svg :target: https://codecov.io/gh/AOtools/aotools

.. image:: https://readthedocs.org/projects/aotools/badge/?version=latest :target: https://aotools.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status

Required libraries

.. code-block:: python

python SciPy NumPy matplotlib numba


As everything is just pure python, you don't really need to "install" at all. To be able to use the tools from anywhere on your system, add the aotools directory to your PYTHONTPATH. Alternatively you can use one of the methods below.

Anaconda ++++++++

AOtools can be installed in an anaconda environment using:

.. code-block:: python

conda install -c aotools aotools

Pip +++

AOtools can be installed using pip:

.. code-block:: python

pip install aotools

(which may require admin or root privileges)

From Source +++++++++++ Alternatively, to install the tools to your system python distribution from source, run:

.. code-block:: python

python setup.py install

(which may require admin or root privileges) from the aotools directory.

Documentation +++++++++++++ Full documentation is hosted by Read the Docs <https://aotools.readthedocs.io/en/v1.0.1/>_

Issues and Contributions ++++++++++++++++++++++++

Have you found a problem with an AO Tool? Is there something you use often that you think should be included? Please have a quick look at the source code and see if you can fix the problem or make an addition. AOtools is a collaboration between many AO scientists across the world to try and make a well tested and reliable library of AO based functions. There isn't neccessarily a central "developer" to make significant changes, therefore if you think you can help then please get involved, make an issue, clone the code or make a pull request! Feel free to make an issue for discussion.

Usage Stats

Pip +++ .. image:: https://img.shields.io/badge/dynamic/json.svg?color=bright%20green&label=Downloads%2FMonth&query=%24.data.last_month&url=https%3A%2F%2Fpypistats.org%2Fapi%2Fpackages%2Faotools%2Frecent :target: https://pypistats.org/packages/aotools

Anaconda ++++++++ .. image:: https://anaconda.org/aotools/aotools/badges/downloads.svg :target: https://anaconda.org/aotools/aotools


r0 in m or cm?

opened on 2022-10-07 07:11:31 by andrewpaulreeves

I've been using some functions from atmos_conversions for converting r0 -> cn2 and back. Sometimes r0 is listed in the docs as being is cm, sometimes in m. Is it really in cm sometimes? From a quick look at the equations I would guess its mostly in m.

Numba-ise more functions

opened on 2022-02-09 08:18:09 by andrewpaulreeves

I've just noticed the existance of the library numba-scipy, which adds more an API for numba to use scipy functions, such as "special" functions. This would be great to speed up some functions, such as "phase_covariance", which can then be much faster in making covariance matrices, etc...

added type annotations

opened on 2021-04-26 15:42:36 by joamatab None

Simulating turbulence on 2D extended images

opened on 2020-04-12 04:26:51 by joncox123

I would like to simulate the effects of atmospheric turbulence on 2D images, like galaxies or planets, in the focal plane. Have you added support for applying PSF to 2D images? If not, do you have a timeframe for doing so?

Your paper states:

Building on this we will develop methods for applying a PSF to extended images, to allow for the degradation of wide-field images by the effects of atmospheric turbulence.

Adding STMAG and AB mag to flux conversion

opened on 2019-08-02 10:00:58 by lbardou None

Adding as an afflilated package

opened on 2016-06-30 12:47:37 by crawfordsm

This would be great to have as an affiliated package!


Version 1.0.7 2023-01-27 14:50:31

What's Changed

  • Update imports, fixing #67 by @matthewtownson in https://github.com/AOtools/aotools/pull/78
  • Change how random seeds work in phase screens, fix for #61 by @ojdf in https://github.com/AOtools/aotools/pull/81
  • added wind to equivalent layers, to conserve tau0 by @ojdf in https://github.com/AOtools/aotools/pull/82
  • added exception in the case of KL modes without central obsc by @ojdf in https://github.com/AOtools/aotools/pull/84
  • atmospheric params changes by @ojdf in https://github.com/AOtools/aotools/pull/83
  • Update readme by @andrewpaulreeves in https://github.com/AOtools/aotools/pull/89
  • Added ability to rotate generated Zernike modes by @spangly in https://github.com/AOtools/aotools/pull/90

New Contributors

  • @spangly made their first contribution in https://github.com/AOtools/aotools/pull/90

Full Changelog: https://github.com/AOtools/aotools/compare/v1.0.6...v1.0.7

Version 1.0.6 2022-03-14 15:51:29

What's Changed

  • Fix minor typos in documentation
    • units of phase screens by @andrewpaulreeves in #74
    • units of cn2 to r0 conversion, found by @aaronjswank in #77
  • Fix bug in documentation which prevented new builds from working by @matthewtownson
  • Update zernike methods to use integers in factorial calculations. Required for compatibility with numpy 1.21 by @andrewpaulreeves in #76

Full Changelog: https://github.com/AOtools/aotools/compare/v1.0.5...v1.0.6

Version 1.0.5 2021-11-04 18:21:28

What's Changed

  • Turbulence profile compression algorithms by @ojdf in https://github.com/AOtools/aotools/pull/62
  • Fix missing iteration over the subharmonic matrix by @NYurin in https://github.com/AOtools/aotools/pull/60
  • Fix bug, where seed in infinite screen had no effect by @andrewpaulreeves in https://github.com/AOtools/aotools/pull/64
  • Make forward/inverse Fourier transforms consistent by @ojdf in https://github.com/AOtools/aotools/pull/68
  • moving to pytest and github actions by @matthewtownson in https://github.com/AOtools/aotools/pull/71
  • Create codeql-analysis.yml by @matthewtownson in https://github.com/AOtools/aotools/pull/70

New Contributors

  • @NYurin made their first contribution in https://github.com/AOtools/aotools/pull/60
  • @joamatab made their first contribution in https://github.com/AOtools/aotools/pull/66

Full Changelog: https://github.com/AOtools/aotools/compare/v1.0.4...v1.0.5

Version 1.0.4 2020-08-12 10:09:47

  • Update phase screen documentation to clarify units
  • Update dependencies to include numba to fix broken pip installation

Version 1.0.3 2020-07-08 14:11:32

  • Increase speed of infinite phase screen generation by using numba library (thanks @andrewpaulreeves)

Version 1.0.2 2020-04-15 07:33:42

  • Bug fix in 2D Gaussian ( @andrewpaulreeves )

Python tools and libraries for research into Adaptive Optics

GitHub Repository

adaptive-optics python astronomy-library python-package