Skip to content

Commit ab53c05

Browse files
committed
Fix count rate bug for post processing
1 parent 4f30d8a commit ab53c05

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

mosden/countrate.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ def _count_rate_from_groups(self) -> dict[str: list[float]]:
9797
else:
9898
raise NotImplementedError(msg)
9999

100+
irrad_index = self.get_irrad_index(False)
101+
if self.post_irrad_only:
102+
use_times = self.decay_times
103+
else:
104+
use_times = self.use_times[irrad_index+1:]
105+
100106
parameters = np.zeros(grouper.num_groups * 2, dtype=object)
101107
for i in range(grouper.num_groups):
102108
yield_val = ufloat(
@@ -113,10 +119,9 @@ def _count_rate_from_groups(self) -> dict[str: list[float]]:
113119
counts = fit_function(self.decay_times, parameters)
114120
count_rate = np.asarray(unumpy.nominal_values(counts), dtype=float)
115121
sigma_count_rate = np.asarray(unumpy.std_devs(counts), dtype=float)
116-
irrad_index = self.get_irrad_index(False)
117122

118123
data = {
119-
'times': self.use_times[irrad_index+1:],
124+
'times': use_times,
120125
'counts': count_rate,
121126
'sigma counts': sigma_count_rate
122127
}

0 commit comments

Comments
 (0)