prysm v0.19

This release focuses on increasing the capability of prysm for multi-plane diffraction modeling and includes other improvements to quality of life.

New Features

API Fluency

  • astype() function for converting between the various object types. This can be used to dip into another type momentarily for one of its methods, e.g. chaining p = Pupil() p.astype(Interferogram).crop(...).astype(Pupil).

Propagation

In this release, prysm has gained increased capability for performing propagations outside of the pupil-to-image case. The API has also been revised for reduced verbosity and better clarity. The old API is provided with deprecations to ease transition. A demo showing more than two order of magnitude performance improvement is available Polychromatic Propagations.

  • angular_spectrum() for plane-to-plane (i.e free space) propagation via the angular spectrum method

  • angular_spectrum_transfer_function(), the transfer function of free space

  • fresnel_number() for computing the Fresnel number

  • talbot_distance() for computing the Talbot distance

  • Q_for_sampling() indicates the value of Q (or fλ/D, they are the same thing) for a given sample spacing in the psf plane

  • focus_fixed_sampling() for using matrix triple product DFTs to propagate to a fixed grid. This is useful for propagating to detector grids, and for faster polychromatic computations (since the “natural” grid depends on wavelength)

  • unfocus_fixed_sampling() mimic of focus_fixed_sampling, but from “psf” to “pupil” plane.

  • the Wavefront class has gained new functions for propagating through a system:

    • free_space() pupil -> pupil separated by some physical distance

Aliases with deprecation warnings:

Thin Film Calculation and Refractive Indices

Prysm can now do basic multi-layer thin film calculations and compute a few related values.

I/O

Prysm can now parse MTF vs Field files from Trioptics MTF-Lab v5 software. The previous parser is compatible with v4 and is untouched.

Note that the existing functions without mtflab_v5 suffixes now issue warnings that their behavior will change in v0.20. At that time, they will sense whether the file is from v4 or v5 and dispatch appropriately.

Documentation

The docstrings of the ZCacheMN class were expanded. These should aid developers in understanding the code.

Bug fixes

  • save() now flips the array before writing, rendering images in the expected orientation.

  • from_pupil() now passes the incoherent and norm arguments to the propagation engine

  • the Pupil constructor no longer ignores the phase parameter

  • the Pupil constructor no longer ignores the transmission parameter

  • Wavefront no longer errors on construction

  • zernikefit() no longer causes a memory leak

  • n_m_to_fringe() no longer begins counting fringe indices at 0 and does not mis-order azimuthal orders when radial order >14.

Removed Deprecations

  • MTF.exact_tan has been removed and was marked for removal in v0.18

  • MTF.exact_sag has been removed and was marked for removal in v0.18

  • MTF.tan has been removed and was marked for removal in v0.18

  • MTF.sag has been removed and was marked for removal in v0.18

  • RichData.slice_x has been removed and was marked for removal in v0.18

  • RichData.slice_y has been removed and was marked for removal in v0.18

  • the base kwarg which controlled whether indices start at 0 or 1 has been removed from the Zernike classes and was marked for removal in v0.19

Test Coverage

  • The integration between travis and coveralls has been fixed

  • the test suite now provides over 80% coverage and includes over 500 tests