From 1e7c469bb8b18e4750856544f7144026251f7c79 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Mon, 16 Jan 2023 17:49:40 +0100 Subject: [PATCH] ZH: fixup to 1d6f0d3b Missing path.basename for some figures and datafiles --- .../bb_measure_true_phase.py | 2 +- .../ca_period_from_shower.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/simulations/airshower_beacon_simulation/bb_measure_true_phase.py b/simulations/airshower_beacon_simulation/bb_measure_true_phase.py index a040a73..80d1817 100755 --- a/simulations/airshower_beacon_simulation/bb_measure_true_phase.py +++ b/simulations/airshower_beacon_simulation/bb_measure_true_phase.py @@ -140,7 +140,7 @@ if __name__ == "__main__": fig.colorbar(sc, ax=ax, label=color_label) if fig_dir: - fig.savefig(path.join(fig_dir, __file__ + f".residual.F{freq_name}.pdf")) + fig.savefig(path.join(fig_dir, path.basename(__file__) + f".residual.F{freq_name}.pdf")) print(f"True phases written to", antennas_fname) diff --git a/simulations/airshower_beacon_simulation/ca_period_from_shower.py b/simulations/airshower_beacon_simulation/ca_period_from_shower.py index cd5da35..1e414ea 100755 --- a/simulations/airshower_beacon_simulation/ca_period_from_shower.py +++ b/simulations/airshower_beacon_simulation/ca_period_from_shower.py @@ -339,7 +339,7 @@ if __name__ == "__main__": locs = list(zip(xx, yy)) ## Save maxima to file - np.savetxt(fig_dir + __file__+f'.maxima.run{r}.txt', np.column_stack((locs, maxima_per_loc, ks_per_loc)) ) + np.savetxt(path.join(fig_dir, path.basename(__file__)+f'.maxima.run{r}.txt'), np.column_stack((locs, maxima_per_loc, ks_per_loc)) ) if True: #plot maximum at test locations fig, axs = plt.subplots() @@ -358,11 +358,11 @@ if __name__ == "__main__": old_xlims = axs.get_xlim() old_ylims = axs.get_ylim() fig.tight_layout() - fig.savefig(path.join(fig_dir, __file__+f'.maxima.run{r}.pdf')) + fig.savefig(path.join(fig_dir, path.basename(__file__)+f'.maxima.run{r}.pdf')) if False: axs.plot(tx.x/1e3, tx.y/1e3, marker='X', color='k') fig.tight_layout() - fig.savefig(path.join(fig_dir, __file__+f'.maxima.run{r}.with_tx.pdf')) + fig.savefig(path.join(fig_dir, path.basename(__file__)+f'.maxima.run{r}.with_tx.pdf')) axs.set_xlim(*old_xlims) axs.set_ylim(*old_ylims) fig.tight_layout() @@ -375,7 +375,7 @@ if __name__ == "__main__": print('Best k:', best_k) ## Save best ks to file - np.savetxt(fig_dir + __file__+f'.bestk.run{r}.txt', best_k ) + np.savetxt(path.join(fig_dir, path.basename(__file__)+f'.bestk.run{r}.txt'), best_k ) ## Do a small reconstruction of the shower for best ks if True: @@ -424,7 +424,7 @@ if __name__ == "__main__": fname_extra = "max_amp" fig.tight_layout() - fig.savefig(path.join(fig_dir, __file__+f'.reconstruction.run{r}.{fname_extra}.pdf')) + fig.savefig(path.join(fig_dir, path.basename(__file__)+f'.reconstruction.run{r}.{fname_extra}.pdf')) # Abort if no improvement if ( r!= 0 and (old_ks_per_loc == ks_per_loc[best_idx]).all() ):