diff --git a/detect_in_testing.py b/detect_in_testing.py index 2509643..b91c99d 100644 --- a/detect_in_testing.py +++ b/detect_in_testing.py @@ -13,11 +13,13 @@ def process_file(file: str, matched_filter, outfolder): st = read(file) arrival, likelyhood = detect_moonquakes.do_detection(st, matched_filter) outfile = outfolder.joinpath(path.basename(file) + "_correlation.svg") - fig,ax = plt.subplots(1,1,figsize=(10,3)) + fig,ax = plt.subplots(1,1,figsize=(20,6)) ax.plot(st.traces[0].times(), likelyhood) ax.axvline(x = arrival, color='green',label='Est. Arrival') - ax.set_xlabel("Likelyhood of event") - ax.set_ylabel("Time [sec]") + ax.legend(loc='upper left') + ax.set_ylabel('Likelyhood of activity') + ax.set_xlabel('Time (s)') + ax.set_title(f'Correlation of seismic data with average sample.', fontweight='bold') # plt.show() plt.savefig(outfile) plt.close(fig) diff --git a/detect_moonquakes.py b/detect_moonquakes.py index d8d96d9..d645690 100644 --- a/detect_moonquakes.py +++ b/detect_moonquakes.py @@ -31,11 +31,15 @@ def main(): estimated_arrival, likelyhood = do_detection(st, matched_filter) print(arrival - estimated_arrival) # Plot trace - outfile = outfolder.joinpath(test_filename + "_correlation.svg") - fig,ax = plt.subplots(1,1,figsize=(10,3)) + outfile = outfolder.joinpath(test_filename + "_correlation.png") + fig,ax = plt.subplots(1,1,figsize=(20,6)) ax.plot(st.traces[0].times(), likelyhood) ax.axvline(x = arrival, color='red',label='Rel. Arrival') ax.axvline(x = estimated_arrival, color='green',label='Est. Arrival') + ax.legend(loc='upper left') + ax.set_ylabel('Likelyhood of activity') + ax.set_xlabel('Time (s)') + ax.set_title(f'Correlation of seismic data with average sample.', fontweight='bold') # plt.show() plt.savefig(outfile) plt.close(fig)