Skip to content

Commit

Permalink
v0.0.1 upload
Browse files Browse the repository at this point in the history
  • Loading branch information
maihao14 committed Jun 8, 2021
1 parent 7d9fe4b commit 8bb7ef4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 103 deletions.
30 changes: 28 additions & 2 deletions quakelabeler/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def creatsamplename(self, stream):
creat a name for the waveform.
'''
st = str(stream[0].stats.starttime)
st_name = st[0:13]+st[15:16]+st[18:19]
st_name = st[0:13]+st[14:16]+st[17:19]

filename = stream[0].stats.network + '.' + stream[0].stats.station
if self.custom_export['single_trace'] == True:
Expand Down Expand Up @@ -708,6 +708,7 @@ def stats_figure(self):
# Set a clean upper y-axis limit.
plt.ylim(ymax=np.ceil(maxfreq / 10) * 10 if maxfreq % 10 else maxfreq + 10)
plt.savefig('MagDist.jpeg', dpi = 300)
plt.show()
#station overview
# self.inventory.plot(projection="local", label=False,
# color_per_network=True, size=20,
Expand All @@ -718,7 +719,32 @@ def waveform_display(self):
Method to display generated seismic label case to show how the label
looks like.
"""

sample = self.available_samples[-1]
st = self.fetch_waveform(sample )
print(st)
plt.figure(figsize=(8, 7.5))
num = len(st)
arr = sample['arr_point']
for j in np.arange(num):
plt.subplot(num+2,1,j+1)
plt.plot(st[j].data, 'k')
plt.axvline(arr,label=sample['ISCPHASE'],color='blue',linestyle="-")
plt.legend()
plt.ylabel(st[j].stats.channel)
bell_dist = self.output_bell_dist(st[j].stats.npts, arr, 100)
rect_dist = self.output_rect_dist(st[j].stats.npts, arr, 200)
plt.subplot(num+2,1,j+2)
plt.plot(bell_dist,label="Phase Probability",color='blue',linestyle="--")
plt.ylabel('Out: Phase Pick')
plt.legend()
plt.subplot(num+2,1,j+3)
plt.plot(rect_dist,label="Signal Probability",color='red',linestyle="--")
plt.legend()
plt.ylabel('Out: Signal Detection')
plt.suptitle("This is a Sample")
plt.xlabel('Points')
plt.savefig(sample['filename']+'.jpg', dpi=300)
plt.show()

class Interactive():
r""" Interactive tool for target stations and time range
Expand Down
3 changes: 1 addition & 2 deletions quakelabeler/scripts/QuakeLabeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def main():
custom.init()
creatlabels = QuakeLabeler(query, custom)
creatlabels.fetch_all_waveforms(creatlabels.recordings)


creatlabels.waveform_display()
creatlabels.csv_writer()
creatlabels.stats_figure()
creatlabels.subfolder()
Expand Down
99 changes: 0 additions & 99 deletions quakelabeler/tests/test_2_functions.py

This file was deleted.

0 comments on commit 8bb7ef4

Please sign in to comment.