Prysm

Latest version: v0.21.1

Safety actively analyzes 630390 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.17b1

See documentation on [RTD](https://prysm.readthedocs.io/en/v0.17b1/), especially the [release notes](https://prysm.readthedocs.io/en/v0.17b1/releases/v0.17.html). This release is a huge break to backwards compatibility, so we are going through a beta cycle before mainlining the release. Hot areas to test for:

- unexpected behavior when using nondefault units
- interactions of class instances with different units.
- Q polynomials
- errors where there shouldn't be any (i.e., internal bugs)
- unnecessary breaks (i.e. things that existed in the 0.16 API that are possible to implement as properties with warnings for 0.17 to ease the transition.)

0.16.1

see RTD for release notes

0.16

see RTD for release notes

0.15.1

This is a hotfix release that fixes an issue with the `sample_data` submodule and egg distributions. Note that prysm now dirties the `sites-packages` folder with a `prysm-sampledata` folder.

0.15

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:

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

0.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](https://docs.scipy.org/doc/numpy-1.15.1/reference/generated/numpy.pad.html) 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](http://mtfmapper.blogspot.com/) 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 `n`th 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.

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.