Skip to content

Commit

Permalink
Swap argument order - resolves #47
Browse files Browse the repository at this point in the history
  • Loading branch information
andykee committed Nov 2, 2023
1 parent c8c3684 commit 379aeb2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lentil/propagate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
from lentil.field import Field
from lentil.wavefront import Wavefront

def propagate_dft(wavefront, shape, pixelscale, prop_shape=None,
def propagate_dft(wavefront, pixelscale, shape=None, prop_shape=None,
oversample=2, inplace=True):
"""Propagate a Wavefront using Fraunhofer diffraction.
Parameters
----------
shape : int or (2,) tuple of ints
Shape of output Wavefront.
wavefront : :class:`~lentil.Wavefront`
Wavefront to propagate
pixelscale : float or (2,) float
Physical sampling of output Wavefront. If a single value is supplied,
the output is assumed to be uniformly sampled in both x and y.
shape : int or (2,) tuple of ints or None
Shape of output Wavefront. If None (default), the wavefront shape is
used.
prop_shape : int or (2,) tuple of ints, optional
Shape of propagation output. If None (default),
``prop_shape = prop``. If ``prop_shape != prop``, the propagation
Expand All @@ -29,12 +32,12 @@ def propagate_dft(wavefront, shape, pixelscale, prop_shape=None,
Returns
-------
wavefront : :class:`~lentil.Wavefront`
A Wavefront propagated to the specified image plane
The orioagated Wavefront
"""

ptype_out = _propagate_ptype(wavefront.ptype, method='fraunhofer')

shape = np.broadcast_to(shape, (2,))
shape = wavefront.shape if shape is None else np.broadcast_to(shape, (2,))
prop_shape = shape if prop_shape is None else np.broadcast_to(prop_shape, (2,))
shape_out = shape * oversample
prop_shape_out = prop_shape * oversample
Expand Down

0 comments on commit 379aeb2

Please sign in to comment.