linescan_acquire — OPTICS linescan op

• Data kinds: image2d → table

• Call: import fullseye as fs; fs.ledger.linescan_acquire(web=None, stages=8, photons_per_stage=200.0, eta=0.6, sigma_d=20.0, K=0.1, architecture='charge', full_well_e=None, dark_e=0.0, sync_error=0.0, yaw_deg=0.0, weave_px=0.0, weave_period_lines=200.0, encoder=False, encoder_error=None, lines=None, width=None, lens=None, noise=True, order=3, samples_per_px=4.0, oversample=1, seed=0) (to call the implementation directly, import linescan; linescan.linescan_acquire(web=None, stages=8, photons_per_stage=200.0, eta=0.6, sigma_d=20.0, K=0.1, architecture='charge', full_well_e=None, dark_e=0.0, sync_error=0.0, yaw_deg=0.0, weave_px=0.0, weave_period_lines=200.0, encoder=False, encoder_error=None, lines=None, width=None, lens=None, noise=True, order=3, samples_per_px=4.0, oversample=1, seed=0); from the registry, opsoptics.get("linescan_acquire"))

Usage

Image a reflectance map *web* with a TDI line-scan camera while it is transported past the sensor (table).

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

*web*: 2-D の反射率 [0, 1] (行 = 流れ方向 MD、列 = 幅方向 CD)。1 行 = 公称の 1 ライン、1 列 = 1 画素の格子。センサ(幅 *width* 画素、既定 = web の幅から余白を除いた分)は web の中央を見る。

運動の模型(出力ライン k・段 s・段の中の時刻 u ∈ [0, 1)、τ = k + s + u):

web の進み T(τ) = ∫(1 + ε)(sync_error がスカラなら一定、1-D ならライン周期ごと —— 長さは

lines + stages 以上)、電荷の位置 r = s + u(1 周期に 1 行)、蛇行 w(τ) = weave_px·sin(2πτ/周期)。

web の行 = T(τ) − r·cos θ − x·sin θ、web の列 = x·cos θ − r·sin θ − w(τ)(x はセンサ中央からの画素)。

θ = 0・一定 ε なら行は k(1 + ε) + (s + u)ε —— optscene.linescan_capture と同じ規約で、N 段で

N·|ε| 画素の掃引(tdi_sync_mtf の閉形式)。encoder=True は web の進みからライン周期を作る

(速度の誤差が消え、ε = *encoder_error*(既定 None = 0、エンコーダの分解能の誤差)だけが残る —— encoder=False で

渡すと効かないので ValueError)。ヨーと蛇行は残る。

*oversample*(奇数、既定 1): web が 1 画素あたり何 web 画素で描かれているか。1 より大きいと、画素の開口(oversample × oversample の箱)を掛けてから標本を取る —— 細かい正弦波の板で MTF を測るときは補間の誤差が結果に混ざらないよう 5 などにする(3 次スプラインでも 0.4 c/px では補間だけで 2 割落ちる)。

時間積分は τ の一様な標本で取り、標本数は 1 段の道のり(滑り + 蛇行)から samples_per_px 点/画素で決める(完全同期なら 1 点で厳密)。補間は order(1 = 双線形、3 = 3 次スプライン、前置フィルタは 1 回だけ)。

雑音(noise=True、EMVA 1288 の線形模型): 平均電子 μ_e = Σ 段 ημ_p·R(+ 暗電流 *dark_e*/段)を Poisson 1 回で引き(Poisson の和は Poisson —— 厳密)、charge は読み出し σ_d を 1 回、digital は分散 Nσ_d² と量子化 N/12 DN² を正規雑音で(各段の丸めの近似)。full_well_e(既定 None = 飽和なし)は電荷加算では合計に、デジタル加算では 1 段の平均に掛ける。返す画像は DN = K·e(ADC の上限では切らない)。

*lens*: linescan_lens_columns の結果(列ごとの相対照度とガウスのぼけ)。光学像は運動の前に決まるので、ぼけと照度は地図に掛けてから搬送する(同じ列は同じぼけ —— 像高はセンサの列で決まる)。

返り値 dict: image (lines, width) DN / mean_e(雑音なしの期待電子)/ line_rows(各ラインの段の中央が見る web の行 [web 画素]、センサ中央の列で)/ col0(センサの列 0 が見る web の列 [web 画素])/ slip_scan / slip_cross / smear_scan_px / smear_cross_px / samples / stages / architecture。

Raises ValueError: web が 2-D の有限な [0, 1] でない / 段数・ライン数が範囲外 / ε が範囲外か長さ不足 / encoder=False で encoder_error を渡した / oversample が偶数 / 掃引・蛇行・ヨーで標本が web の外に出る(黙って端を繰り返さない)/ lens の列数が width と違う。

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_tdi_linescan — py -3.11 examples/poc_tdi_linescan.py

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

abcd_matrix · wavefront_stats · sfr_from_edge · paraxial_trace · seidel_coefficients · spot_stats · tolerance_analysis · wavefront_from_opd

Same category (linescan)

tdi_snr · tdi_sync_mtf · lens_field_profile · linescan_lens_columns · linescan_lens_example


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