Skip to content

Station corrections

Station corrections add a delay to the modeled travel times of a station. They account for what the velocity model misses, e.g. the local geology below a station. Corrected travel times line up the phase arrivals better: the locations get more precise, and the stack detects more events.

Corrections Delay Source
SimpleCorrections Per station and phase You give the delays
StationCorrections Per station and phase (SST) Extracted from a previous run
SourceSpecificStationCorrections Per station, phase and source location (SSST) Extracted from a previous run

station_corrections takes the corrections, or the path to a directory with a corrections.json file.

Extract corrections from a previous run

The extracted corrections are statistics of the travel time residuals, the differences between the picked and the modeled arrival times of a previous search:

  1. Run a search without corrections. Its run directory holds the detections with their picks.
  2. Add the corrections to the configuration, with the run directory of the first search in import_rundirs.
  3. Run the search again. Qseek extracts the corrections when it starts and applies them to the travel times.
Station corrections from a previous run
"station_corrections": {
  "corrections": "StationCorrections",
  "import_rundirs": ["my-search/"]
}

Constant corrections

Constant delays per station and phase, in seconds. Stations and phases without an entry are not corrected.

Constant station corrections
"station_corrections": {
  "corrections": "SimpleCorrections",
  "stations": {
    "GE.RUE.": {"cake:P": 0.12, "cake:S": 0.2}
  }
}

SimpleCorrections pydantic-model

Bases: TravelTimeCorrections

Constant travel time corrections per station and phase.

The station delays are added to the modeled travel times of all source locations.

Fields:

stations pydantic-field

stations: dict[NSLType, dict[PhaseDescription, float]] = {}

Travel time delay in seconds per station and phase, e.g. {"GE.RUE.": {"cake:P": 0.12, "cake:S": 0.2}}. Stations and phases without an entry are not corrected.

get_subclasses classmethod

get_subclasses() -> tuple[type[TravelTimeCorrections], ...]

Get the subclasses of this class.

Returns:

Type Description
tuple[type[TravelTimeCorrections], ...]

tuple[type]: The subclasses of this class.

prepare async

prepare(stations: StationInventory, octree: Octree, phases: Iterable[PhaseDescription], rundir: Path) -> None

Prepare the station for the corrections.

Parameters:

Name Type Description Default
stations Stations

The station to prepare.

required
octree Octree

The octree to use for the preparation.

required
phases Iterable[PhaseDescription]

The phases to prepare the station for.

required
rundir Path

The run directory of the search.

required

Station-specific corrections

Station-specific corrections (SST) are one delay per station and phase, extracted from the travel time residuals of all detections of the previous runs.

Station delay statistics

Statistics of the station delay times.

StationCorrections
{
  "corrections": "StationCorrections",
  "import_rundirs": [
    "."
  ],
  "plot_corrections": false,
  "statistic": "median",
  "weighting": "confidence",
  "quality_cap_quantile": 0.0,
  "min_num_station_picks": 50,
  "min_distance_border": 500.0,
  "min_num_picks": 3
}

StationCorrections pydantic-model

Bases: TravelTimeCorrections

Static station travel time corrections.

Fields:

import_rundirs pydantic-field

import_rundirs: list[DirectoryPath] = [Path('.')]

Path to rundir, to extract the station corrections from.

plot_corrections pydantic-field

plot_corrections: bool = False

Plot the station corrections statistics.

statistic pydantic-field

statistic: ArrivalStatistic = 'median'

Arithmetic measure for the traveltime delays. Choose from median and average.

weighting pydantic-field

weighting: WeightingMethod = 'confidence'

Weighting of the traveltime delays. Choose from none, confidence (the pick confidence) and mul-confidence-semblance (the pick confidence times the event semblance).

quality_cap_quantile pydantic-field

quality_cap_quantile: float = 0.0

Weight the events by their number of picks, n_picks / cap, up to the cap. The cap is this quantile of the number of picks of all imported events: events with more picks get the full weight. Multiplies the weighting. 0 disables the event weighting.

min_num_station_picks pydantic-field

min_num_station_picks: PositiveInt = 50

Minimum number of picks at a station required to calculate station corrections.

min_distance_border pydantic-field

min_distance_border: float = 500.0

Minimum event distance from the border of the octree grid.

min_num_picks pydantic-field

min_num_picks: PositiveInt = 3

Minimum number of picks per event to be included in the statistics.

get_subclasses classmethod

get_subclasses() -> tuple[type[TravelTimeCorrections], ...]

Get the subclasses of this class.

Returns:

Type Description
tuple[type[TravelTimeCorrections], ...]

tuple[type]: The subclasses of this class.

get_delay

get_delay(station_nsl: NSL, phase: PhaseDescription, node: Node | None = None) -> float

Get the traveltime delay for a station and phase.

The delay is the difference between the observed and predicted traveltime.

Parameters:

Name Type Description Default
station_nsl NSL

The station NSL.

required
phase PhaseDescription

The phase description.

required
node Node | None

The node to get the delay for. Is ignored for these median and average delays.

None

Returns:

Name Type Description
float float

The traveltime delay in seconds.

get_delays async

get_delays(station_nsls: Sequence[NSL], phase: PhaseDescription, nodes: Sequence[Node] = ()) -> ndarray

Get the traveltime delays for a set of stations and a phase.

Parameters:

Name Type Description Default
station_nsls Sequence[NSL]

The stations to get the delays for.

required
phase PhaseDescription

The phase to get the delays for.

required
nodes Sequence[Node]

The nodes to get the delays for. Is ignored for these median and average delays.

()

Returns:

Type Description
ndarray

np.ndarray: The traveltime delays for the given stations and phase.

prepare async

prepare(stations: StationInventory, octree: Octree, phases: Iterable[PhaseDescription], rundir: Path) -> None

Prepare the station corrections for the console.

Source-specific corrections

Source-specific station corrections (SSST) vary with the source location. The delays are calculated on a grid of octree nodes, at the level set by resolution_octree_level, from the weighted travel time residuals of the events within a Gaussian sphere around each node. Between the nodes the delays are interpolated.

Source specific corrections volume

Delay volume of a single station.

SourceSpecificStationCorrections
{
  "corrections": "SourceSpecificStationCorrections",
  "import_rundirs": [],
  "weighting": "confidence",
  "quality_cap_quantile": 0.8,
  "min_confidence": 10.0,
  "radius_from_weights": false,
  "min_radius": null,
  "min_distance_border": 500.0,
  "min_num_picks": 6,
  "max_rms": 0.6,
  "spatial_weighting_exponent": 2.0,
  "resolution_octree_level": 0,
  "delay_statistic": "weighted-median",
  "remove_event_term": true,
  "event_term_iterations": 1,
  "delay_interpolation_method": "linear",
  "export_stations": []
}

SourceSpecificStationCorrections pydantic-model

Bases: TravelTimeCorrections

Source specific station corrections, spatial travel time corrections.

Fields:

import_rundirs pydantic-field

import_rundirs: list[DirectoryPath]

Path to rundir, to extract the station corrections from.

weighting pydantic-field

weighting: WeightingMethod = 'confidence'

Weighting of the traveltime delays. Choose from none, confidence (the pick confidence) and mul-confidence-semblance (the pick confidence times the event semblance).

quality_cap_quantile pydantic-field

quality_cap_quantile: float = 0.8

Weight the events by their number of picks, n_picks / cap, up to the cap. The cap is this quantile of the number of picks of all imported events: events with more picks get the full weight. Multiplies the weighting. 0 disables the event weighting.

min_confidence pydantic-field

min_confidence: PositiveFloat = 10.0

Cumulative pick confidence of the nearest events that defines the radius r of the distance weighting exp(-(d/r)^exponent) around each node. The radius grows from min_radius until min_confidence is reached, individually for each node-station combination. With radius_from_weights, this is the cumulative pick weight.

radius_from_weights pydantic-field

radius_from_weights: bool = False

Grow the radius around each node by the cumulative pick weight, the weighting times the event weight from quality_cap_quantile, instead of the pick confidence: where events are poorly constrained, the radius grows until enough well constrained events contribute. min_confidence is then a cumulative pick weight. Without a quality cap and with the confidence weighting, the radius is the same.

min_radius pydantic-field

min_radius: PositiveFloat | None = None

Minimum radius of the distance kernel around each node in meters. Defaults to half the radius of the octree nodes at resolution_octree_level, so that events between the nodes still contribute to the neighboring nodes.

min_distance_border pydantic-field

min_distance_border: float = 500.0

Minimum event distance from the border of the octree grid.

min_num_picks pydantic-field

min_num_picks: PositiveInt = 6

Minimum number of picks per event to be included in the statistics. Higher values will result in fewer events.

max_rms pydantic-field

max_rms: float = 0.6

Maximum RMS of the travel time residuals for a station to be included.

spatial_weighting_exponent pydantic-field

spatial_weighting_exponent: PositiveFloat = 2.0

The exponent of the distance weighting exp(-(d/r)^exponent) around each node, 2 is a Gaussian. Larger values give a flatter top and a sharper edge at the radius.

resolution_octree_level pydantic-field

resolution_octree_level: int = 0

The octree level (resolution) to use for the station corrections. This is the SSST grid spacing.

delay_statistic pydantic-field

delay_statistic: DelayStatistic = 'weighted-median'

Statistical delay aggregation method.

remove_event_term pydantic-field

remove_event_term: bool = True

Subtract the weighted median delay of each event, over all its stations and phases, from the delays of its picks before calculating the corrections. This removes origin time errors of the events.

event_term_iterations pydantic-field

event_term_iterations: NonNegativeInt = 1

With remove_event_term, estimate the event terms from the delays minus the static term of each station and phase, alternating this many times between the static terms and the event terms. 0 uses the median of the delays.

delay_interpolation_method pydantic-field

delay_interpolation_method: InterpolationMethod = 'linear'

The interpolation method to use for interpolating delays between nodes.

export_stations pydantic-field

export_stations: list[NSLType]

List of station NSLs for which debug information will be generated, this includes CSV and VTK files with the station corrections and statistics about the delay

get_subclasses classmethod

get_subclasses() -> tuple[type[TravelTimeCorrections], ...]

Get the subclasses of this class.

Returns:

Type Description
tuple[type[TravelTimeCorrections], ...]

tuple[type]: The subclasses of this class.

load_volumes

load_volumes(path: Path) -> None

Load the station correction volumes (.qssst) from a directory.

Parameters:

Name Type Description Default
path Path

The path to the directory to load the station corrections from.

required

create_volumes

create_volumes(stations: list[tuple[Station, PhaseDescription]], octree: Octree, export_dir: Path) -> list[StationCorrectionVolume]

Create a new source specific station correction.

Parameters:

Name Type Description Default
station

The station to prepare.

required
octree Octree

The octree to use for the preparation.

required
phase

The phase to prepare the station for.

required

add_volume

add_volume(volume: StationCorrectionVolume) -> None

Add a volume to the station corrections.

Parameters:

Name Type Description Default
phase

The phase of the volume.

required
station

The station of the volume.

required
volume StationCorrectionVolume

The volume to add.

required

get_volume

get_volume(station_nsl: NSL, phase: PhaseDescription) -> StationCorrectionVolume

Get the volume for a station and phase.

Parameters:

Name Type Description Default
phase PhaseDescription

The phase of the volume.

required
station

The station of the volume.

required

Returns:

Name Type Description
StationCorrectionVolume StationCorrectionVolume

The volume.

has_volume

has_volume(station_nsl: NSL | Station, phase: PhaseDescription) -> bool

Check if the volume for a station and phase exists.

Parameters:

Name Type Description Default
phase PhaseDescription

The phase of the volume.

required
station

The station of the volume.

required

Returns:

Name Type Description
bool bool

True if the volume exists, False otherwise.

interpolate_delays

interpolate_delays(nodes: Sequence[Node], phase: PhaseDescription) -> ndarray

Interpolate the delays of all stations at the nodes.

Parameters:

Name Type Description Default
nodes Sequence[Node]

The nodes to get the delays for.

required
phase PhaseDescription

The phase to get the delays for.

required

Returns:

Type Description
ndarray

np.ndarray: Delays of shape (n_nodes, n_stations), zero for stations without a volume.

get_delay

get_delay(station_nsl: NSL, phase: PhaseDescription, node: Node) -> float

Get the traveltime delay for a station and phase.

The delay is the difference between the observed and predicted traveltime.

Parameters:

Name Type Description Default
station_nsl NSL

The station NSL.

required
phase PhaseDescription

The phase description.

required

Returns:

Name Type Description
float float

The traveltime delay in seconds.

get_delays async

get_delays(station_nsls: Sequence[NSL], phase: PhaseDescription, nodes: Sequence[Node]) -> ndarray

Get the traveltime delays for a set of stations and a phase.

Parameters:

Name Type Description Default
station_nsls Sequence[NSL]

The stations to get the delays for.

required
phase PhaseDescription

The phase to get the delays for.

required
octree

The octree to use for the delays.

required

Returns:

Type Description
ndarray

np.ndarray: The traveltime delays for the given stations and phase of shape is n_nodes X n_stations