def test_spec_accels(params, expected):
    m = DBC14(Scenario(**params))
    np.testing.assert_allclose(
        m.interp_spec_accels(expected['periods']),
        # Need to convert from m/sec to g
        np.array(expected['spec_accels']) / m.GRAVITY,
        rtol=RTOL,
        err_msg='Spectral accelerations')
def test_im_values(params, expected, key):
    m = DBC14(Scenario(**params))
    # PGA needs to be converted from m/sec² to g, and PGV need to be
    # converted from m/sec into cm/sec
    scale = m.GRAVITY if key == "pga" else 0.01

    np.testing.assert_allclose(
        getattr(m, key),
        expected[key] / scale,
        rtol=RTOL,
    )
def model():
    """Instance of the DBC13 model."""
    return DBC14(Scenario(dist_jb=10, mag=6, v_s30=600, depth_hyp=10, mechanism="SS"))