Upgrade SeisBench to v0.5

This commit is contained in:
Hubert Siejkowski 2023-09-21 09:38:34 +00:00
parent 1ff9b17202
commit 0bcc1b54b2
2 changed files with 5 additions and 4 deletions

View File

@ -22,7 +22,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
]
dependencies = [
"seisbench==0.4.*",
"seisbench==0.5.*",
"click"
]
dynamic = ["version"]

View File

@ -42,7 +42,8 @@ class ModelRunner:
return obspy.read(stream_file_name)
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"
with open(fpath, "w") as fp:
@ -50,7 +51,7 @@ class ModelRunner:
def save_quakeml(self, classs_picks, stream_path):
e = Event()
for cpick in classs_picks:
for cpick in classs_picks.picks:
net, sta, loc = cpick.trace_id.split(".")
p = Pick(
time=cpick.peak_time,
@ -99,4 +100,4 @@ class ModelRunner:
self.save_picks(classs_picks, stream_path)
self.save_quakeml(classs_picks, stream_path)
return classs_picks
return classs_picks.picks