Skip to content

Bug in QuadraticPhase? #252

@DaPhil

Description

@DaPhil

Hi,
I just discovered something I am pretty sure is a bug. Although I tried to dig deep in the source code, I just cannot see where it is coming from. Try the following:

import poppy
import astropy.units as u

wf = poppy.FresnelWavefront(beam_radius=1.0*u.m,
                            wavelength=1.0*u.m,
                            units=u.m,
                            npix=128,
                            oversample=1)
wf *= poppy.QuadraticLens(f_lens=-10*u.m)

and inspect the value of the radius of curvature. I did this by printing to the console the property z in the QuadPhase get_phasor function:

def get_phasor(self, wave):
        """ return complex phasor for the quadratic phase

        Parameters
        ----------
        wave : obj
            a Fresnel Wavefront object
        """
        print(self.z)
       ............

In the above code, I get printed out -10 m (instead of a positive value). Now change the units for the wavelength to something different, e.g. mm or so when initializing the wavefront. The output reads 986960.4401010844 m.

I tried to look at what is happening but I cannot figure it out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions