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()fromprysm.fttoolsnow takes themodekwarg, wrapping numpy.pad in the non-constant case.prop_pupil_plane_to_psf_plane()now takes theincoherent(defaultTrue) argument. Whenincoherent=False, the (complex-valued) coherent impulse response is returned.wrap-around effects in convolutions have been reduced.
there is a new
truecircle()mask inprysm.geometrywhich has anti-aliased edges for improved simulation accuracy.read_mtfmapper_sfr_single()function inprysm.ioto read outputs from MTF Mapper with the-f --single-roiarguments.semidiameterattr onOpticalPhaseclass and subclasses (FringeZernike,Interferogram, …).show_colorbaroption onplot2d().all masks in
prysm.geometrynow take aradiusargument.prysm.interferogram.Interferogram.mask()now takes descriptive arguments, e.g.i.mask('circle', diameter=100)for a 100mm diameter circle. Themaskkwarg still exists for user-provided masks.prysm.interferogram.Interferogram.pvrfor PVr analysis.in
prysm.fringezernike:fzname()function to return the name of the nth Fringe Zernike withbase(0 or 1).fzset_to_magnitude_angle()function to convert a list of (X-Y) Zernikes to (magnitude-angle) form.FringeZernike.magnitudesproperty to accessfzset_to_magnitude_angle()on aFringeZernikeinstance.top_n()method forFringeZernikepupils to list the top n coefficients by magnitude.barplot()method forFringeZernikepupils 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 reduceFringeZernikepupils to the first n terms.truncate_topn()method to reduce to top n terms.fsandnyquistproperties on theDetectorclass for the sampling and nyquist frequencies in cy/mm.crossedparameter inSlantedEdgeconstructor to produce a “BMW target”ab_psd()function inprysm.interferogramfor inverse power law PSD curves.
Breaking Changes#
rms_normin functions related to Zernikes has been renamed tonorm. This affects thefit()function fromprysm.fringezernikeas well as theFringeZernikeclass.num_termson thefit()function is now renamed toterms.num_spokesonSiemensStarhas been renamed tospokes.num_ptsonprysm.otf.diffraction_limited_mtf()has been renamed tosamples.num_sampleshas been renamed tosamplesinprysm.propagation.pupil_sample_to_psf_sample()andpsf_sample_to_pupil_sample().the
epdkeyword argument onPupilinstances has been renamed todia. This also affects theFringeZernikeandSeidelsubclasses.prysm.interferogram.Interferogram.plot_psd_xyavg()has been renamed toplot_psd_xy_avg.
Under-the-hood Changes#
samples_x,samples_y,center_x, andcenter_yare now properties ofOpticalPhaseinstances (Pupils,Interferograms, …) instead of attrs. This helps eliminate synchronization problems when the data is modified.imwriteis used from imageio, notimsaveto follow best practice.circle()fromprysm.geometryis now exported at the top level.Detectornow defaults to 16-bit precision.import of
h5pyfor datx files is now deferred for faster imports of prysm.matplotlibis now an optional dependency and its import is deferred for faster imports of prysm.OpticalPhasenow provides default values forxaxis_label,yaxis_label, andzaxis_labelto avoid errors on subclasses. Users should still provide better values for subclasses.MaskCacheargument order has changed fromsamples, shapetoshape, 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 renamedTilt Y.Tilt (X)has been renamedTilt X.the
coefsattr onFringeZernikeinstances is now a numpy array. Piston tip and tilt can be suppressed by invokingfz.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_xandsamples_ylookup.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
Interferogramwith nometadictionary no longer causes an error.