Skip to content

Normalize scattering CDFs before inverse angle sampling - #34

Open
antonsoo wants to merge 1 commit into
scottprahl:mainfrom
antonsoo:fix/physical-scattering-cdf
Open

antonsoo wants to merge 1 commit into
scottprahl:mainfrom
antonsoo:fix/physical-scattering-cdf

Conversation

@antonsoo

Copy link
Copy Markdown

The phase sum starts above zero and overshoots one. For mu_with_uniform_cdf(1.33, .001, 4096), low-probability interpolation crosses between the first and last entries: the table contains cosines below -1, giving NaNs in arccos.

Use cumulative trapezoidal integration from zero, normalize its endpoint to one, and require two or more points. Add analytic Rayleigh/physical-angle regressions and replace the tests that pinned the old endpoint error. The fixed 2000-point integration grid and random sampler are unchanged.

Both backend suites pass on Python 3.12 and 3.14; configured lint and combined coverage pass. Droplet sampling agrees with independent native Scattnlay quadrature, preserving the original optical outputs and draws from a fixed supplied table. The installed wheel gives identical results. Other platforms and notebooks were not run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-25T20:57:43.123961Z
We couldn’t complete this review. Comment @codex review to try again.
62df1f4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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