From e6379e2cd2ed515f8c4e54151f1cb380650de8cc Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Tue, 22 Nov 2022 16:22:53 +0100 Subject: [PATCH] ZH: reconstruction pickling --- .../airshower_beacon_simulation/do_reconstruction.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/simulations/airshower_beacon_simulation/do_reconstruction.py b/simulations/airshower_beacon_simulation/do_reconstruction.py index d0f968a..bf5c452 100755 --- a/simulations/airshower_beacon_simulation/do_reconstruction.py +++ b/simulations/airshower_beacon_simulation/do_reconstruction.py @@ -12,6 +12,7 @@ import lib from lib import rit from earsim import REvent, Antenna from atmocal import AtmoCal +import pickle if __name__ == "__main__": from os import path @@ -27,7 +28,10 @@ if __name__ == "__main__": # Full reconstruction? if False: print("Full reconstruction") - res = rit.reconstruction(ev, outfile='ritdir/fig.pdf') + with open('ritdir/res.pkl', 'wb') as fp: + res = rit.reconstruction(ev, outfile='ritdir/fig.pdf', slice_outdir='ritdir/') + + pickle.dump(res, fp) sys.exit(0) # Else do single slice for original timing @@ -36,7 +40,7 @@ if __name__ == "__main__": atm = AtmoCal() X = 750 - max_clock_offset = 100 # ns + max_clock_offset = 10# ns rit.set_pol_and_bp(ev) dXref = atm.distance_to_slant_depth(np.deg2rad(ev.zenith),X,0) scale2d = dXref*np.tan(np.deg2rad(2.)) @@ -79,9 +83,11 @@ if __name__ == "__main__": fig.colorbar(sc, ax=axs[0]) # Always make sure to show the plot - finally: + except: plt.show() + if True: + fig.savefig(f"shower_plane_slice_X{X}_T{max_clock_offset}.pdf") else: