Skip to content

Pairing xs_plotting with flux data to plot radiation environment-specific reaction rates - #335

Merged
gonuke merged 4 commits into
svalinn:mainfrom
eitan-weinstein:reaction_rates_plotting
Oct 15, 2026
Merged

gonuke merged 4 commits into
svalinn:mainfrom
eitan-weinstein:reaction_rates_plotting

Conversation

@eitan-weinstein

Copy link
Copy Markdown
Contributor

Follows #307.

This PR updates xs_plotting.py to include the functionality to read in groupwise fluxes and multiply them by their associated cross-sections to produce per-nucleus reaction rates. This can be a helpful tool in assessing more specifically the effect of a cross-section distribution as it relates to a given neutron irradiation environment.

@gonuke

gonuke commented Oct 14, 2026

Copy link
Copy Markdown
Member

This needs a rebase from the recently merged PR on plotting

@eitan-weinstein
eitan-weinstein force-pushed the reaction_rates_plotting branch from 11d9b11 to ace4673 Compare October 14, 2026 17:28

@gonuke gonuke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of little clarifications...

Comment thread tools/ALARAJOYWrapper/xs_plotting.py Outdated
if ratio_plotting:
nuc_dir /= 'ratio_plots'
ratio_suffix ='_ratios'
stem_suffix ='_ratios'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overwrites the previous suffix - does this mean you can't use reaction_rates with ratio_plotting?

Comment thread tools/ALARAJOYWrapper/xs_plotting.py Outdated
Comment on lines +466 to +467
if not isinstance(fluxes, np.ndarray):
fluxes = np.asarray(fluxes, dtype=float)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do this once outside of the loop

Comment thread tools/ALARAJOYWrapper/xs_plotting.py Outdated

if ratio_plotting:
ylabel = 'Ratio of Cross-Sections'
ylabel = f'Ratio of {ylabel}'.split(' [')[0] + 's'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, are reaction_rates incompatible with ratio_plotting. If so, this may be better as an else if

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good catch. In principle, there's no reason that they should be incompatible. On the contrary, to the same extent that ratio plotting could be useful for cross-section plots, so too could they be for reaction rate plots. I'll update accordingly.

@gonuke gonuke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think one extra flux multiplication crept in during the last update.

Comment thread tools/ALARAJOYWrapper/xs_plotting.py Outdated
Comment on lines +583 to +584
if _is_rxn_rate(fluxes):
values = _xs_to_rxn_rate(values, fluxes)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a reaction rate ratio, then I don't think you want to multiply by fluxes. Both the numerator and denominator of the ratio should be multiplied by the flux, thus cancelling out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I'll fix that

@gonuke gonuke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks @eitan-weinstein

@gonuke
gonuke merged commit bdc247b into svalinn:main Oct 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants