Currently, if npix is not specified when calling propagate(), it defaults to planes[-1].shape. This works fine for propagations to a Pupil plane or (current implementations of) an Image plane. A more robust implementation will eventually be needed.
It could look something like this:
if npix is provided, it is used
If the last plane is a Pupil plane, its shape is used
If the last plane is an Image (or Detector) plane:
If min_q is 0 and npix hasn't been specified, the user clearly doesn't have precise requirements on the results. We'll compute the output plane size that will give them q = 1.5 🤷🏼♂️
If the last plane is some other type, step backwards through the list of planes to find the last plane that will define a size
Currently, if npix is not specified when calling propagate(), it defaults to
planes[-1].shape
. This works fine for propagations to a Pupil plane or (current implementations of) an Image plane. A more robust implementation will eventually be needed.It could look something like this:
min_q
is defined, we should select an output size that satisfies min_q (see https://github.com/andykee/lentil/issues/2#issuecomment-881724011)min_q
is 0 and npix hasn't been specified, the user clearly doesn't have precise requirements on the results. We'll compute the output plane size that will give them q = 1.5 🤷🏼♂️