Query Component

Do you have some sort of a query? Take it up with the query component.

Contents:

class lasif.components.query.DataTuple(data, synthetics, coordinates)
property coordinates

Alias for field number 2

property data

Alias for field number 0

property synthetics

Alias for field number 1

class lasif.components.query.QueryComponent(communicator, component_name)[source]

This component is responsible for making queries across the different components and integrating them in a meaningful way.

Parameters
  • communicator – The communicator instance.

  • component_name (str) – The name of this component for the communicator.

It should thus be initialized fairly late as it needs access to a number of other components via the communicator.

get_all_stations_for_event(event_name: str, list_only: bool = False, intersection_override: Optional[bool] = None)[source]

Returns a dictionary of all stations for one event and their coordinates.

A station is considered to be available for an event if at least one channel has raw data and an associated station file. Furthermore it must be possible to derive coordinates for the station.

Parameters
  • event_name (str) – Name of the event.

  • list_only (bool, optional) – Whether you only want names of stations, defaults to False.

  • intersection_override (bool, optional) – boolean to require to have the same stations recording all events, i.e. the intersection of receiver sets. The intersection will consider two stations equal i.f.f. the station codes AND coordinates (LAT, LON, Z) are equal.

get_coordinates_for_station(event_name: str, station_id: str)[source]

Get the coordinates for one station.

Must be in sync with get_all_stations_for_event().

Parameters
  • event_name (str) – Name of event

  • station_id (str) – The unique id of the station in the waveform file

get_matching_waveforms(event: str, iteration: str, station_or_channel_id: str)[source]

Get synthetic and processed waveforms for the same station and same event.

Parameters
  • event (str) – Name of event

  • iteration (str) – Name of iteration

  • station_or_channel_id (str) – The id for the station of the channel

Returns

A named tuple with processed waveforms, synthetic waveforms and coordinates of station

get_stations_for_all_events(intersection_override: Optional[bool] = None)[source]

Returns a dictionary with a list of stations per event.

Parameters

intersection_override (bool, optional) – boolean to require to have the same stations recording all events, i.e. the intersection of receiver sets. The intersection will consider two stations equal i.f.f. the station codes AND coordinates (LAT, LON, Z) are equal.

point_in_domain(latitude: float, longitude: float, depth: float)[source]

Tests if the point is in the domain. Returns True/False

Parameters
  • latitude (float) – The latitude of the point.

  • longitude (float) – The longitude of the point.

  • depth (float) – The depth of the point