DistributionMultiTable Enhancment for CDF Sampling#405
Closed
melekderman wants to merge 6 commits intomcdc-project:devfrom
Closed
DistributionMultiTable Enhancment for CDF Sampling#405melekderman wants to merge 6 commits intomcdc-project:devfrom
melekderman wants to merge 6 commits intomcdc-project:devfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
DistributionMultiTableclass 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:
DistributionMultiTableclass 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.from_h5_groupmethod inelectron_reaction.pyto 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:
_sample_multi_tablefunction 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 changesTypes of changes
Associated Issues and PRs
Associated Developers