spyrit.core.noise.Poisson

class spyrit.core.noise.Poisson(meas_op: Linear | LinearSplit | HadamSplit, alpha=50.0)[source]

Bases: NoNoise

Simulates measurements corrupted by Poisson noise

Assuming incoming images \(x\) in the range [-1;1], measurements are first simulated for images in the range [0; \(\alpha\)]. Then, Poisson noise is applied: \(y = \mathcal{P}(\frac{\alpha}{2} H(1+x))\).

Note

Assumes that the incoming images \(x\) are in the range [-1;1]

The class is constructed from a measurement operator and an image intensity \(\alpha\) that controls the noise level.

Args:

meas_op: Measurement operator \(H\) (see the meas submodule)

alpha (float): Image intensity (in photoelectrons)

Example 1: Using a Linear measurement operator
>>> H = torch.rand([400,32*32])
>>> linear_op = Linear(H)
>>> linear_acq = Poisson(linear_op, 10.0)
Example 2: Using a HadamSplit measurement operator
>>> H = torch.rand([400,32*32])
>>> Perm = torch.rand([32*32,32*32])
>>> split_op = HadamSplit(H, Perm, 32, 32)
>>> split_acq = Poisson(split_op, 200.0)
Example 3: Using a LinearSplit measurement operator
>>> H = torch.rand(24,64)
>>> split_row_op = LinearSplit(H)
>>> split_acq = Poisson(split_row_op, 50.0)

Methods

forward(x)

Simulates measurements corrupted by Poisson noise

reindex(x[, axis, inverse_permutation])

Sorts a tensor along a specified axis using the indices tensor.