Skip to content

alaraplot shading for dominant nuclide contributions to single response plots#278

Open
eitan-weinstein wants to merge 8 commits into
svalinn:mainfrom
eitan-weinstein:alaraplot_shading
Open

alaraplot shading for dominant nuclide contributions to single response plots#278
eitan-weinstein wants to merge 8 commits into
svalinn:mainfrom
eitan-weinstein:alaraplot_shading

Conversation

@eitan-weinstein
Copy link
Copy Markdown
Contributor

@eitan-weinstein eitan-weinstein commented May 18, 2026

This PR introduces new functionality to tools/alara_output_processing/alara_output_plotting.plot_single_response() to shade regions of a decay response vs time plot to indicate the dominant nuclide contributor at those times and the relative dominance of said contribution. An example for the comparison of the Total Specific Activity vs Time for the irradiation of elemental iron between ALARA with TENDL-2017 cross-sections, ALARA with EAF-2010 cross-sections, and FISPACT-II with TENDL-2017 cross-sections looks like this:

image image

The darkness of the shading of a region corresponds to the proportion of the total response contributed by the dominant nuclide, with a higher proportion leading to a less transparent shading. Furthermore, if multiple runs are plotted comparatively, the shading is cumulative, so darker regions can also indicate agreement between runs.

I figured an addition like this would be helpful to include in our plotting module, especially to make "total" plots more informative in showing which nuclides are most prominent across cooling times.

Copy link
Copy Markdown
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

This looks like a nice features - just a couple of questions for now...

Comment thread tools/alara_output_processing/alara_output_plotting.py Outdated
Comment thread tools/alara_output_processing/alara_output_plotting.py
Comment thread tools/alara_output_processing/alara_output_plotting.py Outdated
Comment thread tools/alara_output_processing/alara_output_plotting.py Outdated
Comment thread tools/alara_output_processing/alara_output_plotting.py Outdated
Copy link
Copy Markdown
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

Just trying to simplify things a little more.

Also - is it too much to plot dominance ranges for multiple run labels on the same plot? They overlap each other and are hard to see.

Comment on lines +590 to +591
bounds[i],
bounds[i + 1],
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 doesn't seem to take advantage of the work you did to build these dominance ranges, especially since you just throw them away. I think these data structures are more complicated than they need to be.

Related, I'm not sure how you assign alpha when you have multiple adjacent regions that are dominated by the same nuclide, but with different values of dominance. If they are treated as separate regions, then maybe you don't actually need to build the dominance_ranges at all?

Comment on lines +587 to +598
for i, (nuc, dominance) in enumerate(zip(dominant_nucs, relative_max)):
for _ in dominance_ranges[nuc]:
ax.axvspan(
bounds[i],
bounds[i + 1],
color=color_map[nuc],
# Shading transparency as an inverse function of the relative
# contribution of the dominant nuclide
alpha=0.2 * dominance,
linewidth=0,
label=None
)
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 don't think you need to care about dominance_ranges in this loop - I'd recommend:

Suggested change
for i, (nuc, dominance) in enumerate(zip(dominant_nucs, relative_max)):
for _ in dominance_ranges[nuc]:
ax.axvspan(
bounds[i],
bounds[i + 1],
color=color_map[nuc],
# Shading transparency as an inverse function of the relative
# contribution of the dominant nuclide
alpha=0.2 * dominance,
linewidth=0,
label=None
)
for lower, upper, nuc, dominance in zip(bounds[:-1], bounds[1:], dominanct_nucs, relative_max):
ax.axvspan(
lower,
upper,
color=color_map[nuc],
# Shading transparency as an inverse function of the relative
# contribution of the dominant nuclide
alpha=0.2 * dominance,
linewidth=0,
label=None
)

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.

2 participants