prysm v0.14

Version 0.14 introduces a host of new features and critical improvements to existing features of prysm. Users are encouraged to upgrade from prior releases.

With version 0.15, work will continue on improving the documentation and tests. When documentation becomes “complete” and coverage exceeds 90%, version 1.0 will be released and prysm will follow more typical semver release patterns.

New Features

  • pad2d() from prysm.fttools now takes the mode kwarg, wrapping numpy.pad in the non-constant case.

  • prop_pupil_plane_to_psf_plane() now takes the incoherent (default True) argument. When incoherent=False, the (complex-valued) coherent impulse response is returned.

  • wrap-around effects in convolutions have been reduced.

  • there is a new truecircle() mask in prysm.geometry which has anti-aliased edges for improved simulation accuracy.

  • read_mtfmapper_sfr_single() function in prysm.io to read outputs from MTF Mapper with the -f --single-roi arguments.

  • semidiameter attr on OpticalPhase class and subclasses (FringeZernike, Interferogram, …).

  • show_colorbar option on plot2d().

  • all masks in prysm.geometry now take a radius argument.

  • prysm.interferogram.Interferogram.mask() now takes descriptive arguments, e.g. i.mask('circle', diameter=100) for a 100mm diameter circle. The mask kwarg still exists for user-provided masks.

  • prysm.interferogram.Interferogram.pvr for PVr analysis.

  • in prysm.fringezernike: fzname() function to return the name of the nth Fringe Zernike with base (0 or 1).

  • fzset_to_magnitude_angle() function to convert a list of (X-Y) Zernikes to (magnitude-angle) form.

  • FringeZernike.magnitudes property to access fzset_to_magnitude_angle() on a FringeZernike instance.

  • top_n() method for FringeZernike pupils to list the top n coefficients by magnitude.

  • barplot() method for FringeZernike pupils to plot their coefficients.

  • barplot_magnitudes() method to plot their pairwise magnitudes (e.g, one bar for primary astigmatism).

  • barplot_topn() method to plot the top n coefficients only.

  • truncate() method to reduce FringeZernike pupils to the first n terms.

  • truncate_topn() method to reduce to top n terms.

  • fs and nyquist properties on the Detector class for the sampling and nyquist frequencies in cy/mm.

  • crossed parameter in SlantedEdge constructor to produce a “BMW target”

  • ab_psd() function in prysm.interferogram for inverse power law PSD curves.

Breaking Changes

  • rms_norm in functions related to Zernikes has been renamed to norm. This affects the fit() function from prysm.fringezernike as well as the FringeZernike class.

  • num_terms on the fit() function is now renamed to terms.

  • num_spokes on SiemensStar has been renamed to spokes.

  • num_pts on prysm.otf.diffraction_limited_mtf() has been renamed to samples.

  • num_samples has been renamed to samples in prysm.propagation.pupil_sample_to_psf_sample() and psf_sample_to_pupil_sample().

  • the epd keyword argument on Pupil instances has been renamed to dia. This also affects the FringeZernike and Seidel subclasses.

  • prysm.interferogram.Interferogram.plot_psd_xyavg() has been renamed to plot_psd_xy_avg.

Under-the-hood Changes

  • samples_x, samples_y, center_x, and center_y are now properties of OpticalPhase instances (Pupils, Interferograms, …) instead of attrs. This helps eliminate synchronization problems when the data is modified.

  • imwrite is used from imageio, not imsave to follow best practice.

  • circle() from prysm.geometry is now exported at the top level.

  • Detector now defaults to 16-bit precision.

  • import of h5py for datx files is now deferred for faster imports of prysm.

  • matplotlib is now an optional dependency and its import is deferred for faster imports of prysm.

  • OpticalPhase now provides default values for xaxis_label, yaxis_label, and zaxis_label to avoid errors on subclasses. Users should still provide better values for subclasses.

  • MaskCache argument order has changed from samples, shape to shape, samples, radius.

  • data from Zygo datx files is now flipped to maintain consistent orientation with the representation in Mx.

  • in prysm._zernikes, Tip (Y) has been renamed Tilt Y. Tilt (X) has been renamed Tilt X.

  • the coefs attr on FringeZernike instances is now a numpy array. Piston tip and tilt can be suppressed by invoking fz.coefs[:3] = 0; fz.build(); fz.mask(fz._mask, fz._mask_target);.

  • PSD calculation has been rewritten. PSD results are now properly normalized to be a true PSD. Prior results should be considered in error.

Bugfixes

  • fix prysm.convolution.Convolvable.show() errors when no xlim or ylim provided.

  • fix OpticalPhase.samples_x and samples_y lookup.

  • coefficients from prysm.fringezernike.fit() are no longer transposed in the Cartesian plane.

  • calling Interferogram.crop() with data spanning the entire array no longer causes an error.

  • Initializing an Interferogram with no meta dictionary no longer causes an error.