Exemplo n.º 1
0
def test_dyfi():
    eventid = 'se60247871'
    detail = get_event_by_id(eventid, includesuperseded=True)
    datadir = get_datadir()
    tape_file = os.path.join(datadir, 'vcr_dyfi_dataframe.yaml')
    with vcr.use_cassette(tape_file):
        df1km = get_dyfi_data_frame(detail, dyfi_file='utm_1km')
        np.testing.assert_almost_equal(df1km['intensity'].sum(), 14887.3)
        df10km = get_dyfi_data_frame(detail, dyfi_file='utm_10km')
        np.testing.assert_almost_equal(df10km['intensity'].sum(), 3479.5)
        dfutm = get_dyfi_data_frame(detail, dyfi_file='utm_var')
        np.testing.assert_almost_equal(dfutm['intensity'].sum(), 3479.5)
        dfzip = get_dyfi_data_frame(detail, dyfi_file='zip')
        np.testing.assert_almost_equal(dfzip['intensity'].sum(), 2344.7)
Exemplo n.º 2
0
def test_dyfi():
    eventid = 'se60247871'
    detail = get_event_by_id(eventid, includesuperseded=True)
    datadir = get_datadir()
    tape_file = os.path.join(datadir, 'vcr_dyfi_dataframe.yaml')
    with vcr.use_cassette(tape_file):
        df1km = get_dyfi_data_frame(detail, dyfi_file='utm_1km')
        np.testing.assert_almost_equal(df1km['intensity'].sum(), 14915.4)
        df10km = get_dyfi_data_frame(detail, dyfi_file='utm_10km')
        np.testing.assert_almost_equal(df10km['intensity'].sum(), 3484.5)
        dfutm = get_dyfi_data_frame(detail, dyfi_file='utm_var')
        np.testing.assert_almost_equal(dfutm['intensity'].sum(), 3484.5)
        dfzip = get_dyfi_data_frame(detail, dyfi_file='zip')
        np.testing.assert_almost_equal(dfzip['intensity'].sum(), 2348.5)
Exemplo n.º 3
0
def test_dyfi():
    eventid = "se60247871"
    detail = get_event_by_id(eventid, includesuperseded=True)
    cassettes, datadir = get_datadir()
    tape_file = os.path.join(cassettes, "dataframes_dyfi.yaml")
    with vcr.use_cassette(tape_file, record_mode="new_episodes"):
        df1km = get_dyfi_data_frame(detail, dyfi_file="utm_1km")
        np.testing.assert_almost_equal(df1km["intensity"].sum(), 14628.3)
        df10km = get_dyfi_data_frame(detail, dyfi_file="utm_10km")
        np.testing.assert_almost_equal(df10km["intensity"].sum(), 3459.0)
        dfutm = get_dyfi_data_frame(detail, dyfi_file="utm_var")
        np.testing.assert_almost_equal(dfutm["intensity"].sum(), 3459.0)
        dfzip = get_dyfi_data_frame(detail, dyfi_file="zip")
        np.testing.assert_almost_equal(dfzip["intensity"].sum(), 2296.3)