pyrost Core Classes

Robust Speckle Tracking data processing algorithm. pyrost.STData contains all the necessary data for the Speckle Tracking algorithm, and handy data processing tools to work with the data. pyrost.SpeckleTracking performs the main Robust Speckle Tracking algorithm and yields reference image and pixel mapping. pyrost.AbberationsFit fit the lens’ abberations profile with the polynomial function using nonlinear least-squares algorithm.

Examples

Extract all the necessary data using a pyrost.loader() function.

>>> import pyrost as rst
>>> loader = rst.loader()
>>> rst_data = loader.load('results/test/data.cxi')

Perform the Robust Speckle Tracking using a pyrost.SpeckleTracking object.

>>> rst_obj = rst_data.get_st()
>>> rst_res, errors = rst_obj.iter_update(sw_fs=150, ls_pm=3., ls_ri=10.,
...                                       verbose=True, n_iter=10)
Iteration No. 0: Total MSE = 0.150
Iteration No. 1: Total MSE = 0.077
Iteration No. 2: Total MSE = 0.052
Iteration No. 3: Total MSE = 0.050

Extract lens’ abberations wavefront and fit it with a polynomial.

>>> rst_data.update_phase(rst_res)
>>> fit_res = rst_data.fit_phase()
>>> fit_res['ph_fit']
array([-5.19025587e+07, -8.63773622e+05,  3.42849675e+03,  2.98523995e+01,
        1.19773905e-02])