Including ratio plotting functionality to xs_plotting - #307
Including ratio plotting functionality to xs_plotting#307eitan-weinstein wants to merge 3 commits into
xs_plotting#307Conversation
| cross-sections were processed. | ||
| emitted (str): Particle(s) emitted from the nuclear reaction | ||
| corresponding to the MT number provided. | ||
| reference_group (str): Group name of the reference group against which |
There was a problem hiding this comment.
Separation of concerns: can't we just have a method that only does this and we can avoid encoding "(reference)" into the string?
There was a problem hiding this comment.
We could even simplify this further by not including any explicit reference tag, but rather just relying on ordering in the DSV section of the YAML. in compute_groupwise_xs_ratios(), the default option for the case when no reference is explicitly provided is to just take the first key in groupwise_dict with the command:
reference_group = reference_group or next(iter(groupwise_dict))
If we just specify in the documentation that the way to set the reference group is by placing its DSV path first amongst the DSVs in the YAML, then this can be accomplished much simpler and with cleaner inputs.
| if ratio_plotting: | ||
| nuc_dir /= 'ratio_plots' |
There was a problem hiding this comment.
If you do this, you can make the path creation below simpler
| if ratio_plotting: | |
| nuc_dir /= 'ratio_plots' | |
| ratio_suffix = "" | |
| if ratio_plotting: | |
| nuc_dir /= 'ratio_plots' | |
| ratio_suffix = "_ratios" |
| `groupwise_dict`. | ||
| """ | ||
|
|
||
| def _re_bin_xs(bin_edges, xs, midpoints): |
There was a problem hiding this comment.
We should discuss this approach. I wonder if you can put some diagrams together with all of the different cases you expect to see. Rebinning group x-sections is a fraught topic...
There was a problem hiding this comment.
Given our discussion last week and my introduction of the proposed changes in #314 that would allow us to compare directly against FISPACT-II's nuclear data, I'm going to abandon the re-binning approach. Instead, I'm going to necessitate that all ratio-plotted comparisons must have the same group bounds/nGroups so that cross-section division is unambiguously non-problematic.
Functionally follows #314, but only in DSV output formatting, not any direct code dependency.
Similar to the ratio plotting capabilities in
alara_output_processing.alara_output_plotting.py, this PR introduces new functionality toxs_plotting.pyto allow for the production of plots showing the ratios of groupwise cross-sections across different group structures. Given the inherent differences in energy group bounds/number of groups between different group structures, this PR includes a functioncompute_groupwise_xs_ratios()that constructs a union grid of the energies between both group structures and pulls the appropriate cross-sections at those energies from the existing groupwise values. Unlike the interpolation approach in #305, this is merely pulling existing cross-section values that fall within re-adjusted energy bins so that like-sized and matching-index arrays between two group structures of different sizes can be appropriately compared. These are then divided usingnp.divide().This functionality will be useful in diagnosing more precisely the effects of choice of group structure has on any given activation cross-sections.