Skip to content

Texture uniform odf#939

Draft
bnmajor wants to merge 1 commit into
texture-DeLaValleePoussinKernelfrom
texture-UniformODF
Draft

Texture uniform odf#939
bnmajor wants to merge 1 commit into
texture-DeLaValleePoussinKernelfrom
texture-UniformODF

Conversation

@bnmajor
Copy link
Copy Markdown
Collaborator

@bnmajor bnmajor commented Jun 3, 2026

Overview

Adds UniformODF, a constant orientation distribution function representing completely random (isotropic) texture. The ODF evaluates to a constant 1 MRD (multiples of a random distribution) for every orientation - the standard reference density for texture analysis on SO(3).

New API (additive only — no existing signatures changed)

  • hexrd.phase_transition.texture.UniformODF/hexrd.phase_transition.texture.uniform_odf:
    • .eval(orientations: np.ndarray) -> float | np.ndarray - returns a scalar 1.0 for a single (3, 3) matrix and an array of ones for any input whose shape ends in (3, 3); raises ValueError otherwise.

Tests added

  • Package export, constant 1 MRD value, and MRD convention.
  • Symmetry validation (valid + invalid crystal/sample)
  • Evaluation: single orientation (scalar), batched (N, 3, 3) and multi-dimensional (2, 2, 3, 3) inputs, and invalid-shape handling.
  • All orientations return equal values; value is 1 MRD across crystal symmetries.
  • Guard the mirrored symmetry sets against drift from WPPF's SYMLIST

Who might need to know

  • Anyone building texture/ODF functionality on hexrd.phase_transition.texture, since UniformODF establishes the ODF eval() interface contract.
  • Maintainers of hexrd.powder.wppf.texture - UniformODF mirrors (to avoid depending on WPPF) SYMLIST, and a test will fail if the crystal symmetry list there changes.

Affected Workflows

No existing workflows change behavior - this is purely additive. New texture/ODF code can now use UniformODF as a random-texture reference. Nno change to existing public APIs, CLI, or file formats.

Documentation Changes

  • No separate docs site/repo updates required; the public API is documented via docstrings

Other notes

  • Symmetry is validated and stored but intentionally inert. The uniform ODF value is constant regardless of symmetry; the arguments exist to satisfy the common ODF interface planned for the upcoming UnimodalODF work.
  • 'axial' sample symmetry was dropped. The sample set is restricted to {triclinic, monoclinic, orthorhombic} to match DeLaValleePoussinKernels supported sample symmetries. 'axial' has no current consumer.
  • Symmetry labels are mirrored from hexrd.powder.wppf.texture.SYMLIST rather than imported, to keep the new texture package decoupled from WPPF. A regression test guards against drift. If depending on WPPF is acceptable this can be changed to import the labels and the regression test can be dropped.

Depends on #926

Implement a uniform orientation distribution function representing completely random texture. The
constant value is 1 MRD (multiples of a random distribution).

- UniformODF class with crystal/sample symmetry validation
- Evaluation for single, batch, and arbitrary-shape orientations

Signed-off-by: Brianna Major <brianna.major@kitware.com>
@bnmajor bnmajor force-pushed the texture-UniformODF branch from 7c0aecb to 9359677 Compare June 3, 2026 18:10
@bnmajor bnmajor requested review from psavery and saransh13 June 3, 2026 19:28
@bnmajor bnmajor mentioned this pull request Jun 4, 2026
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