spyrit.core.prep.SplitPoisson
- class spyrit.core.prep.SplitPoisson(alpha: float, meas_op)[source]
Bases:
DirectPoissonPreprocess the raw data acquired with a split measurement operator assuming Poisson noise. It also compensates for the affine transformation applied to the images to get positive intensities.
It computes
\[m = \frac{y_{+}-y_{-}}{\alpha} - H1\]and the variance
\[\sigma^2 = \frac{2(y_{+} + y_{-})}{\alpha^{2}},\]where \(y_{+} = H_{+}x\) and \(y_{-} = H_{-}x\) are obtained using a split measurement operator (see
spyrit.core.LinearSplit), \(\alpha\) is the image intensity, and 1 is the all-ones vector.- Args:
alpha (float): maximun image intensity \(\alpha\) (in counts)
meas_op: measurement operator (seemeas)- Example:
>>> H = torch.rand([400,32*32]) >>> meas_op = LinearSplit(H) >>> split_op = SplitPoisson(10, meas_op)
- Example 2:
>>> Perm = torch.rand([32,32]) >>> meas_op = HadamSplit(400, 32, Perm) >>> split_op = SplitPoisson(10, meas_op)
Methods
denormalize_expe(x, beta[, h, w])Denormalize images from the range [-1;1] to the range [0; \(\beta\)]
forward(x)Preprocess to compensates for image normalization and splitting of the measurement operator.
forward_expe(x, meas_op)Preprocess to compensate for image normalization and splitting of the measurement operator.
set_expe([gain, mudark, sigdark, nbin])Sets experimental parameters of the sensor
sigma(x)Estimates the variance of raw measurements
sigma_expe(x)Estimates the variance of the measurements that are compensated for splitting but NOT for image normalization
sigma_from_image(x, meas_op)Estimates the variance of the preprocessed measurements corresponding to images through a measurement operator
unsplit(x[, mode])Unsplits measurements by combining odd and even indices.