mirror of
https://github.com/Derisis13/SeismStart.git
synced 2025-12-06 19:42:49 +01:00
fix: better plotting with moonquake detection
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user