windowmaker

class dsmpy.windowmaker.WindowMaker

Utility class to compute list of Windows.

static compute(event, stations, model_name, phase_names, components, t_before=10.0, t_after=40.0)

Compute list of Windows using TauP.

Parameters
  • event (Event) – seismic event

  • stations (list of Station) – seismic stations

  • model_name (str) – name of reference 1-D model

  • phase_names (list of str) – list of TauP phase names

  • components (list of Component) – seismic components

  • t_before (float) – time before arrival (default is 10)

  • t_after (float) – time after arrival (default is 40)

Returns

time windows

Return type

list of Window

static load(path)

Read path into list of Window using pickle.load().

Parameters

path (str) – path to the file that contains time windows

Returns

time windows

Return type

windows (list of Window))

static save(path, windows)

Save windows using pickle.dump().

Parameters
  • path (str) – name of the output file.

  • windows (list of Window) – time windows.

static set_limit(windows, t_before, t_after, inplace=True)

Set t_before and t_after for all window in windows.

Parameters
  • windows (list of Windows) – time windows

  • t_before (float) – time before arrival (in seconds)

  • t_after (float) – time after arrival (in seconds)

  • inplace (bool) – if True, modifies windows in-place, else returns a modified copy of windows.

static trim_windows(windows, windows_trim)

Trim windows using windows_trim. Used to exclude specific phases from windows.

Parameters
  • windows (list of Window) –

  • windows_trim (list of Window) –

Returns

trimmed time windows

Return type

list of Window

static windows_from_dataset(dataset, model_name, phase_names, components, t_before=10.0, t_after=40.0)

Compute list of Windows from a Dataset using TauP.

Parameters
  • dataset (Dataset) – dataset

  • model_name (str) – name of the 1-D reference model. The model name corresponds to that used in TauP.

  • phase_names (list of str) – name of seismic phases. The phase name corresponds to that used in TauP.

  • components (list of Component) – seismic components

  • t_before (float) – time before arrival (default: 10)

  • t_after (float) – time after arrival (default: 40)

Returns

list of time windows

Return type

list of Window

Examples

>>> dataset = Dataset.dataset_from_sac(
        sac_files, headonly=False)
>>> windows = WindowMaker.windows_from_dataset(
        dataset, 'prem', 'ScS', [Component.T],
        t_before=10., t_after=30.)