spyrit.core.prep.DirectPoisson.unsplit

DirectPoisson.unsplit(x: tensor, mode: str = 'diff') tensor[source]

Unsplits measurements by combining odd and even indices.

The parameter mode can be either ‘diff’ or ‘sum’. The first one computes the difference between the even and odd indices, while the second one computes the sum.

Args:

x (torch.tensor): Measurements, can have any shape.

mode (str): ‘diff’ or ‘sum’. If ‘diff’, the difference between the even and odd indices is computed. If ‘sum’, the sum is computed. Defaults to ‘diff’.

Returns:

torch.tensor: The input tensor with the even and odd indices of the last dimension combined (either by difference or sum).