Octree
qseek.octree.Octree
pydantic-model
Bases: BaseModel
, Iterator[Node]
Config:
ignored_types
:(cached_property,)
Fields:
-
location
(Location
) -
root_node_size
(PositiveFloat
) -
n_levels
(int
) -
east_bounds
(Range
) -
north_bounds
(Range
) -
depth_bounds
(Range
) -
_root_nodes
(list[Node]
) -
_semblance
(ndarray | None
) -
_cached_coordinates
(dict[CoordSystem, ndarray]
) -
_nodes
(list[Node]
)
Validators:
-
check_reference
→location
-
check_limits
depth_bounds
pydantic-field
Depth bounds of the octree in meters.
east_bounds
pydantic-field
East 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. |
location
pydantic-field
The geographical center of the octree.
n_levels
pydantic-field
n_levels: int = 5
Number of levels in the octree, defining the final resolution of the detection. Default is 5.
north_bounds
pydantic-field
North bounds of the octree in meters.
root_node_size
pydantic-field
root_node_size: PositiveFloat = 1 * KM
Size of the root node at the initial level (level 0) in meters.
cached_bottom
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. |
distances_stations
distances_stations_surface
extent
get_corners
get_node_size
get_nodes
get_nodes_by_threshold
get_nodes_level
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. |
map_semblance
model_post_init
model_post_init(__context: Any) -> None
Initialize octree. This method is called by the pydantic model.
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). |
save_pickle
save_pickle(filename: Path) -> None
Save the octree to a pickle file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename
|
Path
|
Filename to save to. |
required |
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 |