Ejemplo n.º 1
0
def test_window_on_trace_with_none_user_levels():
    obs_tr = read(obsfile).select(channel="*R")[0]
    syn_tr = read(synfile).select(channel="*R")[0]

    config_file = os.path.join(DATA_DIR, "window", "27_60.BHZ.config.yaml")
    config = wio.load_window_config_yaml(config_file)

    cat = read_events(quakeml)
    inv = read_inventory(staxml)

    windows = win.window_on_trace(obs_tr, syn_tr, config, station=inv,
                                  event=cat, user_module="None",
                                  _verbose=False, figure_mode=False)

    winfile_bm = os.path.join(DATA_DIR, "window",
                              "IU.KBL..BHR.window.json")

    parameters = ["left", "right", "center", "time_of_first_sample",
                  "max_cc_value", "cc_shift", "dlnA", "dt", "min_period",
                  "channel_id", "phase_arrivals", "weight_function"]

    with open(winfile_bm) as fh:
        windows_json = json.load(fh)
    for _win, _win_json_bm in zip(windows, windows_json):
        _win_bm = Window._load_from_json_content(_win_json_bm)

        assertWinAlmostEqual(_win, _win_bm, parameters)
Ejemplo n.º 2
0
    def get_windows():
        obs_tr = read(obsfile).select(channel="*R")[0]
        syn_tr = read(synfile).select(channel="*R")[0]

        config_file = os.path.join(
            DATA_DIR, "window", "27_60.BHZ.config.yaml")
        config = wio.load_window_config_yaml(config_file)

        cat = read_events(quakeml)

        inv = read_inventory(staxml)
        windows = win.window_on_trace(obs_tr, syn_tr, config, station=inv,
                                      event=cat, _verbose=False,
                                      figure_mode=False)
        return windows
Ejemplo n.º 3
0
def test_window_on_trace_user_levels():
    obs_tr = read(obsfile)[0]
    syn_tr = read(synfile)[0]

    config_file = os.path.join(DATA_DIR, "window", "27_60.BHZ.config.yaml")
    config = wio.load_window_config_yaml(config_file)

    cat = read_events(quakeml)
    inv = read_inventory(staxml)
    user_module = "gcmt3d.window.tests.user_module_example"

    windows = win.window_on_trace(obs_tr, syn_tr, config, station=inv,
                                  event=cat, user_module=user_module,
                                  _verbose=False,
                                  figure_mode=False)
    assert len(windows) == 4