Skip to content

feat: LineScan matched to a probe: end=None and Nyquist sampling defaults - #40

Merged
Paullo9 merged 3 commits into
mainfrom
issue-9-linescan-defaults
Oct 31, 2026
Merged

Paullo9 merged 3 commits into
mainfrom
issue-9-linescan-defaults

Conversation

@Paullo9

@Paullo9 Paullo9 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Requested by Paul · project thread

Part of #9

A line scan matched to a probe, abTEM 1.0.10 LineScan(end=None) followed by match_probe (which abTEM scan runs; the kit asks the caller to build the scan with the probe):

  • LineScan.init(start:end:gpts:sampling:endpoint:matching:): a missing end is (0, the probe grid extentY); without a sampling or a count, the sampling is 0.99 x the Nyquist sampling of the aperture and the count follows from it. A given sampling wins, as in the plain initialiser; a gpts with an end keeps its count.
  • LineScan.nyquistSampling(semiangleCutoff:wavelength:): abTEM nyquist_sampling, 1 / (4 alpha_c / lambda x 1e-3), in the same evaluation order.
  • Refused where abTEM is silent or crashes: a gpts with no end and no sampling (abTEM silently replaces the count by the probe-matched one), a probe-matched sampling of an aperture with no cutoff (abTEM raises an OverflowError). Fractional coordinates are not offered on this initialiser (the plain one has them).

Additive API, so feat:.

Numbers: Tests/SimulatoProbeTests/LineScanDefaultsTests.swift holds abTEM 1.0.10 output printed by the new tools/pins/linescan-defaults/pins.py for a 20 mrad probe at 200 keV and a 30 mrad probe at 80 keV on a 12.3 x 9.7 A grid, 7 cases each: end points and counts exact, sampling at rtol 1e-7 (the assert_allclose defaults; abTEM states no tolerance).

Not in this PR: the docs/parity.md LineScan row (still says the end=None and match_probe defaults are not offered) is left out because two open PRs already touch that file; docs/open-items.md is left for the same reason as #39 edits the same line. Both follow once those merge.

Test evidence: the new suite (3 tests) fails to compile on main (the API is new) and passes here; the gate swift test -c release --skip SimulatoKitParityTests is green locally. Reviewed by a separate reviewer pass before the commit: no must-fix, agreed with the refusal of a count without an end, extra combinations checked against abTEM; doc nits applied.

Remaining in #9: integrate_disc(interpolate:) (needs Images.interpolate in SimulatoCore), line profiles for segmented and pixelated line scans, tilt distributions.

🤖 Generated with Claude Code

…ults

LineScan.init(start:end:gpts:sampling:endpoint:matching:) ports abTEM 1.0.10 LineScan(end=None) followed by match_probe: a missing end is (0, extent of the probe grid along the second axis); without a sampling or count, the sampling is 0.99 x the Nyquist sampling of the aperture, and the count follows. A given sampling wins, a count with an end is kept. LineScan.nyquistSampling(semiangleCutoff:wavelength:) is abTEM nyquist_sampling in the same evaluation order.

Refused where abTEM is silent or crashes: a count with no end and no sampling (abTEM silently replaces it by the probe-matched count), and a probe-matched sampling of an aperture with no cutoff (abTEM raises an OverflowError).

Pinned against abTEM 1.0.10 by tools/pins/linescan-defaults/pins.py: end points and counts exact, sampling at rtol 1e-7 (assert_allclose defaults; abTEM states no tolerance). Reviewed before the commit: no must-fix; doc nits applied.

Done: LineScan probe-matched defaults. Next: Images.interpolate in SimulatoCore, then integrate_disc(interpolate:) (#9).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Paullo9 Paullo9 self-assigned this Oct 31, 2026
@Paullo9
Paullo9 merged commit 17346f9 into main Oct 31, 2026
6 checks passed
@Paullo9
Paullo9 deleted the issue-9-linescan-defaults branch October 31, 2026 18:26
Paullo9 added a commit that referenced this pull request Oct 31, 2026
…he mixed-radix FFT (#44)

parity.md: Images.interpolate gets its own row, partial (method fft, both normalizations, pinned at rtol 1e-7 by
tools/pins/image-interpolate); DiffractionPatterns.interpolate stays missing. integrate_disc names interpolate:. The Grid
row says lengths off vDSP that factor into 2, 3, 5 and 7 run the mixed-radix FFT (#42). Totals recounted from the table:
129 rows, 38 present, 40 partial, 51 missing; the study split was stale (now 12, 7, 8).

open-items.md: the FFT item names what is left after #42 (a prime factor above 7, 506 squared); the #9 item drops
integrate_disc(interpolate:) and adds the spline method.

tools/README.md: the image-interpolate generator row.

The azimuthal_average (#39) and LineScan defaults (#40) rows wait for those PRs to merge.

Done: rows for #41 and #42. Next: rows for #39 and #40 when they merge.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant