moire_overlay_image — OPTICS moire_align op

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

• Call: import fullseye as fs; fs.ledger.moire_overlay_image(shape=(256, 1024), pixel_um=0.5, p_mask_um=2.0, p_wafer_um=2.04, shift_nm=0.0, layout='single', profile='square', duty=0.5, blur_sigma_um=1.5, gap_um=0.0, wavelength_um=None, drift_nm=0.0, illum_gradient=0.0, noise_sigma=0.0, seed=0, moving='wafer', n_harmonics=15, allow_aliasing=False, with_mask=True) (to call the implementation directly, import moirealign; moirealign.moire_overlay_image(shape=(256, 1024), pixel_um=0.5, p_mask_um=2.0, p_wafer_um=2.04, shift_nm=0.0, layout='single', profile='square', duty=0.5, blur_sigma_um=1.5, gap_um=0.0, wavelength_um=None, drift_nm=0.0, illum_gradient=0.0, noise_sigma=0.0, seed=0, moving='wafer', n_harmonics=15, allow_aliasing=False, with_mask=True); from the registry, opsoptics.get("moire_overlay_image"))

Usage

Synthesises the camera image of two overlaid gratings (an alignment mark).

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

像 = [マークの強度(マスクの格子の像 × ウェハの格子の反射率)] をガウスのぼけ(MTF exp(−2π²σ²f²))と画素の積分(sinc)で撮ったもの。格子はフーリエ級数で持つので、ぼけと画素は閉形式(打ち切りの誤差は n_harmonics と項の大きさの床 1e-12 だけ)。ギャップ gap_um > 0 ではマスクの像を moire_talbot_gap と同じく optics.angular_spectrum_propagate で伝搬する(0/1 の格子だけ、波長 wavelength_um が要る —— ギャップが 0 なら使わない)。ぼけが格子のピッチを潰すので、像に残るのは差の周波数の縞(モアレ)だけになる —— これが位置合わせのマークの要点。

layout:

"single" 全面が 1 対(マスク p_m、ウェハ p_w)、線は縦、x のずれを読む。

"differential" 上半分 = 対 A(p_m, p_w)、下半分 = 対 B(ピッチを入れ替え)。ずれで 2 つの縞は逆に動き、

マーク全体の流れ(drift_nm)では同じ向きに動く。

"quad" 4 象限: 左上 A_x、右上 B_x、左下 A_y、右下 B_y(下は線が横で y のずれ)。

shift_nm と drift_nm は (x, y) の組でもよい。

with_mask=False はマスクを外してウェハの格子だけを撮った直接の像(比べ手の相互相関に使う。ピッチ 2 µm の格子はぼけで消えて一様な灰色になる —— 直接の像ではずれが見えない、を示す)。縞の周期の検査はしない。shift_nm は moving(既定 "wafer")の格子のずれ。drift_nm はマーク全体(2 枚とも)がカメラに対して動いた量。illum_gradient は視野の端から端までの照明の傾き(相対、x と y に同じ量)、noise_sigma は加える白色ガウス雑音の標準偏差(強度の単位。0/1 の格子 2 枚で平均は 0.25)。

Raises ValueError: 同じピッチ、縞の周期が 2 画素未満(ナイキスト超え)、区画に縞が 1 周期も入らない、ぼけで消えきらない格子の周波数がナイキストを超える(allow_aliasing=True で許す —— 実際のカメラでは折り返して縞に混ざる)、ギャップがあるのに profile が "sine"、綴り違い、形が小さすぎる。

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_moire_alignment — py -3.11 examples/poc_moire_alignment.py

• poc_moire_screen — py -3.11 examples/poc_moire_screen.py

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

fraunhofer_pattern · pupil_psf · pupil_blur · psf_to_mtf · edge_spread · veiling_glare_index · emva_pair_statistics · emva_defect_pixels

Same category (moire_align)

moire_magnification · moire_talbot_gap · moire_phase · moire_phase_to_shift · moire_differential_shift · moire_mark_read · moire_phase_crlb


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