Skip to content

Station Inventory

qseek.models.station.Station pydantic-model

Bases: Location

Fields:

depth pydantic-field

depth: float = 0.0

Depth in meters, positive is down.

east_shift pydantic-field

east_shift: float = 0.0

East shift towards geographical reference in meters.

effective_lat_lon property

effective_lat_lon: tuple[float, float]

Shift-corrected lat/lon pair of the location.

elevation pydantic-field

elevation: float = 0.0

Elevation in meters.

lat pydantic-field

lat: float

Latitude in degrees.

lon pydantic-field

lon: float

Longitude in degrees.

north_shift pydantic-field

north_shift: float = 0.0

North shift towards geographical reference in meters.

nsl property

nsl: _NSL

Network Station Location code as tuple.

Returns:

Type Description
_NSL

tuple[str, str, str]: Network, Station, Location

as_wkt

as_wkt() -> str

Return the location as WKT string.

azimuth_to

azimuth_to(other: Location) -> float

Compute azimuth [°] to other location object.

Parameters:

Name Type Description Default
other Location

The other location.

required

Returns:

Name Type Description
float float

The azimuth in [°].

distance_to

distance_to(other: Location) -> float

Compute 3-dimensional distance [m] to other location object.

Parameters:

Name Type Description Default
other Location

The other location.

required

Returns:

Name Type Description
float float

The distance in [m].

offset_from

offset_from(other: Location) -> tuple[float, float, float]

Return offset vector (east, north, depth) from other location in [m].

Parameters:

Name Type Description Default
other Location

The other location.

required

Returns:

Type Description
tuple[float, float, float]

tuple[float, float, float]: The offset vector.

origin

origin() -> Location

Get the origin location.

Returns:

Name Type Description
Location Location

The origin location.

shift

shift(east: float, north: float, elevation: float) -> Self

Shift the location by the given offsets.

Parameters:

Name Type Description Default
east float

East offset in [m].

required
north float

North offset in [m].

required
elevation float

Elevation offset in [m].

required

Returns:

Name Type Description
Self Self

The shifted location.

shifted_origin

shifted_origin() -> Self

Shift the origin of the location to the effective lat/lon.

Returns:

Name Type Description
Self Self

The shifted location.

surface_distance_to

surface_distance_to(other: Location) -> float

Compute surface distance [m] to other location object.

Parameters:

Name Type Description Default
other Location

The other location.

required

Returns:

Name Type Description
float float

The surface distance in [m].

qseek.models.station.Stations pydantic-model

Bases: BaseModel

Fields:

blacklist pydantic-field

blacklist: Blacklist = Blacklist()

Blacklist stations and exclude from detecion. Format is ['NET.STA.LOC', ...].

max_distance pydantic-field

max_distance: PositiveFloat | None = None

Maximum distance in meters from the centroid location to include stations for detection. If None, all stations are included.

n_networks property

n_networks: int

Number of stations.

n_stations property

n_stations: int

Number of stations.

pyrocko_station_yamls pydantic-field

pyrocko_station_yamls: list[FilePath] = []

List of Pyrocko station YAML files.

station_xmls pydantic-field

station_xmls: list[FilePath | DirectoryPath] = []

List of StationXML files or directories containing StationXML (.xml) files.

as_pyrocko_stations

as_pyrocko_stations() -> list[Station]

Convert the stations to PyrockoStation objects.

Returns:

Type Description
list[Station]

A list of PyrockoStation objects.

export_csv

export_csv(filename: Path) -> None

Dump stations to CSV file.

Parameters:

Name Type Description Default
filename Path

Path to CSV file.

required

export_pyrocko_stations

export_pyrocko_stations(filename: Path) -> None

Dump stations to pyrocko station yaml file.

Parameters:

Name Type Description Default
filename Path

Path to yaml file.

required

get_all_nsl

get_all_nsl() -> list[NSL]

Get all NSL codes from all stations.

get_centroid

get_centroid() -> Location

Get centroid location from all stations.

Returns:

Name Type Description
Location Location

Centroid Location.

mean_interstation_distance

mean_interstation_distance() -> float

Calculate the mean interstation distance.

Returns:

Name Type Description
float float

Mean interstation distance in meters.

select_from_traces

select_from_traces(traces: Iterable[Trace]) -> Stations

Select stations by NSL code.

Stations are not unique and are ordered by the input traces.

Parameters:

Name Type Description Default
traces Iterable[Trace]

Iterable of Pyrocko Traces

required

Returns:

Name Type Description
Stations Stations

Containing only selected stations.

weed_from_nsls

weed_from_nsls(nsls: set[NSL]) -> None

Remove stations without waveforms from squirrel instances.

Parameters:

Name Type Description Default
nsls list[NSL]

List of NSL codes to keep.

required

weed_stations

weed_stations() -> None

Remove stations with bad coordinates or duplicates.