Skip to content

fix/ue112-rml-materials: RML import and material tables - #480

Open
Atraxus wants to merge 22 commits into
hz-b:masterfrom
Atraxus:fix/ue112-rml-materials
Open

Atraxus wants to merge 22 commits into
hz-b:masterfrom
Atraxus:fix/ue112-rml-materials

Conversation

@Atraxus

@Atraxus Atraxus commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Type of Change

  • Bug fix (non breaking change, fixing an issue)
  • New feature
  • Breaking change (fix or feature that causes existing functionality to not work as expected)
  • Documentation / Wiki update

Description

RAYX couldn't trace the UE112PGM1 beamline, and the causes mostly produced wrong numbers rather than errors. RML import ignored reflectivityType=0 and read leftover coating parameters anyway, sending an ideal mirror to the tracer as a multilayer — the failure that stopped the trace — and cast RAY-UI's integer enums straight into RAYX's, so a file requesting three discrete energies traced as a Gaussian; .DAT sampling now matches RAY-UI's nearest-node binning, checked against their source. Underneath, the material tables were broadly unsound: NFF tables were parsed but never populated, the Cromer conversion indexed mass and density by array position rather than atomic number so every element used its neighbour's values, molecule tables misread both header length and record size, and every table extrapolated past its measured range. Adds a pre-trace check that substitutes ideal geometric behaviour, with a warning, when an element's materials don't cover the source energy range. 132/132 tests; per-commit rationale in fixes-review.md. Known limits: the coverage check unions all sources and applies that to every element, skips RayListSource, and uses a ±5σ window for SoftEdge; image-plane looping and paraboloid positioning remain open and untouched.


✅ Pre-Merge Checklist

Important

By requesting a review, you confirm this PR is complete from your side. Once approved, it may be merged by someone else. Both developers and reviewers must ensure the PR is truly ready for merge when all checks are green.

Please complete each item before requesting a review.

  • Code follows the project's coding standards
  • Unit tests for new functionality are added and pass
  • All existing tests pass
  • Resolved TODO Comments (prefer new issues instead)
  • Documentation, if applicable, including:
    • Doxygen comments for any new rayx-core API functions
    • Helpful inline comments where needed for clarity
    • Wiki pages, e.g. updated build instructions, new Element etc.
  • Commits:
    • Use clear and readable commit messages (e.g. Conventional commits)
    • Squash and rebase onto master if individual commits don’t add value
    • Ensure linear commit history (required by master)

@Atraxus
Atraxus force-pushed the fix/ue112-rml-materials branch from c74c85a to a4c193a Compare September 16, 2026 16:02
@Atraxus
Atraxus force-pushed the fix/ue112-rml-materials branch 2 times, most recently from d824bdd to dd03b36 Compare September 17, 2026 14:20
@Atraxus
Atraxus force-pushed the fix/ue112-rml-materials branch from dd03b36 to 74a489f Compare September 18, 2026 11:29
@Atraxus
Atraxus force-pushed the fix/ue112-rml-materials branch from 74a489f to ffd67cf Compare September 22, 2026 13:38
@Atraxus
Atraxus marked this pull request as ready for review September 22, 2026 13:51

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