chromatic_confocal_spectrum — OPTICS confocal op

• Data kinds: table → pairs

• Call: import fullseye as fs; fs.ledger.chromatic_confocal_spectrum(probe, surface_um: 'float' = 500.0, stack=(), substrate='AL', source=None, detector=None, wl_step_nm: 'float' = 0.5, tilt_deg: 'float' = 0.0, roughness_nm: 'float' = 0.0, spectrometer_fwhm_nm: 'float' = 0.0, photons_per_peak: 'float' = 0.0, read_noise: 'float' = 0.0, seed: 'int' = 0) -> 'np.ndarray' (to call the implementation directly, import chromconf; chromconf.chromatic_confocal_spectrum(probe, surface_um: 'float' = 500.0, stack=(), substrate='AL', source=None, detector=None, wl_step_nm: 'float' = 0.5, tilt_deg: 'float' = 0.0, roughness_nm: 'float' = 0.0, spectrometer_fwhm_nm: 'float' = 0.0, photons_per_peak: 'float' = 0.0, read_noise: 'float' = 0.0, seed: 'int' = 0) -> 'np.ndarray'; from the registry, opsoptics.get("chromatic_confocal_spectrum"))

Usage

Synthesise the chromatic confocal return spectrum from the surface position and the layer stack (forward model).

> The detailed description below is the original text — the summary and the headings are translated.

戻りスペクトル S(λ) = 光源(λ) × 検出器(λ) × Σ_界面 [反射率 × 往復の透過 × 傾き・粗さ × 共焦点の軸応答(界面の見かけの位置 − 近軸焦点(λ); λ, NA(λ), LSA(λ))]、それを分光器の応答(ガウス、FWHM)でぼかし、光子のショット雑音と読出し雑音を足す。

probe: chromatic_confocal_probe の dict。波長の格子は較正の帯域を *wl_step_nm* で刻む。

surface_um: 最上面の位置(較正表の z、µm)。

stack: 最上面の下の透明な層の列 ((材料, 厚さ µm), ...)。材料は材料表の名前(GLASS_CROWN /

"PMMA" / "WATER" …)か屈折率の数。k があれば往復の吸収 exp(−4πk·2t/λ) が入る。

substrate: 最下層の下の媒質(材料表の名前 —— "AL" / "AU" / "CU" / "SI" … —— か数、

空気なら 1.0)。界面の反射率は両側の複素屈折率から垂直入射の Fresnel |(m₁ − m₂)/(m₁ + m₂)|²。

source / detector: 光源の分光分布と検出器の分光感度(pairs、帯域を覆うこと)。None は平坦。

tilt_deg: 面の傾き(全界面に共通)。鏡面成分は瞳との重なりの割合だけ戻る(sin 2θ ≥ 2NA で 0)。

roughness_nm: 面の粗さ σ(RMS)。最上面の鏡面成分は exp(−(4πσ/λ)²)、残りは Lambert で NA² だけ

戻り、点物体の応答で広がる。

spectrometer_fwhm_nm: 分光器の線幅(0 は理想)。

photons_per_peak: 0 なら雑音なしの期待値(最大を 1 に規格化)。正なら最大が平均この光子数になる

ように拡大し、Poisson のショット雑音を足す。read_noise: 読出し雑音(光子数の単位の σ)。

seed: 雑音の乱数の種(整数)。

返り値: pairs(λ [nm], 強度)。負は 0 に切る(分光器は負の光を読まない)。Raises ValueError: probe の形の誤り、帯域を覆わない source / detector、層の厚さ ≤ 0、材料表の区間外の波長、どの界面にも焦点が合わない(全部の界面が較正の範囲外)。

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)

• poc_chromatic_confocal — py -3.11 examples/poc_chromatic_confocal.py

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

mtf50 · energy_to_photons · spectral_product · spectral_integral · spectral_stats · kubelka_munk_reflectance · hyperspectral_capture · film_thickness_fft

Same category (confocal)

chromatic_confocal_probe · confocal_axial_response · chromatic_confocal_peaks · chromatic_confocal_readout · chromatic_confocal_limits


*Provenance: chromconf.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.