Airy Disk

template<IsSpectral TSpectral>
class AiryDisk : public huira::PSF<TSpectral>

Airy disk point spread function (PSF).

Models the PSF of a circular aperture using the Airy disk formula for diffraction-limited optics.

Template Parameters:

TSpectral – The spectral type (e.g., RGB, Visible8)

Public Functions

AiryDisk(units::Meter focal_length, units::Meter pitch_x, units::Meter pitch_y, units::Meter aperture_diameter, int radius)

Constructs an AiryDisk PSF with the given optical parameters.

Parameters:
  • focal_length – The focal length of the optical system in meters.

  • pitch_x – The pixel pitch in the x direction in meters.

  • pitch_y – The pixel pitch in the y direction in meters.

  • aperture_diameter – The diameter of the circular aperture in meters.

  • radius – How far from the source, in pixels, the pattern is taken (see PSF::radius()).

Throws:

std::runtime_error – if a length is not positive and finite, the f-number is not finite, or the radius is out of range (see PSF::set_radius()).

~AiryDisk() override = default
AiryDisk(const AiryDisk&) = delete
AiryDisk(AiryDisk&&) = delete
AiryDisk &operator=(const AiryDisk&) = delete
AiryDisk &operator=(AiryDisk&&) = delete
virtual TSpectral evaluate(float x, float y) override

Evaluates the Airy disk PSF at the given pixel offset.

Computes the intensity at the specified (x, y) offset from the center, using the Airy disk formula.

Parameters:
  • x – Horizontal offset from the center in pixel coordinates.

  • y – Vertical offset from the center in pixel coordinates.

Returns:

The PSF intensity for each spectral channel.

inline virtual bool is_pixel_integrated() const

Whether evaluate() gives the light a pixel centered at (x, y) receives, rather than the PSF’s intensity at that point.

A PSF’s intensity is integrated over each pixel. One that is already integrated over a pixel (see PSFSampling::PixelIntegrated) is instead taken at each pixel’s center, so that it is not integrated twice.

inline virtual bool includes_defocus() const

Whether the PSF already holds the defocus the camera’s focus gives, rather than being a point’s in focus, which the focus then blurs as it blurs diffraction (see PSFFocus).

inline int radius() const

How far from the source, in pixels, the PSF holds light; 0 if not set, in which case CameraModel::set_psf() gives it CameraModel::DEFAULT_PSF_RADIUS.

inline void set_radius(int radius)

Set how far from the source, in pixels, the PSF holds light.

Throws:

std::runtime_error – if the radius is less than 1 or more than MAX_RADIUS.

Public Static Attributes

static constexpr int MAX_RADIUS = 4096

The largest radius a PSF can have, in pixels. On its grid (see GridPsf), a PSF is sampled more coarsely the farther it reaches, to keep within GridPsf::MEMORY_BUDGET: at this radius, only every several pixels.