ehpor / hcipy

A framework for performing optical propagation simulations, meant for high contrast imaging, in Python.
https://hcipy.org
MIT License
93 stars 31 forks source link

docstring error in FraunhoferPropagator (?) #221

Closed NuggetOfficial closed 10 months ago

NuggetOfficial commented 10 months ago

I believe I found a small error in the FraunhoferPropagator docstring. The docstring mentions that wavelength is one of the input arguments but, looking at the init of the class, it seems like this parameter is not part of the initialisation of the class.

Am I missunderstanding something? or is it a remnant from an older version of the code? Here's a copy of the code im refering to:

class FraunhoferPropagator(AgnosticOpticalElement):
    '''A monochromatic perfect lens propagator.

        This implements the propagation of a wavefront through a perfect lens. The wavefront
        is assumed to be exactly in the front focal plane of the lens and is propagated to the
        back focal plane. The implementation follows [Goodman2005]_.

        .. [Goodman2005] Goodman, J.W., 2005 Introduction to Fourier optics. Roberts and Company Publishers.

        Parameters
        ----------
        input_grid : Grid
            The grid on which the incoming wavefront is defined.
        output_grid : Grid
            The grid on which the outgoing wavefront is to be evaluated.
        **wavelength : scalar
            The wavelength of the wavefront.**
        focal_length : scalar
            The focal length of the lens system.
    '''
    def __init__(self, input_grid, output_grid, focal_length=1):
        self._input_grid = input_grid
        self._output_grid = output_grid
        self._focal_length = focal_length

        AgnosticOpticalElement.__init__(self, grid_dependent=True, wavelength_dependent=True)
syhaffert commented 10 months ago

Yes that is a remnant of the previous interface. We changed the interface and probably did not update all documentation. The wavelength parameter should be removed.

ehpor commented 10 months ago

Thanks @NuggetOfficial ! I made #222 that fixes this docstring mistake.

This was originally the center wavelength, part of a very old version of the API, before HCIPy was made open source, I think even.