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"))
Complex transmission function H(fx, fy) placed in the Fourier plane of a 4f system.
Returns a complex128 array in numpy.fft.fftfreq order (not fftshifted) of shape (size, size), which can be passed straight to four_f_filter. The unit of spatial frequency is cycles/um (fftfreq(size, d=pixel_pitch_um)).
*kind*:
identity
H = 1. The 4f system only forms an image —— the output is the input rotated by 180 degrees.
block
H = 0. The output is exactly zero (the Fourier plane is blocked).
derivative_x / derivative_y
H = (i*2*pi*f)**order. The output is the spatial derivative of order *order*. The lens computes the derivative in this 1 line; it is the core of optical computing.
laplacian
H = -(2*pi)**2 * (fx**2 + fy**2). Isotropic 2nd-order derivative.
lowpass / highpass
Circular aperture |f| <= radius_frac * f_nyquist (and its complement).
f_nyquist = 1/(2*pixel_pitch_um). The textbook example of spatial filtering.
hilbert_x
H = -i*sign(fx) (0 at fx = 0 and at the Nyquist bin of even lengths).
The one-sided phase makes edges stand out —— a numerical version of the schlieren method. ★The Nyquist bin is set to 0
because for even lengths fftfreq returns only -1/2 and there is no matching +1/2;
if it were kept, the output for a real even function would not satisfy odd symmetry exactly
(measured 1.6e-09 → set to 0: 2.3e-16). The standard treatment for the discrete Hilbert transform.
vortex
Vortex phase plate H = exp(i*charge*phi). *charge* is the winding number of the phase:
going 1 time around a closed loop in the Fourier plane, the phase advances by exactly 2*pi*charge
—— an integer invariant, so it can serve as a gate. ★The DC term is set to 0 (because phi is
undefined at the origin). As a result the mean drops, so the plate acts as
isotropic edge enhancement (radial Hilbert transform).
Ground truth (what this op reproduces):
• identity passed through four_f_filter matches the input rotated by 180 degrees —— measured max absolute difference 3.4e-16 (64x64 Gaussian, pixel_pitch_um=1). Not bit-identical: the FFT round trip adds 1e-16 crumbs. Short-circuiting as in zero-distance propagation would make it exact, but that would be special treatment for identity only.
• derivative_x order=1 applied to the Gaussian exp(-x**2/w**2) matches -2x/w**2 * exp(-x**2/w**2) (within the band limit).
• The winding number of vortex: the sum of phase differences along a closed loop divided by 2*pi is exactly *charge*.
• lowpass + highpass = identity (exactly 1 with the same *radius_frac*).
Raises ValueError: *kind* not in the list above / *size* below 2 or above MAX_GRID / *order* outside 0..8 / *charge* outside -32..32 / *radius_frac* 0 or less or above 1 / *pixel_pitch_um* non-positive or non-finite.
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.
• 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.
• optics_four_f_processor — py -3.11 examples/optics_four_f_processor.py
cimage as input)angular_spectrum_propagate · four_f_filter · jones_apply
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.