Upgrade SeisBench to v0.5
This commit is contained in:
parent
1ff9b17202
commit
0bcc1b54b2
@ -22,7 +22,7 @@ classifiers = [
|
|||||||
"Programming Language :: Python :: Implementation :: CPython",
|
"Programming Language :: Python :: Implementation :: CPython",
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"seisbench==0.4.*",
|
"seisbench==0.5.*",
|
||||||
"click"
|
"click"
|
||||||
]
|
]
|
||||||
dynamic = ["version"]
|
dynamic = ["version"]
|
||||||
|
@ -42,7 +42,8 @@ class ModelRunner:
|
|||||||
return obspy.read(stream_file_name)
|
return obspy.read(stream_file_name)
|
||||||
|
|
||||||
def save_picks(self, classs_picks, stream_path):
|
def save_picks(self, classs_picks, stream_path):
|
||||||
dict_picks = list(map(lambda p: p.__dict__, classs_picks))
|
#dict_picks = list(map(lambda p: p.__dict__, classs_picks))
|
||||||
|
dict_picks = classs_picks.picks
|
||||||
fpath = self.output_dir / f"{stream_path.stem}_picks.json"
|
fpath = self.output_dir / f"{stream_path.stem}_picks.json"
|
||||||
|
|
||||||
with open(fpath, "w") as fp:
|
with open(fpath, "w") as fp:
|
||||||
@ -50,7 +51,7 @@ class ModelRunner:
|
|||||||
|
|
||||||
def save_quakeml(self, classs_picks, stream_path):
|
def save_quakeml(self, classs_picks, stream_path):
|
||||||
e = Event()
|
e = Event()
|
||||||
for cpick in classs_picks:
|
for cpick in classs_picks.picks:
|
||||||
net, sta, loc = cpick.trace_id.split(".")
|
net, sta, loc = cpick.trace_id.split(".")
|
||||||
p = Pick(
|
p = Pick(
|
||||||
time=cpick.peak_time,
|
time=cpick.peak_time,
|
||||||
@ -99,4 +100,4 @@ class ModelRunner:
|
|||||||
self.save_picks(classs_picks, stream_path)
|
self.save_picks(classs_picks, stream_path)
|
||||||
self.save_quakeml(classs_picks, stream_path)
|
self.save_quakeml(classs_picks, stream_path)
|
||||||
|
|
||||||
return classs_picks
|
return classs_picks.picks
|
||||||
|
Loading…
Reference in New Issue
Block a user