spyrit.core.prep.SplitPoissonRaw

class spyrit.core.prep.SplitPoissonRaw(alpha: float, meas_op)[source]

Bases: SplitPoisson

Preprocess 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 the differential measurements

\[m = \frac{y_{+}-y_{-}}{\alpha} - H1\]

and the corresponding 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 a normalisation factor, and 1 is the all-ones vector. This class also estimates the normalisation factor \(\alpha\).

Note

Contrary to SplitPoisson, the estimation of the normalisation factor is based on the mean of the raw measurement, not on the pseudo inverse of the differential mesurements.

Args:

alpha (float): maximun image intensity \(\alpha\) (in counts)

meas_op: measurement operator (see meas)

Example:
>>> H = torch.rand([400,32*32])
>>> meas_op =  LinearSplit(H)
>>> split_op = SplitPoissonRaw(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[, dim])

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.