Windows Component

With varying data quality and the non-linearity of full-waveform inversion the data need to be windowed. LASIF has an automatic window picker which decides when data is worth comparing to synthetics.

Contents:

class lasif.components.windows.WindowsComponent(communicator, component_name)[source]

Component dealing with the windows and adjoint sources.

Parameters
  • folder – The folder where the files are stored.

  • communicator – The communicator instance.

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

get(window_set_name: str)[source]

Returns the window manager instance for a window set.

Parameters

window_set_name (str) – The name of the window set.

get_window_set_filename(window_set_name: str)[source]

Retrieves the filename for a given window set

Parameters

window_set_name (str) – The name of the window set.

Returns

filename of the window set

get_window_statistics(window_set_name: str, events: List[str])[source]

Get a dictionary with window statistics for an iteration per event. Depending on the size of your inversion and chosen iteration, this might take a while…

Parameters
  • window_set_name (str) – The window_set_name.

  • events (List[str]) – List of event(s)

has_window_set(window_set_name: str)[source]

Checks whether a window set is already defined. Returns True or False

Parameters

window_set_name (str) – The name of the window set.

list()[source]

Returns a list of window sets currently present within the LASIF project.

read_all_windows(event: str, window_set_name: str)[source]

Return a flat dictionary with all windows for a specific event. This should always be fairly small.

Parameters
  • event (str) – Name of event

  • window_set_name (str) – The name of the window set.

select_windows(event: str, iteration_name: str, window_set_name: str, **kwargs)[source]

Automatically select the windows for the given event and iteration.

Function must be called with MPI.

Parameters
  • event (str) – The event.

  • iteration_name (str) – The iteration.

  • window_set_name (str) – The name of the window set to pick into

select_windows_for_station(event: str, iteration: str, station: str, window_set_name: str, **kwargs)[source]

Selects windows for the given event, iteration, and station. Will delete any previously existing windows for that station if any.

Parameters
  • event (str) – The event.

  • iteration (str) – The iteration name.

  • station (str) – The station id in the form NET.STA.

  • window_set_name (str) – Name of window set

select_windows_multiprocessing(event: str, iteration_name: str, window_set_name: str, num_processes: int = 16, **kwargs)[source]

Automatically select the windows for the given event and iteration. Uses Python’s multiprocessing for parallelization.

Parameters
  • event (str) – The event.

  • iteration_name (str) – The iteration.

  • window_set_name (str) – The name of the window set to pick into

  • num_processes (int) – The number of processes used in multiprocessing

write_windows_to_sql(event_name: str, window_set_name: str, windows: dict)[source]

Writes windows to the sql database

Parameters
  • event_name (str) – The name of the event

  • window_set_name (str) – The name of the window set

  • windows (dict) – The actual windows, structured in a dictionary(stations) of dicts(channels) of lists(windowS) of tuples (start- and end times)