fullseye

pupil_psf — OPTICS wave op

使い方

Diffraction PSF of an arbitrary pupil shape with defocus (sums to 1).

pupil is a square (n, n) amplitude transmittance (0 = opaque, 1 = clear; a binary mask is the usual case) drawn on a grid whose full width is the pupil’s clear diameter D — so a circle filling the grid is a conventional round stop, a W-shaped band or an off-axis hole inside the grid is just a different mask, and f_number = f / D refers to that full width in every case. The wavefront over the grid is W(rho) = defocus_waves * rho^2 (+ opd_waves) with rho the radius from the grid centre normalised to 1 at the grid half-width (the Seidel defocus W20; :func:defocus_from_shift converts an axial shift to it), and the PSF is the Fraunhofer intensity of the pupil function

``PSF = | FFT{ pupil * exp(i 2 pi W) } |^2``

on a zero-padded M x M grid, M = n * oversample (rounded up to even), centred on sample M//2 and normalised to unit sum. The image plane sample spacing is

``dx = lambda * N * n / M  ~= lambda * N / oversample``  [um]

— with pixel_pitch_um the fine PSF is area-integrated onto detector pixels of that pitch (odd (K, K), centred on a pixel, unit sum), which is what an image convolution needs; the pitch must not be finer than dx. Without it the fine PSF is returned and dx is yours to compute from the formula (an image cannot carry it).

Returns a float64 image2d.

Ground truth it reproduces (measured, tests/test_optics.py):

Raises ValueError: pupil is not 2-D, not square, smaller than 2x2, over the size cap, complex, masked or non-finite; negative transmittance; an all-opaque pupil (nothing to diffract, the normalisation would be 0/0); opd_waves not the same shape as pupil; non-finite defocus_waves; non-positive or non-finite wavelength_um / f_number / pixel_pitch_um; oversample outside [1, 64]; an FFT side over :data:MAX_PUPIL_FFT; an aliased phase — more than :data:MAX_WAVES_PER_SAMPLE waves between neighbouring pupil samples (the message says how many samples the grid needs); a pixel pitch finer than the fine sample spacing (raise oversample).

Scalar Fraunhofer optics: no polarisation, no high-NA obliquity, no pupil apodisation by the lens itself. The defocus term is the paraxial rho^2 (see :func:defocus_from_shift). A pupil that reaches the grid edge is fine (the zero padding is the field stop); a pupil larger than the grid cannot be expressed — widen the grid and lower f_number.

ファミリ共通の入力契約(fail-closed)

optics の全 op は入力を検証してから計算する(黙って通さない):

詳しい使い方ガイド

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(image2d を入力に取れる)

fraunhofer_pattern · pupil_blur · psf_to_mtf · illumination_uniformity · render_through_lens · surface_defect · defocus_blur

同カテゴリ(wave)

airy_pattern · angular_spectrum_propagate · fraunhofer_pattern · gaussian_beam · defocus_from_shift · pupil_blur


Provenance: optics.py — OPTICS operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.