Example #1
0
def test_rotate_one_station_stream_synt():
    syn = testsyn.copy()
    inv = deepcopy(teststaxml)

    syn1 = syn.copy()
    syn_r1 = rotate.rotate_one_station_stream(syn1,
                                              0.0,
                                              0.0,
                                              inventory=inv,
                                              mode="NE->RT")
    syn2 = syn.copy()
    syn_r2 = rotate.rotate_one_station_stream(syn2,
                                              0.0,
                                              0.0,
                                              station_latitude=34.5408,
                                              station_longitude=69.0432,
                                              mode="NE->RT")
    assert syn_r1 == syn_r2

    syn3 = syn.copy()
    syn_r3 = rotate.rotate_one_station_stream(syn3,
                                              0.0,
                                              0.0,
                                              inventory=inv,
                                              mode="NE->RT")
    assert syn_r3 == syn_r1
Example #2
0
def test_rotate_one_station_stream_obsd():
    return
    obs = testobs.copy()
    inv = deepcopy(teststaxml)

    obs1 = obs.copy()
    obs_r1 = rotate.rotate_one_station_stream(obs1,
                                              0.0,
                                              0.0,
                                              inventory=inv,
                                              mode="NE->RT",
                                              sanity_check=False)

    obs2 = obs.copy()
    obs_r2 = rotate.rotate_one_station_stream(obs2,
                                              0.0,
                                              0.0,
                                              station_latitude=34.5408,
                                              station_longitude=69.0432,
                                              mode="NE->RT",
                                              sanity_check=False)
    assert obs_r1 == obs_r2

    obs3 = obs.copy()
    obs_r3 = rotate.rotate_one_station_stream(obs3,
                                              0.0,
                                              0.0,
                                              inventory=inv,
                                              mode="NE->RT",
                                              sanity_check=True)
    assert len(obs_r3) == 1
    assert obs_r3[0].stats.channel == "BHZ"
    assert obs_r3[0] == obs_r1.select(channel="BHZ")[0]
Example #3
0
def rotate_one_station_adjsrcs(sta_adjs, slat, slon, elat, elon):
    adj_stream, meta_info = convert_adjs_to_stream(sta_adjs)
    add_missing_components(adj_stream)

    rotate_one_station_stream(
        adj_stream, elat, elon, station_latitude=slat, station_longitude=slon,
        mode="RT->NE")

    new_adjs = convert_stream_to_adjs(adj_stream, meta_info)
    adj_dict = {}
    for _adj in new_adjs:
        adj_id = "%s_%s_%s" % (_adj.network, _adj.station, _adj.component)
        adj_dict[adj_id] = _adj
    return adj_dict
Example #4
0
def rotate_one_station_adjsrcs(sta_adjs, slat, slon, elat, elon):
    adj_stream, meta_info = convert_adjs_to_stream(sta_adjs)
    add_missing_components(adj_stream)

    rotate_one_station_stream(
        adj_stream, elat, elon, station_latitude=slat, station_longitude=slon,
        mode="RT->NE")

    new_adjs = convert_stream_to_adjs(adj_stream, meta_info)
    adj_dict = {}
    for _adj in new_adjs:
        adj_id = "%s_%s_%s" % (_adj.network, _adj.station, _adj.component)
        adj_dict[adj_id] = _adj
    return adj_dict
Example #5
0
def test_rotate_one_station_stream_synt():
    syn = testsyn.copy()
    inv = deepcopy(teststaxml)

    syn1 = syn.copy()
    syn_r1 = rotate.rotate_one_station_stream(
        syn1, 0.0, 0.0, inventory=inv, mode="NE->RT")
    syn2 = syn.copy()
    syn_r2 = rotate.rotate_one_station_stream(
        syn2, 0.0, 0.0, station_latitude=34.5408,
        station_longitude=69.0432, mode="NE->RT")
    assert syn_r1 == syn_r2

    syn3 = syn.copy()
    syn_r3 = rotate.rotate_one_station_stream(
        syn3, 0.0, 0.0, inventory=inv, mode="NE->RT")
    assert syn_r3 == syn_r1
Example #6
0
def test_rotate_one_station_stream_obsd():
    return
    obs = testobs.copy()
    inv = deepcopy(teststaxml)

    obs1 = obs.copy()
    obs_r1 = rotate.rotate_one_station_stream(
        obs1, 0.0, 0.0, inventory=inv, mode="NE->RT",
        sanity_check=False)

    obs2 = obs.copy()
    obs_r2 = rotate.rotate_one_station_stream(
        obs2, 0.0, 0.0, station_latitude=34.5408,
        station_longitude=69.0432, mode="NE->RT",
        sanity_check=False)
    assert obs_r1 == obs_r2

    obs3 = obs.copy()
    obs_r3 = rotate.rotate_one_station_stream(
        obs3, 0.0, 0.0, inventory=inv, mode="NE->RT",
        sanity_check=True)
    assert len(obs_r3) == 1
    assert obs_r3[0].stats.channel == "BHZ"
    assert obs_r3[0] == obs_r1.select(channel="BHZ")[0]