Skip to main content
Sandbox Physics

E09 · Electron acquisition / diffraction

Raster Scan & Drift Recovery

Scan a nanograin specimen over a 6 nm grating. Set pixel spacing, dwell, flyback and drift, then compare the reference, recorded-frame average and rigidly aligned output. Switch row order to expose how acquisition time enters every pixel.

Interactive modelRaster Scan & Drift Recovery
Frame time0 s0\,\mathrm{s}
Total acquisition0 s0\,\mathrm{s}
Within-frame displacement0 nm0\,\mathrm{nm}
First-to-last frame displacement0 nm0\,\mathrm{nm}
Incident-count relative noise0 %0\,\mathrm{\%}
Common recorded coverage0 %0\,\mathrm{\%}
6 nm grating sampling—\text{—}
Expected image RMS error00
Experiment task—\text{—}

Physics tutorial

Can frame registration recover a scan-distorted image?

BackgroundScan a nanograin specimen over a 6 nm grating. Set pixel spacing, dwell, flyback and drift, then compare the reference, recorded-frame average and rigidly aligned output. Switch row order to expose how acquisition time enters every pixel.

Why it mattersMeasure how acquisition or aperture selection changes the data before interpreting the specimen.

Start with the essentials

Focus question
Can frame registration recover a scan-distorted image?
One-sentence intuition
Rigid registration estimates only one displacement per frame. This Lab supplies that displacement from the known drift, keeps within-frame warping and does not recover frequencies lost to sampling.

Core mathematical model

Time belongs to every pixel

tf,r,c=fTf+ℓ(r)Tl+(c+12)tp,Tl=Ntp+tb,Tf=NTlt_{f,r,c}=fT_f+\ell(r)T_l+(c+\tfrac12)t_p,\quad T_l=Nt_p+t_b,\quad T_f=NT_l

All times are in seconds. The line order changes under interlacing; flyback follows every line.

Signed specimen coordinates

rsample=rnominal−vt+el\mathbf r_{\mathrm{sample}}=\mathbf r_{\mathrm{nominal}}-\mathbf v t+\mathbf e_l

Positive specimen drift moves the sampled coordinate backward. Line error is an additional beam-deflection displacement.

Frame translation and strict sampling

J(r)=1Nf∑fIf(r+vtf,mid),p<6 nm2J(\mathbf r)=\frac1{N_f}\sum_f I_f(\mathbf r+\mathbf v t_{f,\mathrm{mid}}),\quad p<\frac{6\,\mathrm{nm}}2

Interpolation uses acquired data only. Missing common coverage is masked. This translation leaves within-frame distortion; the 6 nm grating must be sampled finer than 3 nm.

Common difficulties

Interpretation trap

Typical misconceptionRegistration makes every image distortion disappear.

Better mental modelRigid registration estimates only one displacement per frame. This Lab supplies that displacement from the known drift, keeps within-frame warping and does not recover frequencies lost to sampling.

Run the experiment

  1. 01

    Predict the error

    Compare Slow drifting scan with Recovery target. Predict which change affects frame duration and which only affects averaging.

    What to observe: Line flyback contributes to drift even though those intervals collect no specimen counts.
  2. 02

    Recover what translation can recover

    Toggle reference-assisted translations at the same settings; compare the recorded average and output, then increase dwell.

    What to observe: Frame offsets can be aligned. Shear within each frame remains, and aligned borders lose common coverage.
  3. 03

    Separate sampling from noise

    Use Aliasing, then reduce pixel spacing to 2 nm. Try interlacing and compare row-time plots.

    What to observe: The RMS error readout compares noiseless expectations on the sampled grid; the separate sampling flag checks the grating. More frames cannot resolve an undersampled grating. Interlacing changes time order and may introduce even/odd-row discontinuities.