Validator Component

The validator component is a bit of a police. It can check if there is anything missing or wrong with the imported data in the project. It does however not guarantee that everything is perfect, it meerly tries its best. As we all do.

Contents:

class lasif.components.validator.ValidatorComponent(*args, **kwargs)[source]

Component responsible for validating data inside a project. Needs access to a lot of functionality and should therefore be initialized fairly late.

Parameters
  • communicator – The communicator instance.

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

clean_up_project(clean_up_file: str, delete_outofbounds_events: bool = False)[source]

Clean up lasif project based on a toml file with the events that can be deleted.

Parameters
  • clean_up_file (str) – A toml describing the files that can be deleted.

  • delete_outofbounds_events (bool, optional) – Whether full event files should be deleted if the origin is out of bounds. It is recommended to take a look at the toml file before doing this, defaults to False

is_event_station_raypath_within_boundaries(event_name: str, station_latitude: float, station_longitude: float, raypath_steps: int = 500)[source]

Checks if the full station-event raypath is within the project’s domain boundaries.

Returns True if this is the case, False if not.

Parameters
  • event_name (str) – Name of the event

  • station_latitude (float) – The station latitude.

  • station_longitude (float) – The station longitude.

  • raypath_steps (int, optional) – The number of discrete points along the raypath that will be checked, defaults to 25

validate_data(data_and_station_file_availability: bool = False, raypaths: bool = False)[source]

Validates all data of the current project.

This commands walks through all available data and checks it for validity. It furthermore does some sanity checks to detect common problems. These should be fixed.

Event files:
  • Validate against QuakeML 1.2 scheme.

  • Make sure they contain at least one origin, magnitude and focal mechanism object.

  • Check for duplicate ids amongst all QuakeML files.

  • Some simply sanity checks so that the event depth is reasonable and the moment tensor values as well. This is rather fragile and mainly intended to detect values specified in wrong units.

Parameters
  • data_and_station_file_availability (bool, optional) – Assert whether all waveform files have a corresponding station file, defaults to False

  • raypaths (bool, optional) – Assert that raypaths are fully inside domain, defaults to False

validate_raypaths_in_domain()[source]

Checks that all raypaths are within the specified domain boundaries.

Returns a list of waveform files violating that assumtion.