Skip to content

Releases: brandondube/prysm

prysm 0.15

14 Mar 17:00
Compare
Choose a tag to compare

New Features

  • Surface/Wavefront error synthesis: prysm.interferogram now contains the synthesize_surface_from_psd core method and render_synthetic_surface and Interferogram.render_from_psd convenience wrappers for synthesizing surface or wavefront data from PSD curves. Examples of this technique can be seen in e.g. E. Sidick Power Spectral Density Specification and Analysis of Large Optical Surfaces.

  • convenience wrapper Interferogram.fit_zernikes replacing zernikefit(i.phase, ...) invocation.

  • write_zygo_ascii function in prysm.io to write Zygo ASCII files.

  • Interferogram.save_zygo_ascii to write an interferogram to Zygo ASCII format.

  • zorder parameter in line-based plotting functions -- OpticalPhase.plot_slice_xy, Convolvable.plot_slice_xy, Interferogram.plot_psd_xy_avg

  • mode argument on Interferogram.plot_psd_xy_avg to switch between x axis units of spatial frequency (mode='freq') or spatial period (mode='period').

  • Interferogram.psd_slices and Interferogram.plot_psd_slices methods replacing psd_xy_avg method. Two new inquiries are azmin and azmax for the azimuthal minimum and azimuthal maximum.

  • PSF.polychromatic staticmethod to create polychromatic PSFs from ensembles of monochromatic ones. This essentially reintroduces the MultispectralPSF class's functionality from earlier versions of prysm.

  • more configuration options. prysm.config now has parameters for Q, phase_colormap, image_colormap, lw, zorder for controlling the default values of these parameters throughout the library.

  • new constants in prysm.psf -- FIRST_AIRY_ZERO, SECOND_AIRY_ZERO, AND THIRD_AIRY_ZERO as well as SECOND_AIRY_ENCIRCLED AND THIRD_AIRY_ENCIRCLED. These concern the zeros of the airy disk and how much of the total energy is contained within. They are all wrapped in AIRYDATA, a dictionary with keys of 1,2,3 and values that are length-2 tuples of (radius, encircled energy).

Beta features

  • prysm.otf.long_exposure_otf and prysm.otf.estimate_Cn for calculating the OTF (MTF) associated with a 'long' exposure through atmospheric turbulence. Note that while the equations have been implemented, the results have not been checked against published values. Please provide feedback.

Improved packaging

  • prysm now uses setup.cfg and some setuptools tricks. It now has the prysm.__version__ attribute and can be more easily scanned by crawlers without executing setup.py.

Improved documentation

  • The User's guide and Examples sections of the documentation are now jupyter notebooks and have embedded graphics and output.

  • There are several new examples.

Improved test coverage

  • Test coverage is now > 80%

breaking API changes

  • Interferogram.psd_xy_avg has been removed, its functionality is now the same as the default for Interferogram.psd_slices

  • Interferogram.plot_psd_xy_avg faces the same change for Interferogram.plot_psd_slices. Note that two calls are now needed to replicate the default behavior:

fig, ax = i.plot_psd_slices(x=True, y=True, alpha=0.4, lw=3)
fig, ax = i.plot_psd_slices(x=False, y=False, azavg=True, lw=4.5, fig=fig, ax=ax)
  • prysm.psf._airydisk has been renamed to prysm.psf.airydisk.

  • the lens submodule has been removed. This eliminates the Lens class.

  • the seidel submodule has been removed. This eliminates the Seidel class.

  • the shackhartmann submodule has been removed. This eliminates the Shackhartmann class.

  • the macros submodule has been removed. This eliminates the SystemConfig namedtuple, the thrufocus_mtf_from_wavefront and thrufocus_mtf_from_wavefront_array functions.

  • prysm.detector.generate_mtf has been removed. This function is redundant with prysm.detector.pixelaperture_analytic_otf.

  • prysm.detector.OLPF.__init__ now defaults to samples_x=0, using the analytical representation in the numerical case.

  • The great Zernike refactor of 2019:

    • prysm.fringezernike has been folded into prysm.zernike. Several functions have been renamed:
      • fit is now zernikefit called as zernikefit(... map_='fringe') (or `map_='noll')
      • magnitude/angle and name functions are now part of the zernikefuncs dictionary of dictionaries. Keys are, in order, function type and zernike order. fzname is now accessed most easily as zernikefuncs['name']['fringe']. fzset_to_magnitude_angle as zernikefuncs['magnitude_angle']['fringe']. noll` is a valid key for the nested dictionary.
      • FZCache and fzcache are nwo made redundant by ZCache and zcache. The cache takes an index into the prysm.zernikes.zernikes list, not a Fringe or Noll index. Use prysm.zernikes.maps to convert Fringe or Noll indices into prysm's zernike catalog.
    • the StandardZernike class from prysm.standardzernike has been replaced with NollZernike from prysm.zernike, or as imported from the top-level namespace.
      • NollZernike allows coefficients from 0 to 36 or 1 to 37 and has all features present in FringeZernike, unlike the prior StandardZernike class.
    • prysm._zernike is now prysm.zernike

under-the-hood changes

  • Angles of rotationally invariant terms in Fringe Zernike magnitude sets are now zero.

  • use of isfinite and isnan optimized for internal routines.

bugfixes

  • wavelength is properly captured in Pupil.from_interferogram.

  • Convolvable.from_file no longer mangles x and y units.

  • PSF.encircled_energy has been reworked, improving accuracy by about 2.3%.

  • BasicData.center_x and center_y are now properly computed. Fixes #2 .

prysm 0.14

18 Jan 01:02
Compare
Choose a tag to compare

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 attribute on OpticalPhase class and subclasses (FringeZernike, Interferogram, ...).

  • show_colorbar option on OpticalPhase.plot2d.

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

  • 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.

  • (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 analytical inverse power law PSD curves.

API 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.

  • 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 attributes. 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 attribute 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 Convolvable.show errors when no xlim or ylim provided.

  • fix OpticalPhase.samples_x and samples_y lookup.

  • coefficients from 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.

prysm 0.13.1

16 Dec 04:11
Compare
Choose a tag to compare

Hotfix for importerror in 0.13

prysm 0.13

16 Dec 00:22
Compare
Choose a tag to compare

This release brings a number of new features and enhancements. Users are encouraged to upgrade from older releases.

New Features

  • SlantedEdge object for image simulation

  • deconv method on the Convolvable class to perform Wiener-Hunt deconvolution

  • convenience properties on OpticalPhase (FringeZernike, Interferogram, ...) and Convolvable objects

    • shape, diameter_x, diameter_y, and diameter on the former
    • shape, support_x, support_y, and support on the latter
  • std property for the standard deviation in OpticalPhase instances and strehl for the approximate Strehl ratio for Pupil instances

  • band-limited RMS evaluation on Interferogram objects based on a 2D PSD calculation

  • analytical Fourier transform on the AiryDisk class for faster convolutions

  • flexible linewidth in many plots, log scaling on 2D PSF plots

  • residual parameter in the fit function from the fringezernike module

  • azimuthally averaged MTF via the azimuthal_average method on the MTF class

  • convolvables can now be saved with 16-bit precision

Under-the-hood changes and bug fixes

  • Interferogram instances no longer cache PSD calculations internally

  • The wavefunction associated with an optical pupil is now a property, (Pupil).fcn instead of an attribute. It will be calculated on an as-needed basis which eliminates synchronization problems when Pupil instances are modified.

  • FZCache and MCache for Fringe Zernikes and masks now implement __call__, you can use mcache(128, 'hexagon') instead of mcache.get_mask(128, 'hexagon') and the equivalent for zcache.

  • importing of zygo datx files is now more robust. Files from the NexView NX2 now import properly

  • Convolvable is now exported at the top level

  • Convolvable.from_file no longer errors. Users must now scale the data after importing on their own, e.g. Convolvable.data /= 255 for an 8 bit per pixel file, or /= 65535 for a 16-bit file

Remove features

  • bandreject_filter has been removed on the Interferogram class; the implementation was not well done and the results of low quality.

  • MultispectralPSF an RGBPSF have been dropped; they have been neglected for a significant amount of time. MultispectralPSF only differed from a PSF in the call to __init__, users can replicate this behavior independently.

prysm v0.12.2

02 Sep 02:48
Compare
Choose a tag to compare

prysm v0.12.1

21 Aug 02:21
Compare
Choose a tag to compare
+ TOC user guide on index