Skip to content

feat: expose ReflectionProfileDoubleExponentialPseudoVoigt (TOF profile) to Python #117

Closed

Description

@cadenmyers13

Problem

libobjcryst provides a double-exponential pseudo-Voigt profile for time-of-flight neutron data, ReflectionProfileDoubleExponentialPseudoVoigt (ObjCryst/ReflectionProfile.h), but pyobjcryst does not bind it. src/extensions/reflectionprofile_ext.cpp only exposes ReflectionProfilePseudoVoigt, ReflectionProfilePseudoVoigtTCH and ReflectionProfilePseudoVoigtAnisotropic.

Other TOF support is already available from Python (the WAVELENGTH_TOF enum, PowderPattern.ImportPowderPatternTOF_ISIS_XYSigma, and the internal TOF intensity correction), so the missing profile is the main thing preventing TOF Rietveld refinement from Python. Currently the only way to use it is to load a ReflectionProfileDoubleExponentialPseudoVoigt tag via XMLInput.

Proposed solution

Add a class_<ReflectionProfileDoubleExponentialPseudoVoigt, bases<ReflectionProfile>> binding in reflectionprofile_ext.cpp, following the same pattern as the ReflectionProfilePseudoVoigtTCH binding added in #115:

  • constructors () and (const UnitCell&)
  • CreateCopy
  • SetProfilePar(instrumentAlpha0, instrumentAlpha1, instrumentBeta0, instrumentBeta1, gaussianSigma0, gaussianSigma1, gaussianSigma2, lorentzianGamma0, lorentzianGamma1, lorentzianGamma2) with keyword args

Add tests that

  • construct the profile and assign it with PowderPatternDiffraction.SetProfile
  • check that the refinable parameters are visible by name
  • check that a TOF pattern computed with it is non-zero and changes when a profile parameter changes

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