예제 #1
0
def test_determin_receiver_weighting():
    src = {"latitude": 0.0, "longitude": 0.0}
    results = ww.determine_receiver_weighting(
        src, stations, windows, search_ratio=0.35, weight_flag=True,
        plot_flag=False)

    assert len(results) == 5
예제 #2
0
def test_determin_receiver_weighting():
    src = {"latitude": 0.0, "longitude": 0.0}
    results = ww.determine_receiver_weighting(
        src, stations, windows, search_ratio=0.35, weight_flag=True,
        plot_flag=False)

    assert len(results) == 5
예제 #3
0
def test_receiver_validator():
    src = {"latitude": 0.0, "longitude": 0.0}
    results = ww.determine_receiver_weighting(
        src, stations, windows, search_ratio=0.35, weight_flag=True,
        plot_flag=False)

    weights = results["rec_weights"]

    weights["BHZ"]["II.AAK..BHZ"] *= 2
    rec_counts, cat_wcounts = ww.calculate_receiver_window_counts(windows)
    with pytest.raises(ValueError):
        ww._receiver_validator(weights["BHZ"], rec_counts["BHZ"],
                               cat_wcounts["BHZ"])
예제 #4
0
def test_receiver_validator():
    src = {"latitude": 0.0, "longitude": 0.0}
    results = ww.determine_receiver_weighting(
        src, stations, windows, search_ratio=0.35, weight_flag=True,
        plot_flag=False)

    weights = results["rec_weights"]

    weights["BHZ"]["II.AAK..BHZ"] *= 2
    rec_counts, cat_wcounts = ww.calculate_receiver_window_counts(windows)
    with pytest.raises(ValueError):
        ww._receiver_validator(weights["BHZ"], rec_counts["BHZ"],
                               cat_wcounts["BHZ"])