From a0bca78d5df3c1dc4fabc24203ca895a6e3b6e15 Mon Sep 17 00:00:00 2001 From: Pim Nelissen Date: Wed, 6 May 2026 00:38:17 +0200 Subject: [PATCH 1/3] add uncertainty bands in plot for sqrt(N) counting statistics --- src/pg_rad/plotting/result_plotter.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/pg_rad/plotting/result_plotter.py b/src/pg_rad/plotting/result_plotter.py index 5a76e42..d1f2f7a 100644 --- a/src/pg_rad/plotting/result_plotter.py +++ b/src/pg_rad/plotting/result_plotter.py @@ -98,13 +98,26 @@ class ResultPlotter: def _draw_counts(self, ax): x = self.count_rate_res.distance[1:] y = self.count_rate_res.integrated_counts[1:] + + yerr = np.sqrt(y) + peak_idx = y.argmax() + + ax.fill_between( + x, + y - yerr, + y + yerr, + color='red', + alpha=0.15, + ) + ax.plot( - x, y, color='r', linestyle='--', - alpha=0.2, label=f'max(counts) = {y.max():.2f}' + x, y, + color='r', linestyle='--', alpha=0.2, + label=rf'max(counts)={y[peak_idx]:.2f} $\pm$ {yerr[peak_idx]:.2f}' ) ax.legend(handlelength=0, handletextpad=0, fancybox=True) ax.scatter(x, y, color='r', marker='x') - ax.set_title('Integrated counts') + ax.set_title('Counts') ax.set_xlabel('Arc length s [m]') ax.set_ylabel('N') From adceafbec7e4996a440100ef1b1122035cae10e7 Mon Sep 17 00:00:00 2001 From: Pim Nelissen Date: Tue, 12 May 2026 08:48:42 +0200 Subject: [PATCH 2/3] update NaIR efficiencies --- src/pg_rad/data/field_efficiencies/LU_NaIR.csv | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pg_rad/data/field_efficiencies/LU_NaIR.csv b/src/pg_rad/data/field_efficiencies/LU_NaIR.csv index f5bbea2..ca48a1b 100644 --- a/src/pg_rad/data/field_efficiencies/LU_NaIR.csv +++ b/src/pg_rad/data/field_efficiencies/LU_NaIR.csv @@ -1,3 +1,5 @@ energy_keV,field_efficiency_m2 0,0 -662,0.0216 \ No newline at end of file +661.657,0.0261 +1173.228,0.0203 +1332.492,0.0166 \ No newline at end of file From fcbde3547c7b961ffe43c674db88038319140ff8 Mon Sep 17 00:00:00 2001 From: Pim Nelissen Date: Tue, 12 May 2026 08:50:42 +0200 Subject: [PATCH 3/3] remove print line --- src/pg_rad/utils/export.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pg_rad/utils/export.py b/src/pg_rad/utils/export.py index 85690c7..7beeaf4 100644 --- a/src/pg_rad/utils/export.py +++ b/src/pg_rad/utils/export.py @@ -47,7 +47,6 @@ def save_results(sim: SimulationOutput, folder_name: str) -> None: csv_name = generate_csv_name(sim) df.to_csv(f"{folder_name}/{csv_name}.csv", index=False) param_dict = generate_sim_param_dict(sim) - print(type(param_dict['detector']['is_isotropic'])) with open(f"{folder_name}/parameters.json", 'w') as f: json.dump(param_dict, f, cls=NumpyEncoder) logger.info(f"Simulation output saved to {folder_name}!")