Skip to content

DistributionMultiTable Enhancment for CDF Sampling#405

Closed
melekderman wants to merge 6 commits intomcdc-project:devfrom
melekderman:refactoring/e-PDFtoCDF
Closed

DistributionMultiTable Enhancment for CDF Sampling#405
melekderman wants to merge 6 commits intomcdc-project:devfrom
melekderman:refactoring/e-PDFtoCDF

Conversation

@melekderman
Copy link
Copy Markdown
Member

@melekderman melekderman commented Apr 17, 2026

This pull request introduces support for a new "direct-CDF" sampling mode for electron data, particularly data written from ACE files, in addition to the existing PDF-based mode. It updates the DistributionMultiTable class and its consumers to handle both modes, and modifies the sampling logic to correctly process direct-CDF tables. The changes are primarily focused on improving compatibility and accuracy for electron-related data structures and sampling routines.

Support for direct-CDF mode in distribution handling and sampling:

  • Updated the DistributionMultiTable class to accept either a PDF (default) or a CDF directly, enabling "direct-CDF" mode for electron data. When a CDF is provided, the PDF is set to an empty array and the CDF is used as-is.
  • Modified the from_h5_group method in electron_reaction.py to detect and use the direct-CDF mode when a "CDF" entry is present in the HDF5 group, both for secondary electron energy distributions and scattering cosine distributions. [1] [2]

Sampling logic enhancements:

  • Refactored the _sample_multi_table function to support both direct-CDF and PDF-based sampling. The function now checks if the PDF is empty (direct-CDF mode) and performs linear interpolation between values using the CDF, or uses the existing PDF-based sampling logic otherwise. Special handling for degenerate tables (single value) is also added.## Summary of changes

Types of changes

  • New feature (non-breaking change which adds functionality)

Associated Issues and PRs

Associated Developers

@melekderman melekderman changed the title DistributionMultiTable Enhancment for CDF ampling DistributionMultiTable Enhancment for CDF Sampling Apr 17, 2026
@melekderman melekderman marked this pull request as draft April 17, 2026 20:52
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