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
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:
MeasOpRepresent 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
ucoordinates.- Type:
- _v#
Sampling
vcoordinates.- Type:
- _psf_fft#
Fourier transform of the cached 2x-FoV PSF.
- Type:
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) –
usampling coordinates in radians.v (torch.Tensor) –
vsampling coordinates in radians.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:
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:
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.