fpm op• Data kinds: image2d × image2d → table
• Call: import fullseye as fs; fs.ledger.fp_capture(amplitude, phase=None, pixel_um=0.325, wavelength_um=0.532, na_obj=0.1, downsample=4, led_pitch_mm=4.0, led_distance_mm=70.0, n_side=13, pupil_aberration=None, photons=4000.0, read_noise_e=2.0, darkfield_gain=8.0, cos_exponent=1.0, seed=0, led_offset_mm=(0.0, 0.0), led_rotation_deg=0.0, led_height_error_mm=0.0, height_um=None, pad_px=None) (to call the implementation directly, import fourierptycho; fourierptycho.fp_capture(amplitude, phase=None, pixel_um=0.325, wavelength_um=0.532, na_obj=0.1, downsample=4, led_pitch_mm=4.0, led_distance_mm=70.0, n_side=13, pupil_aberration=None, photons=4000.0, read_noise_e=2.0, darkfield_gain=8.0, cos_exponent=1.0, seed=0, led_offset_mm=(0.0, 0.0), led_rotation_deg=0.0, led_height_error_mm=0.0, height_um=None, pad_px=None); from the registry, opsoptics.get("fp_capture"))
• GPU: none (CPU reference implementation only)
Simulate the set of low-resolution images taken under oblique illumination from an LED array (table, kind="fp_stack").
Object o = amplitude · e^{i phase} (fine grid of pixel_um, square, with a side divisible by downsample). For each LED, multiply o by a tilted plane wave e^{i2π(kx x + ky y)} (fractional-pixel k is kept as is), FFT → crop the centre at the low-resolution size → pupil (circle NA_obj/λ × aberrations) → inverse FFT → |·|². So that light from outside the field of view enters, the object is drawn extended by pad_px (default = 1/4 of the side) with its edge values, and only the camera's field of view is cropped (real samples are not periodic).
• Passing height_um makes it reflective: surface height h → the round-trip phase 4πh/λ (normal-incidence approximation) is added to phase.
• LED brightness: angular Lambert order m (cos_exponent) and inverse-square distance fall-off → cos^(m+3)θ (1 at the centre).
• Exposure: 1 for bright field (NA_ill < NA_obj), darkfield_gain times for dark field (the implementation convention of exposing dark field longer).
• Noise: Poisson of photons electrons per unit background × exposure × brightness + Gaussian readout read_noise_e. Random numbers come from np.random.default_rng with seed.
• LED array misalignment (led_offset_mm / led_rotation_deg / led_height_error_mm) is applied only to the imaging, not to the table's nominal kx / ky (the true values are kx_true / ky_true).
• Sign convention of the illumination k: kx = x/(rλ), ky = y/(rλ) (LED position (x, y, z) with the sample at the origin, r = |(x, y, z)|) —— the LED's x/r is taken as +k. In a real instrument where the LEDs sit below the sample and the light travels from the LED to the sample, the physical transverse wavenumber may be −x/(rλ).
• Rejected if the low-resolution pixel = pixel_um · downsample exceeds λ/(2 NA_obj) (FP sampling condition).
Returns: dict(kind="fp_stack", images (K, n, n) electron counts, sorted by ascending illumination NA, exposure, led_brightness, photons, read_noise_e, kx, ky, kx_true, ky_true, na_illumination, led_index, led_xyz_mm (nominal), pixel_um (low resolution), wavelength_um, na_obj, pupil_true, na_synthetic_design, …).
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.
• poc_fourier_ptychography — py -3.11 examples/poc_fourier_ptychography.py
table as input)abcd_matrix · wavefront_stats · sfr_from_edge · paraxial_trace · seidel_coefficients · spot_stats · tolerance_analysis · wavefront_from_opd
fpm)fp_design · fp_usaf_target · fp_stack_from_images · fp_reconstruct · fp_element_contrast
*Provenance: fourierptycho.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.