diff --git a/docs/_static/style.css b/docs/_static/style.css new file mode 100644 index 00000000..d680e844 --- /dev/null +++ b/docs/_static/style.css @@ -0,0 +1,3 @@ +.classifier:before { + content: "\00A0:\00A0" !important; +} \ No newline at end of file diff --git a/docs/_templates/page.html b/docs/_templates/page.html new file mode 100644 index 00000000..4055053d --- /dev/null +++ b/docs/_templates/page.html @@ -0,0 +1,3 @@ +{% extends "!page.html" %} + +{% set css_files = css_files + ["_static/style.css"] %} \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index bda3756b..e7a5c64b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,32 +1,21 @@ # -*- coding: utf-8 -*- -# Licensed under a 3-clause BSD style license - see LICENSE.md # -# POPPY documentation build configuration file +# Configuration file for the Sphinx documentation builder. +# created by sphinx-quickstart # -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this file. -# -# All configuration values have a default. Some values are defined in -# the global Astropy configuration which is loaded here before anything else. -# See astropy.sphinx.conf for which values are set there. +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/master/config + +# -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -# sys.path.insert(0, os.path.abspath('..')) -# IMPORTANT: the above commented section was generated by sphinx-quickstart, but -# is *NOT* appropriate for astropy or Astropy affiliated packages. It is left -# commented out with this explanation to make it clear why this should not be -# done. If the sys.path entry above is added, when the astropy.sphinx.conf -# import occurs, it will import the *source* version of astropy instead of the -# version installed (if invoked as "make html" or directly with sphinx), or the -# version in the build directory (if "python setup.py build_sphinx" is used). -# Thus, any C-extensions that are needed to build the documentation will *not* -# be accessible, and the documentation will not build correctly. - -import datetime +# +import os import sys +import datetime import stsci_rtd_theme try: @@ -35,85 +24,20 @@ print('ERROR: the documentation requires the sphinx-astropy package to be installed') sys.exit(1) +# -- Project information ----------------------------------------------------- # Get configuration information from setup.cfg from configparser import ConfigParser conf = ConfigParser() - -def setup(app): - app.add_css_file("stsci.css") - conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')]) setup_cfg = dict(conf.items('metadata')) -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('../')) -sys.path.insert(0, os.path.abspath('../poppy/')) -sys.path.insert(0, os.path.abspath('exts/')) -extensions = [ - 'numfig', - 'sphinx.ext.autodoc', - 'sphinx.ext.intersphinx', - 'sphinx.ext.todo', - 'sphinx.ext.inheritance_diagram', - 'sphinx.ext.viewcode', - 'sphinx.ext.autosummary', - 'sphinx_automodapi.automodapi', - 'sphinx_issues' - ] -numpydoc_show_class_members = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# -- General configuration ---------------------------------------------------- - - -extensions.append('nbsphinx') -extensions.append('sphinx.ext.mathjax') - -suppress_warnings = ["ref.keyword"] -# By default, highlight as Python 3. -highlight_language = 'python3' - -# If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.2' - -# To perform a Sphinx version check that needs to be more specific than -# major.minor, call `check_sphinx_version("x.y.z")` here. -# check_sphinx_version("1.2.1") - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns.append('_templates') -exclude_patterns.append('_build') -exclude_patterns.append('**.ipynb_checkpoints') - -# This is added to the end of RST files - a good place to put substitutions to -# be used globally. -rst_epilog += """ -""" - -# -- Project information ------------------------------------------------------ - - -# Github integration via sphinx-issues plugin -# See https://github.com/sloria/sphinx-issues - -# Github repo -issues_github_path = "spacetelescope/poppy" - - -# This does not *have* to match the package name, but typically does project = setup_cfg['name'] author = setup_cfg['author'] copyright = '{0}, {1}'.format( datetime.datetime.now().year, author) -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the +# Also read version and release from the setup_cfg, for use throughout the # built documents. __import__(setup_cfg['name']) @@ -128,66 +52,168 @@ def setup(app): version = 'dev' release = 'dev' -# -- Options for HTML output --------------------------------------------------- -# A NOTE ON HTML THEMES -# The global astropy configuration uses a custom theme, 'bootstrap-astropy', -# which is installed along with astropy. A different theme can be used or -# the options for this theme can be modified by overriding some of the -# variables set in the global configuration. The variables set in the -# global configuration are listed below, commented out. +# -- General configuration --------------------------------------------------- -# Add any paths that contain custom themes here, relative to this directory. -# To use a different custom theme, add the directory containing the theme. -html_theme_path = [stsci_rtd_theme.get_html_theme_path()] +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.intersphinx', + 'sphinx.ext.todo', + 'sphinx.ext.inheritance_diagram', + 'sphinx.ext.viewcode', + 'sphinx.ext.autosummary', + 'sphinx.ext.mathjax', + 'sphinx_automodapi.automodapi', + 'sphinx_issues', + 'nbsphinx', + 'numpydoc' + +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '_templates', '**.ipynb_checkpoints'] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + + +# -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. To override the custom theme, set this to the -# name of a builtin theme or the name of a custom theme in html_theme_path. +# a list of builtin themes. html_theme = 'stsci_rtd_theme' +html_theme_path = [stsci_rtd_theme.get_html_theme_path()] -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# html_theme_options = {} -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = '' +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] +html_css_files = ['_static/style.css', 'stsci.css'] -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '' +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". html_title = '{0} v{1}'.format(project, release) + +# -- Options for HTMLHelp output --------------------------------------------- + # Output file base name for HTML help builder. -htmlhelp_basename = project + 'doc' +htmlhelp_basename = 'poppydoc' + + +# -- Options for LaTeX output ------------------------------------------------ +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', -# -- Options for LaTeX output -------------------------------------------------- + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} # Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [('index', project + '.tex', project + u' Documentation', - author, 'manual')] +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'poppy.tex', 'poppy Documentation', + 'Space Telescope Science Institute', 'manual'), +] -# -- Options for manual page output -------------------------------------------- +# -- Options for manual page output ------------------------------------------ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [('index', project.lower(), project + u' Documentation', - [author], 1)] +man_pages = [ + (master_doc, 'poppy', 'poppy Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'poppy', 'poppy Documentation', + author, 'poppy', 'One line description of project.', + 'Miscellaneous'), +] + + +# -- Options for Epub output ------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] -# -- Options for inheritance diagram ------------------------------------------------ -# See http://sphinx-doc.org/ext/inheritance.html -# and http://stackoverflow.com/questions/2151711/how-can-i-make-sphinxs-inheritance-diagram-readable -#inheritance_graph_attrs = dict(rankdir="LR", size='"12.0, 5.0"', -# fontsize=36, ratio='compress') +# -- Extension configuration ------------------------------------------------- ## -- Options for the edit_on_github extension ---------------------------------------- if eval(setup_cfg.get('edit_on_github')): @@ -198,10 +224,18 @@ def setup(app): if versionmod.version.release: edit_on_github_branch = "v" + versionmod.version.version else: - edit_on_github_branch = "master" + edit_on_github_branch = "stable" edit_on_github_source_root = "" edit_on_github_doc_root = "docs" # -- Resolving issue number to links in changelog ----------------------------- +# Github integration via sphinx-issues plugin +# See https://github.com/sloria/sphinx-issues + +# Github repo +issues_github_path = "spacetelescope/poppy" + github_issues_url = 'https://github.com/{0}/issues/'.format(setup_cfg['github_project']) + + diff --git a/docs/index.rst b/docs/index.rst index 37aa22e7..d1e727e7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,7 +17,6 @@ imaging simulations. Summary ------------ - **What this software does:** * Allows users to define an optical system consisting of multiple planes, such as pupils and images. @@ -28,13 +27,13 @@ Summary selection of broad- and narrow-band filters, selectable optical components such as pupil stops, models of optical aberrations defined by Zernike polynomials, etc. +That said, Poppy does not implement full Rayleigh-Sommerfeld electromagnetic propagation, vector electromagnetic field propagation +such as would be needed for modeling polarization effects, nor modelling of any kind of detector noise or imperfections. -**What this software does not do:** -* Full Rayleigh-Sommerfeld electromagnetic propagation. -* Vector electromagnetic field propagation such as would be needed for modeling polarization effects. -* Modelling of any kind of detector noise or imperfections. +**Getting Started:** +See `Example Code and Getting Started `_ .. admonition:: Quickstart IPython Notebook diff --git a/docs/relnotes.rst b/docs/relnotes.rst index 0f122802..8ba25dbd 100644 --- a/docs/relnotes.rst +++ b/docs/relnotes.rst @@ -5,6 +5,16 @@ Release Notes For a list of contributors, see :ref:`about`. +1.0.1 +----- + +.. _rel1.0.1: + +*2021 December 9* + +This is a very minor re-release, to fix some documentation formatting and release packaging issues with the 1.0.0 release. No changes in functionality. + + 1.0.0 ----- @@ -12,39 +22,42 @@ For a list of contributors, see :ref:`about`. *2021 December 7* +This is a major release with significant enhancements and changes, in particular with regards to changes in wavefront sign convention representations. + .. admonition:: Changes and Clarifications in Signs for Wavefront Error and Phase **Some sign conventions for wavefront error and optical phase have changed in this version of poppy** This release includes optical algorithm updates after a thorough audit and cross-check of sign conventions for phase and wavefront error, disambiguating portions of the sign conventions and code to ensure consistency with several other relevant optical modeling packages. Poppy now strictly follows the sign conventions as advocated in e.g. - Wyant and Creath's `Basic Wavefront Aberration Theory for Optical Metrology _` (or see `here _`). This makes poppy consistent with the convention more widely used in optical metrology and other optical software such as Code V; however this is not consistent with some other reference such as Goodman's classic text _Fourier Optics_. + Wyant and Creath's `Basic Wavefront Aberration Theory for Optical Metrology `_ (or see `here `_). This makes poppy consistent with the convention more widely used in optical metrology and other optical software such as Code V; however this is not consistent with some other reference such as Goodman's classic text *Fourier Optics*. To achieve that consistency, *this is a partially back-incompatible release*, with changes in the signs of complex exponentials in some Fourier propagation calculations. Depending on your use case this may result in some changes in output PSFs or different signs or orientations from prior results. - See :ref:`sign_conventions` for details, discussion, and demonstration. Many thanks to Derek + See `Sign Conventions for Coordinates, Phase, and Wavefront Error `_ for details, discussion, and demonstration. + + Many thanks to Derek Sabatke (Ball Aerospace); Matthew Bergkoetter, Alden Jurling, and Tom Zielinski (NASA GSFC); and Randal Telfer (STScI) for invaluable discussions and aid in getting these details onto a more rigorous footing. **API Changes:** - * Several functions in the Zernike module were renamed for clarity, in particular ``opd_expand``->``decompose_opd``, and ``opd_from_zernikes``->``compose_opd_from_basis``. + * Several functions in the Zernike module were renamed for clarity, in particular the prior ``opd_expand`` is now :py:func:`~poppy.zernike.decompose_opd`, and ``opd_from_zernikes`` is now :py:func:`~poppy.zernike.compose_opd_from_basis`. The prior function names also continue to work as aliases for backwards compatibility. (:pr:`471` by :user:`mperrin`) **New Functionality:** - - * New class ``TipTiltStage``, which allows putting additional tip-tilt on any arbitrary optic, and adjusting/controlling the tip and tilt. See `here `_ for example. (:pr:`414` by :user:`mperrin) - * New class ``CircularSegmentedDeformableMirror``, which models an aperture comprising several individually-controllable circular mirrors. See `here `_ for example. (:pr:`407` and :pr:`424` by :user:`Teusia`) - * New class ``KolmogorovWFE`, which models the phase distortions in a turbulent atmosphere. See `this notebook `_ for details. (:pr:`437` by :user:`DaPhil`) - * New class ``ThermalBloomingWFE`, which models the change in WFE from heating of air (or other transmission medium) due to high powered laser beams. See `this notebook `_ for details. (:pr:`438` by :user:`DaPhil`) + * New class :py:obj:`~poppy.TipTiltStage`, which allows putting additional tip-tilt on any arbitrary optic, and adjusting/controlling the tip and tilt. See `here `_ for example. (:pr:`414` by :user:`mperrin`) + * New class :py:obj:`~poppy.CircularSegmentedDeformableMirror`, which models an aperture comprising several individually-controllable circular mirrors. See `here `_ for example. (:pr:`407` and :pr:`424` by :user:`Teusia`) + * New class :py:obj:`~poppy.KolmogorovWFE`, which models the phase distortions in a turbulent atmosphere. See `this notebook `_ for details. (:pr:`437` by :user:`DaPhil`) + * New class :py:obj:`~poppy.ThermalBloomingWFE`, which models the change in WFE from heating of air (or other transmission medium) due to high powered laser beams. See `this notebook `_ for details. (:pr:`438` by :user:`DaPhil`) **Other enhancements and fixes:** * Wavefront instances gain a `.wfe` attribute for the wavefront error in meters (computed from phase, so it will wrap if wavefront error exceeds +- 0.5 waves), and the wavefront display method can display wfe as well as intensity and phase. - * Faster algorithm for calculations in the `zernike.opd_from_zernikes` function (:pr:`400` by :user:`grbrady`). Run time of this function was reduced roughly in half. + * Faster algorithm for calculations in the :py:func:`~poppy.zernike.opd_from_zernikes` function (:pr:`400` by :user:`grbrady`). Run time of this function was reduced roughly in half. * Various performance enhancements in FFTs, array rotations, zero padding, and array indexing in certain cases (:pr:`394`, :pr:`398`, :pr:`411`, :pr:`413` by :user:`mperrin`) * Bug fix to a sign inconsistency in wavefront rotation: While the documentation states that positive rotations are counterclockwise, the code had the other sign. Updated code to match the documented behavior, which also matches the rotation convention for optical elements. (:pr:`411` by :user:`mperrin`) * More robust algorithm for offset sources in optical systems with coordinate rotations and inversions (:pr:`420` by :user:`mperrin`). This ensures the correct sign of tilt is applied in the entrance pupil plane to achieve the requested source position in the output image plane. @@ -54,7 +67,6 @@ For a list of contributors, see :ref:`about`. **Software Infrastructure Updates and Internals:** - * Continuous integration system migrated to Github Actions, replacing previous use of Travis CI. (:pr:`434` by :user:`shanosborne`) * Updates to recommended (not minimum) dependency versions to track latest numpy, scipy, etc (various PRs by :user:`shanosborne`) * Updates to minimum dependency versions, generally to upstream releases as of mid-2020. (:pr:`415`, :pr:`472` by :user:`mperrin`) @@ -78,7 +90,7 @@ This release includes several updated optical element classes, bug fixes, and im **Other enhancements and fixes:** * The ShackHartmannWavefrontSensor class was refactored and improved . (:pr:`369` by :user:`fanpeng-kong`). And a unit test case for this class was added (:pr:`376` by :user:`remorgan123` in collaboration with :user:`douglase`) * Expanded documentation and example code for usage of astropy Units. (:pr:`374`, :pr:`378` by :user:`mperrin`; with thanks to :user:`keflavich’ and :user:`mcbeth`) -* Made the HexagonalSegmentedDeformableMirror class consistent with ContinuousDeformableMirror in having an 'include_factor_of_two' parameter, for control in physical surface versus wavefront error units + * Made the HexagonalSegmentedDeformableMirror class consistent with ContinuousDeformableMirror in having an 'include_factor_of_two' parameter, for control in physical surface versus wavefront error units * Bug fix for influence functions of rotated hexagonally segmented deformable mirrors. (:pr:`371` by :user:`mperrin`) * Bug fix for FWHM measurement on integer data type images. (:pr:`368` by :user:`kjbrooks`) * Bug fix for StatisticalPSDWFE to avoid side effects from changing global numpy random generator state. (:pr:`377` by :user:`ivalaginja`) @@ -117,7 +129,6 @@ This is a minor release primarily for updates in packaging infrastructure, plus * Fix a log string formatting bug encountered in MFT propagation under certain conditions (:pr:`360` by :user:`mperrin`) **Software Infrastructure Updates and Internals:** - * Removed dependency on the deprecated astropy-helpers package framework. (:pr:`349` by :user:`shanosborne`). Fixes :issue:`355`. * Switched code coverage CI service to codecov.io. (:pr:`349` by :user:`shanosborne`) * The minimum Python version is now 3.6. (:pr:`356` by :user:`mperrin`) @@ -130,7 +141,6 @@ This is a minor release primarily for updates in packaging infrastructure, plus *2019 Nov 25* **New Functionality:** - * **Chaining together multiple propagations calculations:** Multiple `OpticalSystem` instances can now be chained together into a `CompoundOpticalSystem`. This includes mixed propagations that are partially Fresnel and partially Fraunhofer; Wavefront objects will be cast between types as needed. (:pr:`290` by :user:`mperrin`) @@ -170,7 +180,6 @@ This is a minor release primarily for updates in packaging infrastructure, plus at the end (:pr:`298` by :user:`sdwill`) **Software Infrastructure Updates and Internals:** - * PR :pr:`290` for CompoundOpticalSystem involved refactoring the Wavefront and FresnelWavefront classes to both be child classes of a new abstract base class BaseWavefront. This change should be transparent for most/all users and requires no changes in calling code. * PR :pr:`306` for wavelength-independent phase subsequently required refactoring of the optical element display code to correctly handle all cases. As a result the display code internals were clarified and made more consistent. (:pr:`314` and :pr:`321` by :user:`mperrin` with contributions from :user:`ivalaginja` and :user:`shanosborne`). Again this change should be transparent for users. * Removed deprecated / unused decorator function in WFE classes, making their `get_opd` function API consistent with the rest of poppy. (:pr:`322` by :user:`mperrin`) @@ -181,7 +190,6 @@ This is a minor release primarily for updates in packaging infrastructure, plus * Note, minimum supported versions of some upstream packages such as numpy and matplotlib have been updated. **Bug Fixes and Misc Improvements:** - * Correctly assign BUNIT keyword after rescaling OPDs (:issue:`285`, :pr:`286` by :user:`laurenmarietta`). * New header keywords in output PSF files for `OPD_FILE` and `OPDSLICE` to more cleanly record the information previously stored together in the `PUPILOPD` keyword (:pr:`316` by :user:`mperrin`) diff --git a/poppy/__init__.py b/poppy/__init__.py index ca9d7801..03d564c1 100644 --- a/poppy/__init__.py +++ b/poppy/__init__.py @@ -128,4 +128,5 @@ class Conf(_config.ConfigNamespace): #if accel_math._FFTW_AVAILABLE: # utils.fftw_load_wisdom() -__all__ = ['conf', 'Instrument', '__version__'] + utils.__all__ + poppy_core.__all__ + optics.__all__ + fresnel.__all__ + wfe.__all__ +__all__ = ['conf', 'Instrument', '__version__'] + utils.__all__ + poppy_core.__all__ + optics.__all__ + \ + fresnel.__all__ + wfe.__all__ + dms.__all__ + active_optics.__all__ diff --git a/poppy/active_optics.py b/poppy/active_optics.py index 043fc869..4a6a36cd 100644 --- a/poppy/active_optics.py +++ b/poppy/active_optics.py @@ -22,7 +22,7 @@ class TipTiltStage(poppy.poppy_core.OpticalElement): radius : astropy Quantity of dimension length radius of the circle over which to apply Zernike tip/tilt. This is used in converting angular tip/tilt to OPD in length units. - include_factor_of_two : book + include_factor_of_two : bool include factor of 2 on WFE due to reflection? In other words, if True, the applied wavefront tilt will be twice the commanded tilt of the stage. diff --git a/poppy/wfe.py b/poppy/wfe.py index 0e75b536..aeac30d3 100644 --- a/poppy/wfe.py +++ b/poppy/wfe.py @@ -874,9 +874,9 @@ class ThermalBloomingWFE(WavefrontError): affects the calculation results if isobaric=True. isobaric : bool - Wether to use the isobaric approximation. + Whether to use the isobaric approximation. - Note + Notes ------------------- Initial values are those for dry air at room temperature, taken from: https://www.engineeringtoolbox.com/dry-air-properties-d_973.html diff --git a/poppy/zernike.py b/poppy/zernike.py index 615c42c9..58ee77e2 100644 --- a/poppy/zernike.py +++ b/poppy/zernike.py @@ -980,13 +980,9 @@ def decompose_opd(opd, aperture=None, nterms=15, basis=zernike_basis, of basis arrays given arguments `nterms`, `npix`, and `outside`. Default is `poppy.zernike.zernike_basis`. - Additional keyword arguments to this function are passed - through to the `basis` callable. - - Note: Recovering coefficients used to generate synthetic/test data - depends greatly on the sampling (as one might expect). Generating - test data using zernike_basis with npix=256 and passing the result - through decompose_opd reproduces the input coefficients within <0.1%. + Other Parameters + ---------------- + Additional keyword arguments to this function are passed through to the `basis` callable. Returns ------- @@ -997,6 +993,15 @@ def decompose_opd(opd, aperture=None, nterms=15, basis=zernike_basis, wavefront is in waves, coeffs will be in waves.) Note that the first coefficient (element 0 in Python indexing) corresponds to the Z=1 Zernike piston term, and so on. + + Notes + ----- + Recovering coefficients used to generate synthetic/test data + depends greatly on the sampling (as one might expect). Generating + test data using zernike_basis with npix=256 and passing the result + through decompose_opd reproduces the input coefficients within <0.1%. + + """ if aperture is None: @@ -1127,10 +1132,11 @@ def compose_opd_from_basis(coeffs, basis=zernike_basis_faster, aperture=None, ou Default is `np.nan`, but you may also find it useful for this to be 0.0 sometimes. - Other parameters are supported via **kwargs, in particular setting the - size of the OPD via npix. + Other Parameters + ---------------- + Other parameters are supported via **kwargs, in particular setting the size of the OPD via npix. - Example + Examples -------- opd = compose_opd_from_basis([0,0,-5,1,0,4,0,8], npix=512)