Search volume¶
The search volume is the region where Qseek looks for earthquakes; you configure it in the octree of the search. You place it with a center location and its bounds in east, north and depth direction, relative to the center. Qseek divides the volume into root nodes and refines the nodes around detected events, see octree refinement.

The octree refines around a seismic source, from level 0 with 5977 nodes to level 2 with 6812 nodes. Map view (top) and depth section (bottom) of the semblance; the cross marks the maximum.
Set up the volume¶
- Center: set
locationto the center of your network or of the expected seismicity. The location must not be0, 0. - Bounds:
east_bounds,north_boundsanddepth_boundsare in meters, relative to the center. Depth is positive down. Leave a margin around the seismicity: detections at the border of the volume are ignored, seeignore_boundary. - Root nodes: every extent must be a multiple of
root_node_size. The number of root nodes sets the cost of the coarse search: the default 20 km × 20 km × 20 km volume with 1 km root nodes has 8000 root nodes. - Resolution: the smallest node size is
root_node_size / 2**(n_levels - 1). The defaults, 1 km root nodes and 5 levels, refine down to 62.5 m.
Tip
Qseek stacks every root node in every window, but refines only the nodes around detections. For a finer resolution, add levels rather than shrinking the root nodes.
{
"location": {
"lat": 52.38,
"lon": 13.06,
"east_shift": 0.0,
"north_shift": 0.0,
"elevation": 0.0,
"depth": 0.0
},
"root_node_size": 1000.0,
"n_levels": 5,
"east_bounds": [
-10000.0,
10000.0
],
"north_bounds": [
-10000.0,
10000.0
],
"depth_bounds": [
0.0,
20000.0
]
}
Octree
pydantic-model
¶
Bases: BaseModel, Iterator[Node], Sequence[Node]
The search volume, divided into an octree of nodes.
The volume is set by its center location and its bounds in east, north and depth
direction, and divided into root nodes of root_node_size. Around detected events,
Qseek splits nodes into eight smaller nodes to refine the localization.
Config:
ignored_types:(cached_property,)
Fields:
-
location(Location) -
root_node_size(PositiveFloat) -
n_levels(int) -
east_bounds(Range) -
north_bounds(Range) -
depth_bounds(Range)
Validators:
-
check_reference→location -
check_limits
location
pydantic-field
¶
The geographical center of the octree.
root_node_size
pydantic-field
¶
root_node_size: PositiveFloat = 1 * KM
Size of the root node at the initial level (level 0) in meters.
n_levels
pydantic-field
¶
n_levels: int = 5
Number of levels of the octree, including the root level. The smallest node size, and the resolution of the localization, is root_node_size / 2**(n_levels - 1).
east_bounds
pydantic-field
¶
East bounds of the octree in meters.
north_bounds
pydantic-field
¶
North bounds of the octree in meters.
depth_bounds
pydantic-field
¶
Depth bounds of the octree in meters.
effective_depth_bounds
property
¶
effective_depth_bounds: Range
Effective depth bounds of the octree in meters.
leaf_nodes
cached
property
¶
leaf_nodes: list[Node]
Get all leaf nodes of the octree.
Returns:
| Type | Description |
|---|---|
list[Node]
|
list[Node]: List of leaf nodes. |
extent
¶
set_level
¶
set_level(level: int) -> None
Set the octree to a specific level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
int
|
Level to set the octree to. |
required |
reduce_axis
¶
reduce_axis(
surface: Literal["NE", "ED", "ND"] = "NE",
max_level: int = -1,
accumulator: Callable[ndarray] = max,
) -> ndarray
Reduce the octree's nodes to the surface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
surface
|
Literal['NE', 'ED', 'ND']
|
Surface to reduce to. Defaults to "NE". |
'NE'
|
max_level
|
int
|
Maximum level to reduce to. Defaults to -1. |
-1
|
accumulator
|
Callable
|
Accumulator function. Defaults to np.max. |
max
|
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: Of shape (n-nodes, 4) with columns (east, north, depth, value). |
map_semblance
¶
distances_stations
¶
distances_stations(stations: StationInventory) -> ndarray
Returns the 3D distances from all nodes to all stations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stations
|
Stations
|
Stations to calculate distance to. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: Of shape (n-nodes, n-stations). |
distances_stations_surface
¶
distances_stations_surface(
stations: StationInventory,
) -> ndarray
Returns the surface distance from all nodes to all stations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stations
|
Stations
|
Stations to calculate distance to. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: Distances in shape (n-nodes, n-stations). |
get_nodes
¶
get_nodes_by_threshold
¶
get_nodes_level
¶
get_node_size
¶
smallest_node_size
¶
smallest_node_size() -> float
Returns the smallest possible node size.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Smallest possible node size. |
total_number_nodes
¶
total_number_nodes() -> int
Returns the total number of nodes of all levels.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
Total number of nodes. |
interpolate_max_semblance
async
¶
interpolate_max_semblance(peak_node: Node) -> Location
Interpolate the location of the maximum semblance value.
This method calculates the location of the maximum semblance value by performing interpolation using surrounding nodes. It uses the scipy Rbf (Radial basis function) interpolation method to fit a smooth function to the given data points. The function is then minimized to find the location of the maximum value.
Returns:
| Name | Type | Description |
|---|---|---|
Location |
Location
|
Location of the maximum semblance value. |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If no semblance values are set. |
cached_bottom
¶
cached_bottom() -> Self
Returns a copy of the octree refined to the cached bottom nodes.
Raises:
| Type | Description |
|---|---|
EnvironmentError
|
If the octree has never been split. |
Returns:
| Name | Type | Description |
|---|---|---|
Self |
Self
|
Copy of the octree with cached bottom nodes. |