Skip to content

Stations

The stations of a search. The configuration of the station inventory is on the stations page.

Station pydantic-model

Bases: Location

Fields:

network pydantic-field

network: str

Seismic network code

station pydantic-field

station: str

Station code

location pydantic-field

location: str = ''

Location code

nsl property

nsl: _NSL

Network Station Location code as tuple.

Returns:

Type Description
_NSL

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

lat pydantic-field

lat: float

Latitude in degrees.

lon pydantic-field

lon: float

Longitude in degrees.

east_shift pydantic-field

east_shift: float = 0.0

East shift towards geographical reference in meters.

north_shift pydantic-field

north_shift: float = 0.0

North shift towards geographical reference in meters.

elevation pydantic-field

elevation: float = 0.0

Elevation in meters.

depth pydantic-field

depth: float = 0.0

Depth in meters, positive is down.

effective_lat_lon property

effective_lat_lon: tuple[float, float]

Shift-corrected lat/lon pair of the 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].

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.

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.

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.

origin

origin() -> Location

Get the origin location.

Returns:

Name Type Description
Location Location

The origin location.

as_wkt

as_wkt() -> str

Return the location as WKT string.

StationList

Bases: Sequence[Station]

A frozen station list.

Methods:

Name Description
get_index

Get the index of a station by its NSL code.

get_indices

Get the indices of stations by their NSL codes.

get_indices_by_nsl

Get the indices of stations by their NSL codes.

get_index

get_index(nsl: NSL) -> int

Get the index of a station by its NSL code.

Parameters:

Name Type Description Default
nsl NSL

NSL code of the station.

required

Returns:

Name Type Description
int int

Index of the station.

get_indices

get_indices(stations: Sequence[Station]) -> ndarray

Get the indices of stations by their NSL codes.

Parameters:

Name Type Description Default
stations Iterable[Station]

Iterable of stations.

required

Returns:

Type Description
ndarray

np.ndarray: Indices of the stations.

get_indices_by_nsl

get_indices_by_nsl(nsls: Sequence[NSL]) -> ndarray

Get the indices of stations by their NSL codes.

Parameters:

Name Type Description Default
nsls Iterable[NSL]

Iterable of NSL codes of the stations.

required

Returns:

Type Description
ndarray

np.ndarray: Indices of the stations.