Exemplo n.º 1
0
def test_serial_ensrf_localization():
    state = np.arange(15).reshape(5, 3)
    obs = np.array([6.5, 0.4])
    obs_error = np.array([0.25, 0.35])
    obs_idx = np.array([2, 0])
    localization = np.array([[0, 0.5, 1.0, 0.5, 0], [1.0, 0.5, 0, 0, 0]])
    goal = np.array([[0.04638048, 0.55555556, 1.06473063],
                     [3.09317382, 3.63919849, 4.18522316],
                     [6.1527864, 6.6, 7.0472136], [9.0763932, 9.8, 10.5236068],
                     [12., 13., 14.]])
    actual = serial_ensrf(state=state,
                          obs_value=obs,
                          obs_error=obs_error,
                          obs_idx=obs_idx,
                          inflation=None,
                          localization=localization)
    np.testing.assert_allclose(actual, goal, atol=1e-7, rtol=0)
Exemplo n.º 2
0
def test_serial_ensrf():
    state = np.arange(15).reshape(5, 3)
    obs = np.array([6.5, 0.4])
    obs_error = np.array([0.25, 0.35])
    obs_idx = np.array([2, 0])
    goal = np.array([[0.17051969, 0.52727273, 0.88402576],
                     [3.17051969, 3.52727273, 3.88402576],
                     [6.17051969, 6.52727273, 6.88402576],
                     [9.17051969, 9.52727273, 9.88402576],
                     [12.17051969, 12.52727273, 12.88402576]])
    actual = serial_ensrf(state=state,
                          obs_value=obs,
                          obs_error=obs_error,
                          obs_idx=obs_idx,
                          inflation=None,
                          localization=None)
    np.testing.assert_allclose(actual, goal, atol=1e-7, rtol=0)
Exemplo n.º 3
0
def test_serial_ensrf_localization_inflation():
    state = np.arange(15).reshape(5, 3)
    m = state.shape[0]
    obs = np.array([6.5, 0.4])
    obs_error = np.array([0.25, 0.35])
    obs_idx = np.array([2, 0])
    inflation = np.ones((m, 1)) * 2.0
    localization = np.array([[0, 0.5, 1.0, 0.5, 0], [1.0, 0.5, 0, 0, 0]])
    goal = np.array([[-0.11903277, 0.44827586, 1.01558449],
                     [2.79582855, 3.59332166, 4.39081477],
                     [6.04434051, 6.52941176, 7.01448301],
                     [8.52217026, 9.76470588, 11.00724151], [11., 13., 15.]])
    actual = serial_ensrf(state=state,
                          obs_value=obs,
                          obs_error=obs_error,
                          obs_idx=obs_idx,
                          inflation=inflation,
                          localization=localization)
    np.testing.assert_allclose(actual, goal, atol=1e-7, rtol=0)
Exemplo n.º 4
0
def test_serial_ensrf_inflation_2obs():
    state = np.arange(15).reshape(5, 3)
    m = state.shape[0]
    obs = np.array([6.5, 0.4])
    obs_error = np.array([0.25, 0.35])
    obs_idx = np.array([2, 0])
    inflation = np.ones((m, 1)) * 2.0
    goal = np.array([[0.10228226, 0.47738693, 0.85249161],
                     [3.10228226, 3.47738693, 3.85249161],
                     [6.10228226, 6.47738693, 6.85249161],
                     [9.10228226, 9.47738693, 9.85249161],
                     [12.10228226, 12.47738693, 12.85249161]])
    actual = serial_ensrf(state=state,
                          obs_value=obs,
                          obs_error=obs_error,
                          obs_idx=obs_idx,
                          inflation=inflation,
                          localization=None)
    np.testing.assert_allclose(actual, goal, atol=1e-7, rtol=0)
Exemplo n.º 5
0
def test_serial_ensrf_inflation_1obs():
    state = np.arange(15).reshape(5, 3)
    m = state.shape[0]
    obs = np.array([0.4])
    obs_error = np.array([0.35])
    obs_idx = np.array([0])
    inflation = np.ones((m, 1)) * 2.0
    goal = np.array([[-0.11903277, 0.44827586, 1.01558449],
                     [2.88096723, 3.44827586, 4.01558449],
                     [5.88096723, 6.44827586, 7.01558449],
                     [8.88096723, 9.44827586, 10.01558449],
                     [11.88096723, 12.44827586, 13.01558449]])
    actual = serial_ensrf(state=state,
                          obs_value=obs,
                          obs_error=obs_error,
                          obs_idx=obs_idx,
                          inflation=inflation,
                          localization=None)
    np.testing.assert_allclose(actual, goal, atol=1e-7, rtol=0)