From cdad05ecdfab50dcdb2bb49addcb4d2cdfa53308 Mon Sep 17 00:00:00 2001
From: Paul Kienzle
Date: Tue, 2 Jun 2026 15:39:26 -0400
Subject: [PATCH 1/2] tweak working on b reactions now that we compute burnup
---
activation/calculator_main.js | 2 +-
activation/index_template.html | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/activation/calculator_main.js b/activation/calculator_main.js
index 051c59b..2c601f9 100644
--- a/activation/calculator_main.js
+++ b/activation/calculator_main.js
@@ -240,7 +240,7 @@ function activation_table(act, cutoff) {
}
content += '\n';
if (some_unusual) {
- content += ' | b reaction activity is slightly underestimated; it does not include decay of transients after removal from beam. |
\n';
+ content += ' | b reactions are transitory products; activity will increase during parent burn up. |
\n';
}
content += ' \n\n';
return content;
diff --git a/activation/index_template.html b/activation/index_template.html
index bc3df84..f5da5ec 100644
--- a/activation/index_template.html
+++ b/activation/index_template.html
@@ -328,9 +328,9 @@ Thermal flux
Reaction = b : This is the beta produced daughter of an activated parent.
This is calculated only for the cases where the daughter is long lived
relative to the parent. The calculated activity is through the end of
- exposure only. Contributions from the added decay of the parent after the
- end of irradiation are left for the user to determine, but are usually
- negligible for irradiations that are long relative to the parent halflife.
+ exposure only. Contributions from the decay of the parent after the end of
+ irradiation are accumulated in the daughter, leading to an increase in daughter
+ activity until the parent burn-up is complete.
Calculation parameters are controlled by URL:
From 5a4262135b1af54876c2f37ae4b5615f96bf34d6 Mon Sep 17 00:00:00 2001
From: Paul Kienzle
Date: Tue, 2 Jun 2026 19:03:15 -0400
Subject: [PATCH 2/2] Better handling of decay time calculation failure
---
activation/calculator_main.js | 4 +++-
cgi-bin/nact.py | 11 ++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/activation/calculator_main.js b/activation/calculator_main.js
index 2c601f9..eefa5e7 100644
--- a/activation/calculator_main.js
+++ b/activation/calculator_main.js
@@ -294,7 +294,9 @@ function process_response(ldata) {
}
// Decay time
- if (act.decay_time > 0) {
+ if (act.decay_time === null) {
+ content += '
Failed to calculate decay time. Please report sample and activation parameters to paul.kienzle@nist.gov.\n';
+ } else if (act.decay_time > 0) {
content += '
Time to decay below '+act.decay_level.toExponential(4)+' μCi is '+format_time(act.decay_time)+'.\n';
}
content += '\n'
diff --git a/cgi-bin/nact.py b/cgi-bin/nact.py
index d529695..37c381d 100755
--- a/cgi-bin/nact.py
+++ b/cgi-bin/nact.py
@@ -407,7 +407,16 @@ def api_call(form: dict):
exposure=exposure,
rest_times=rest_times,
abundance=abundance)
- decay_time = sample.decay_time(decay_level)
+ try:
+ decay_time = sample.decay_time(decay_level)
+ except Exception:
+ # TODO: could return the error message rather than None
+ # TODO: what does pyodide do with logging and print statements?
+ # decay time calculator should always succeed, but the
+ # new algorithm might be unstable. Let the routine
+ # raise an error but don't shove it in the face of the
+ # user quite yet.
+ decay_time = None
total = [0]*len(sample.rest_times)
rows = []
for el, activity_el in sample.activity.items():