Skip to content

Commit

Permalink
search: better defaults
Browse files Browse the repository at this point in the history
small bugfixes
  • Loading branch information
miili authored and marius committed Nov 29, 2024
1 parent f14eb36 commit e8dcfa0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Key features are of the earthquake detection and localisation framework are:
* 1D Layered velocity model
* 3D fast-marching velocity model (NonLinLoc compatible)
* Extraction of earthquake event features:
* Local magnitudes (ML), different attenuation models
* Moment Magnitudes (MW) based on modelled peak ground motions
* Local magnitudes (ML), different models
* Ground motion attributes (e.g. PGA, PGV, ...)
* Different ground motion attributes (e.g. PGA, PGV, ...)
* Automatic extraction of modelled and picked travel times
* Station Corrections
* station specific corrections (SST)
Expand Down
11 changes: 7 additions & 4 deletions src/qseek/models/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import asyncio
import logging
from contextlib import suppress
from datetime import datetime, timedelta
from functools import cached_property
from itertools import chain
Expand Down Expand Up @@ -119,10 +120,12 @@ def find_uid(self, uid: UUID, start_idx: int = 0) -> tuple[int, str]:
right_idx = start_idx + offset
if start_idx + offset >= n_lines and start_idx - offset < 0:
break
if left_idx >= 0 and find_uid in self.lines[left_idx]:
return left_idx, self.lines[left_idx]
if right_idx < n_lines and find_uid in self.lines[right_idx]:
return right_idx, self.lines[right_idx]
with suppress(IndexError):
if left_idx >= 0 and find_uid in self.lines[left_idx]:
return left_idx, self.lines[left_idx]
with suppress(IndexError):
if right_idx < n_lines and find_uid in self.lines[right_idx]:
return right_idx, self.lines[right_idx]
offset += 1

raise KeyError(f"UID {find_uid} not found in receiver cache.")
Expand Down
2 changes: 1 addition & 1 deletion src/qseek/models/station.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def weed_stations(self) -> None:
for sta in self.stations.copy():
if sta.lat == 0.0 or sta.lon == 0.0:
logger.warning(
"removing station %s: bad coordinates (%.2f, %.2f)",
"removing station %s with bad coordinates: lat %.4f, lon %.4f",
sta.nsl.pretty,
sta.lat,
sta.lon,
Expand Down
16 changes: 8 additions & 8 deletions src/qseek/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class Search(BaseModel):
description="Detection threshold for semblance.",
)
pick_confidence_threshold: float = Field(
default=0.1,
default=0.2,
gt=0.0,
le=1.0,
description="Confidence threshold for picking.",
Expand Down Expand Up @@ -310,7 +310,7 @@ class Search(BaseModel):
"the event hypocentre.",
)
detection_blinding: timedelta = Field(
default=timedelta(seconds=2.0),
default=timedelta(seconds=1.0),
description="Blinding time in seconds before and after the detection peak. "
"This is used to avoid detecting the same event multiple times. "
"Default is 2 seconds.",
Expand Down Expand Up @@ -521,6 +521,12 @@ async def prepare(self) -> None:
self.stations.prepare(self.octree)
self.data_provider.prepare(self.stations)
await self.pre_processing.prepare()
await self.ray_tracers.prepare(
self.octree,
self.stations,
phases=self.image_functions.get_phases(),
rundir=self._rundir,
)

if self.distance_weights:
self.distance_weights.prepare(self.stations, self.octree)
Expand All @@ -532,12 +538,6 @@ async def prepare(self) -> None:
self.image_functions.get_phases(),
self._rundir,
)
await self.ray_tracers.prepare(
self.octree,
self.stations,
phases=self.image_functions.get_phases(),
rundir=self._rundir,
)
for magnitude in self.magnitudes:
await magnitude.prepare(self.octree, self.stations)
await self.init_boundaries()
Expand Down

0 comments on commit e8dcfa0

Please sign in to comment.