예제 #1
0
def test_amb_from_baseline():
    N_true = np.array([22, 23, 34, -123])
    DE = np.matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 1, 1]])
    b = np.array([1, 1, 1])
    dd_obs = bl.predict_carrier_obs_(N_true, DE, b)
    N = bl.amb_from_baseline_(DE, dd_obs, b)
    assert np.allclose(N, N_true)
예제 #2
0
def test_predict_carrier_obs2():
  N = np.array([222.2])
  DE = np.matrix([[3, 4, 5]])
  b = np.array([7, 8, 9])
  dd_obs_expected = np.array([(3*7 + 4*8 + 5*9)/0.19023800915688557 + 222.2])
  dd_obs = bl.predict_carrier_obs_(N, DE, b)
  assert np.allclose(dd_obs, dd_obs_expected)
예제 #3
0
def test_lesq_solution2():
    # Exactly constrained.
    N = np.array([22, 23, 34])
    DE = np.matrix([[1, 0, 0], [0, 1, 0], [1, 1, 1]])
    b_true = np.array([1.234, 1.456, 1.789])
    dd_obs = bl.predict_carrier_obs_(N, DE, b_true)
    code, b, resid = bl.lesq_solution_float_(dd_obs, N, DE)
    assert code == 0
    assert np.allclose(b, b_true)
예제 #4
0
def test_predict_carrier_obs2():
    N = np.array([222.2])
    DE = np.matrix([[3, 4, 5]])
    b = np.array([7, 8, 9])
    dd_obs_expected = np.array([
        (3 * 7 + 4 * 8 + 5 * 9) / 0.19023800915688557 + 222.2
    ])
    dd_obs = bl.predict_carrier_obs_(N, DE, b)
    assert np.allclose(dd_obs, dd_obs_expected)
예제 #5
0
def test_predict_carrier_obs():
    N = np.array([22.2, 23.3, 34.4, 123.4])
    DE = np.matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 1, 1]])
    b = np.array([1, 1, 1])
    dd_obs = bl.predict_carrier_obs_(N, DE, b)
    dd_obs_expected = np.array([
        1.0 / 0.19023800915688557 + 22.2, 1.0 / 0.19023800915688557 + 23.3,
        1.0 / 0.19023800915688557 + 34.4, 3.0 / 0.19023800915688557 + 123.4
    ])
    assert np.allclose(dd_obs, dd_obs_expected)
예제 #6
0
def test_amb_from_baseline():
  N_true = np.array([22, 23, 34, -123])
  DE = np.matrix([[1, 0, 0],
                  [0, 1, 0],
                  [0, 0, 1],
                  [1, 1, 1]])
  b = np.array([1, 1, 1])
  dd_obs = bl.predict_carrier_obs_(N_true, DE, b)
  N = bl.amb_from_baseline_(DE, dd_obs, b)
  assert np.allclose(N, N_true)
예제 #7
0
def test_lesq_solution2():
  # Exactly constrained.
  N = np.array([22, 23, 34])
  DE = np.matrix([[1, 0, 0],
                  [0, 1, 0],
                  [1, 1, 1]])
  b_true = np.array([1.234, 1.456, 1.789])
  dd_obs = bl.predict_carrier_obs_(N, DE, b_true)
  code, b, resid = bl.lesq_solution_float_(dd_obs, N, DE)
  assert code == 0
  assert np.allclose(b, b_true)
예제 #8
0
def test_predict_carrier_obs():
  N = np.array([22.2, 23.3, 34.4, 123.4])
  DE = np.matrix([[1, 0, 0],
                  [0, 1, 0],
                  [0, 0, 1],
                  [1, 1, 1]])
  b = np.array([1, 1, 1])
  dd_obs = bl.predict_carrier_obs_(N, DE, b)
  dd_obs_expected = np.array([1.0/0.19023800915688557 + 22.2,
                              1.0/0.19023800915688557 + 23.3,
                              1.0/0.19023800915688557 + 34.4,
                              3.0/0.19023800915688557 + 123.4])
  assert np.allclose(dd_obs, dd_obs_expected)
예제 #9
0
def test_lesq_solution4():
    # Over constrained, integer valued ambiguity
    N = np.array([22, 23, 34, -123])
    DE = np.matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 1, 1]])
    b_true = np.array([1.234, 1.456, 1.789])
    dd_obs = bl.predict_carrier_obs_(N, DE, b_true)
    N_int = N
    code, num_used, residuals, removed_obs, b \
      = bl.lesq_solve_raim_(dd_obs, N_int, DE, False, bl.DEFAULT_RAIM_THRESHOLD_)
    assert num_used == 4
    assert np.allclose(
        residuals,
        np.array(
            [1.77635684e-15, -3.55271368e-15, -5.32907052e-15,
             3.55271368e-15]))
    assert removed_obs == 0
    assert np.allclose(b, np.array([1.234, 1.456, 1.789]))
    assert np.allclose(b, b_true)
예제 #10
0
def test_lesq_solution4():
  # Over constrained, integer valued ambiguity
  N = np.array([22, 23, 34, -123])
  DE = np.matrix([[1, 0, 0],
                  [0, 1, 0],
                  [0, 0, 1],
                  [1, 1, 1]])
  b_true = np.array([1.234, 1.456, 1.789])
  dd_obs = bl.predict_carrier_obs_(N, DE, b_true)
  N_int = N
  code, num_used, residuals, removed_obs, b \
    = bl.lesq_solve_raim_(dd_obs, N_int, DE, False, bl.DEFAULT_RAIM_THRESHOLD_)
  assert num_used == 4
  assert np.allclose(residuals,
                     np.array([  1.77635684e-15,  -3.55271368e-15,
                                 -5.32907052e-15,   3.55271368e-15]))
  assert removed_obs == 0
  assert np.allclose(b, np.array([ 1.234,  1.456,  1.789]))
  assert np.allclose(b, b_true)