skbeam.core.speckle.xsvs

skbeam.core.speckle.xsvs(image_sets, label_array, number_of_img, timebin_num=2, max_cts=None)

This function will provide the probability density of detecting photons for different integration times.

The experimental probability density P(K) of detecting photons K is obtained by histogramming the speckle counts over an ensemble of equivalent pixels and over a number of speckle patterns recorded with the same integration time T under the same condition.

Bad images need to be represented as an array filled with np.nan. Using bad_to_nan function in mask.py the bad images can be converted into np.nan arrays.

Parameters
image_setsarray

sets of images

label_arrayarray

labeled array; 0 is background. Each ROI is represented by a distinct label (i.e., integer).

number_of_imgint

number of images (how far to go with integration times when finding the time_bin, using skbeam.utils.geometric function)

timebin_numint, optional

integration time; default is 2

max_ctsint, optional

the brightest pixel in any ROI in any image in the image set. defaults to using skbeam.core.roi.roi_max_counts to determine the brightest pixel in any of the ROIs

Returns
prob_k_allarray

probability density of detecting photons

prob_k_std_devarray

standard deviation of probability density of detecting photons

Notes

These implementation is based on following references References: text [1], text [2]

1

L. Li, P. Kwasniewski, D. Oris, L Wiegart, L. Cristofolini, C. Carona and A. Fluerasu , “Photon statistics and speckle visibility spectroscopy with partially coherent x-rays” J. Synchrotron Rad., vol 21, p 1288-1295, 2014.

2

R. Bandyopadhyay, A. S. Gittings, S. S. Suh, P.K. Dixon and D.J. Durian “Speckle-visibilty Spectroscopy: A tool to study time-varying dynamics” Rev. Sci. Instrum. vol 76, p 093110, 2005.

There is an example in https://github.com/scikit-beam/scikit-beam-examples It will demonstrate the use of these functions in this module for experimental data.