hyri.measurement_operator.meas_op_psf#

Define a PSF-based measurement operator.

This operator uses a precomputed oversampled PSF to perform forward and adjoint compound operations that approximate the normal operator.

Class

MeasOpPSF

Represent a PSF-based measurement operator for dirty-image updates.

class hyri.measurement_operator.meas_op_psf.MeasOpPSF(u: Tensor, v: Tensor, img_size: tuple[int, int], natural_weight: Tensor = tensor([[[1.]]]), image_weight: Tensor = tensor([[[1.]]]), precond_weight: Tensor = tensor([[[1.]]]), real_flag: bool = True, device: device = device(type='cpu'), dtype: dtype = torch.float32, **kwargs: Any)#

Bases: MeasOp

Represent a PSF-based measurement operator for dirty-image updates.

This class approximates the normal operator with convolution by a cached point-spread function (PSF). A 2x field-of-view PSF is constructed once with MeasOpFinufft, transformed to Fourier space, and then reused to evaluate adjoint applications efficiently by FFT-based convolution.

Shape:
  • Image tensor – (1, 1, H, W).

  • Visibility tensor – Not used explicitly; this operator applies a PSF-based approximation in the image domain.

  • Sampling-pattern coordinates :math:`u` and :math:`v` – (1, 1, N).

_u#

Sampling u coordinates.

Type:

torch.Tensor

_v#

Sampling v coordinates.

Type:

torch.Tensor

_psf_fft#

Fourier transform of the cached 2x-FoV PSF.

Type:

torch.Tensor

Example

>>> import torch
>>> u = (2 * torch.pi) * torch.rand(1, 1, 8) - torch.pi
>>> v = (2 * torch.pi) * torch.rand(1, 1, 8) - torch.pi
>>> op = MeasOpPSF(u=u, v=v, img_size=(16, 16))
>>> image = torch.randn(1, 1, 16, 16)
>>> dirty = op.adjoint_op(image)
>>> dirty.shape
torch.Size([1, 1, 16, 16])

Initialise the PSF-convolution measurement operator.

Parameters:
  • u (torch.Tensor) – u sampling coordinates in radians.

  • v (torch.Tensor) – v sampling coordinates in radians.

  • img_size (Tuple[int, int]) – Target image size (H, W).

  • natural_weight (torch.Tensor, optional) – Natural weighting tensor. Default: torch.ones(1, 1).

  • image_weight (torch.Tensor, optional) – Imaging weighting tensor. Default: torch.ones(1, 1).

  • precond_weight (torch.Tensor, optional) – Data-space preconditioning tensor. Default: torch.ones(1, 1).

  • real_flag (bool, optional) – If True, return real adjoint outputs. Default: True.

  • device (torch.device, optional) – Execution device. Default: torch.device("cpu").

  • dtype (torch.dtype, optional) – Image-domain dtype. Default: torch.float.

  • **kwargs – Reserved for API compatibility.

forward_op(x: Tensor) → Tensor#

Return the input image unchanged.

Parameters:

x (torch.Tensor) – Image-domain input tensor.

Returns:

Unmodified input tensor.

Return type:

torch.Tensor

Note

This class approximate the compound forward-adjoint operation with convolution with PSF. The forward operation is set to identity to ensure a consistent measuerement operator interface.

adjoint_op(y: Tensor) → Tensor#

Apply FFT-domain convolution with the cached 2x-FoV PSF.

Parameters:

y (torch.Tensor) – Image-domain input tensor.

Returns:

Convolved image cropped back to the target FoV.

Return type:

torch.Tensor

Note

The input is zero-padded implicitly through the FFT size argument, multiplied by the cached PSF spectrum, and cropped to the central field of view after inverse FFT.