fourier_plane_filter — OPTICS wave op

• Data kinds: none → cimage (an op determined by its arguments alone — it takes no image or data input)

• Call: import fullseye as fs; fs.ledger.fourier_plane_filter(size=64, kind='derivative_x', order=1, charge=1, radius_frac=0.25, pixel_pitch_um=1.0) (to call the implementation directly, import optics; optics.fourier_plane_filter(size=64, kind='derivative_x', order=1, charge=1, radius_frac=0.25, pixel_pitch_um=1.0); from the registry, opsoptics.get("fourier_plane_filter"))

Usage

> This operator's description has not been translated yet. The original text follows as it is.

4f 系のフーリエ面に置く複素透過関数 `H(fx, fy)`。

返るのは `numpy.fft.fftfreq` の並び(fftshift しない)の complex128

`(size, size) で、:func:four_f_filter` にそのまま渡せる。空間周波数の

単位は cycles/um(`fftfreq(size, d=pixel_pitch_um)`)。

*kind*:

`identity`

`H = 1`。4f 系は結像するだけ —— 出力は入力の 180 度回転になる。

`block`

`H = 0`。出力は厳密にゼロ(フーリエ面を塞いだ状態)。

`derivative_x / derivative_y`

`H = (i*2*pi*f)**order`。出力は *order* 階の空間微分。**レンズが

微分を計算する**のがこの 1 行で、光コンピューティングの核である。

`laplacian`

`H = -(2*pi)**2 * (fx**2 + fy**2)`。等方な 2 階微分。

`lowpass / highpass`

`|f| <= radius_frac * f_nyquist` の円形開口(と、その補集合)。

`f_nyquist = 1/(2*pixel_pitch_um)`。空間フィルタリングの教科書例。

`hilbert_x`

`H = -i*sign(fx)(fx = 0` と、偶数長のナイキストのビンは 0)。

片側位相で縁が立つ —— シュリーレン法の数値版。★ナイキストを 0 に

するのは、`fftfreq が偶数長で -1/2 だけを返し対になる +1/2`

が無いためで、残すと実数偶関数の出力が奇対称を厳密に満たさない

(実測 1.6e-09 → 0 にして 2.3e-16)。離散ヒルベルト変換の標準的な扱い。

`vortex`

`H = exp(i*charge*phi)` の渦位相板。*charge* は位相の巻き数で、

フーリエ面の閉路を 1 周すると位相が厳密に `2*pi*charge` 進む

—— 整数の不変量なので門にできる。★DC 項は 0 にする(`phi` が

原点で定義されないため)。結果として平均が落ちるので、この板は

等方な縁強調(半径方向ヒルベルト変換)として働く。

真値(この op が再現するもの):

• `identity は four_f_filter` を通すと入力の 180 度回転に一致 —— 実測で

最大絶対差 3.4e-16(64x64 のガウシアン、`pixel_pitch_um=1`)。**ビット一致

ではない**: FFT の往復が 1e-16 の屑を乗せる。ゼロ距離伝搬のように

短絡すれば厳密にできるが、それは `identity` だけの特別扱いになる。

• `derivative_x order=1 をガウシアン exp(-x**2/w**2)` に当てると

`-2x/w**2 * exp(-x**2/w**2)` に一致(帯域制限の範囲で)。

• `vortex の巻き数は閉路上の位相差の和を 2*pi` で割って厳密に *charge*。

• `lowpass + highpass = identity`(同じ *radius_frac* で厳密に 1)。

Raises `ValueError`: *kind* が上の一覧に無い / *size* が 2 未満または

:data:MAX_GRID 超 / *order* が 0..8 の外 / *charge* が -32..32 の外 /

*radius_frac* が 0 以下または 1 超 / *pixel_pitch_um* が非正・非有限。

Family-wide input contract (fail-closed)

Every optics op validates its input before computing (nothing slips through silently):

• Units are baked into the argument name — _mm / _um / _deg / _mrad. Confusing mm with µm does not crash; it yields a plausible-looking wrong answer, so the name prevents it. Nothing here guesses the unit from the magnitude.

• **Strings raise ValueError** — float('50') succeeds, so an unparsed configuration value would slip through as a length (measured: thin_lens('50', '200') returned a plausible 66.667 mm). bool is refused too, as the implicit promotion True == 1.

• **complex / masked arrays raise ValueError (real-valued slots only; silently dropping the imaginary part or peeling off the mask is refused). NaN/Inf raises ValueError on every input.**

• Division by zero and its relatives are refused by name: focal length 0, radius of curvature 0, refractive index <= 0, a fully opaque aperture (all zeros, so the normalisation is 0/0), a PSF whose sum is <= 0, a Stokes vector with S0 = 0, and an object sitting at the front focal point (the image is at infinity).

• Only two ops return a non-finite value, and both state it as a contract: depth_of_field returns far_mm = inf beyond the hyperfocal distance (that is what the hyperfocal distance means), and gaussian_beam returns wavefront_radius_mm = inf at the waist (the radius of curvature of a plane wavefront). Both also return a finite companion (far_is_infinite / curvature_per_mm). **Any other silent NaN/Inf is detected internally and raises ValueError** — "float64 overflowed" and "the answer is infinite" are different claims, so the first is never returned wearing the face of the second.

• Size caps: generated grids are capped by optics.MAX_GRID (4096); supplied fields/PSFs/apertures by optics.MAX_FIELD_ELEMENTS (2^24); ABCD element chains by optics.MAX_SYSTEM_ELEMENTS (1024); Zernike by MAX_ZERNIKE_TERMS (512) / MAX_ZERNIKE_ORDER (40) / MAX_ZERNIKE_BASIS (2^25). This closes, fail-closed, the paths where a small argument triggers a huge internal allocation (measured: n_max=40 × 4096² needs 108 GB).

• Physically impossible states are refused too: a Stokes vector with degree of polarisation > 1, negative transmittance, negative intensity, and invalid Zernike indices such as n-|m| odd.

Detailed usage guide

• optics_imaging family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• optics_four_f_processor — py -3.11 examples/optics_four_f_processor.py

Ops the type connects to (they accept cimage as input)

angular_spectrum_propagate · four_f_filter · jones_apply

Same category (wave)

airy_pattern · angular_spectrum_propagate · fraunhofer_pattern · four_f_filter · gaussian_beam · defocus_from_shift · pupil_psf · pupil_blur


*Provenance: optics.py — OPTICS operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

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