Skip to content

feat: expose March-Dollase preferred-orientation correction (TextureMarchDollase) to Python #118

Closed

Description

@cadenmyers13

Problem

libobjcryst implements March-Dollase preferred-orientation correction in TextureMarchDollase (ObjCryst/ScatteringCorr.h). Every PowderPatternDiffraction already owns one and registers it as a refinable sub-object, but it has no phases by default. pyobjcryst does not bind TextureMarchDollase, so Python users cannot add a texture phase or set its parameters.

The only current workaround is to load a TextureMarchDollase tag through XMLInput.

Proposed solution

  1. Bind TextureMarchDollase (bases RefinableObj) with AddPhase, SetPhasePar, DeletePhase, GetNbPhase, GetFraction, GetMarchCoeff, GetPhaseH/K/L.

  2. Provide access from a PowderPatternDiffraction. The member mCorrTextureMarchDollase is protected and has no public C++ accessor, so either

    • (a) add a Python-side GetTextureMarchDollase() helper that finds it in GetSubObjRegistry() by class name, or
    • (b) add a public GetTextureMarchDollase() accessor upstream in ObjCryst++ and bind it.

    Option (a) needs no upstream change. Option (b) is cleaner long-term.

Add tests that

  • add a phase with a fraction, March coefficient and hkl
  • check that its parameters are refinable
  • check that the calculated pattern changes relative to the untextured case

Activity

  1. cadenmyers13 commented on Oct 23, 2026

    @cadenmyers13
    ContributorAuthor

    Please note that I do not know C++ and that this issue was generated by Claude. I am working on rietveld refinement code through diffpy.cmi and this issue was discovered by Claude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions