Esempio n. 1
0
def test_expand_to_2d_1():
    """Test 1"""
    input = slit_data_a()  # MultiSlitModel
    m_bkg_spec = user_bkg_spec_a()  # MultiSpecModel
    bkg = expand_to_2d.expand_to_2d(input, m_bkg_spec)
    truth_a = truth_array_a()

    assert np.allclose(bkg.slits[0].data, truth_a, rtol=1.e-6)
Esempio n. 2
0
def test_expand_to_2d_3():
    """Test 3"""
    input = image_data_c()  # ImageModel
    m_bkg_spec = user_bkg_spec_c()  # CombinedSpecModel
    bkg = expand_to_2d.expand_to_2d(input, m_bkg_spec)
    truth_c = truth_array_c()

    assert np.allclose(bkg.data, truth_c, rtol=1.e-6)
Esempio n. 3
0
def test_expand_to_2d_1():
    """Test 1"""

    input = slit_data_a()               # MultiSlitModel

    m_bkg_spec = user_bkg_spec_a()      # MultiSpecModel

    bkg = expand_to_2d.expand_to_2d(input, m_bkg_spec)

    truth_a = truth_array_a()

    assert np.allclose(bkg.slits[0].data, truth_a, rtol=1.e-6)
Esempio n. 4
0
def test_expand_to_2d_3():
    """Test 3"""

    input = image_data_c()              # ImageModel

    m_bkg_spec = user_bkg_spec_c()      # CombinedSpecModel

    bkg = expand_to_2d.expand_to_2d(input, m_bkg_spec)

    truth_c = truth_array_c()

    assert np.allclose(bkg.data, truth_c, rtol=1.e-6)
Esempio n. 5
0
def test_expand_to_2d_2():
    """Test 2"""
    # Same input data as in the first test.
    input = slit_data_a()  # MultiSlitModel
    # Check that expand_to_2d works if the wavelength array is reversed.
    # The flux array is also reversed, so the results should be unchanged.
    m_bkg_spec = user_bkg_spec_b()
    bkg = expand_to_2d.expand_to_2d(input, m_bkg_spec)
    # Same truth array as in the first test.
    truth_a = truth_array_a()

    assert np.allclose(bkg.slits[0].data, truth_a, rtol=1.e-6)
Esempio n. 6
0
def test_expand_to_2d_2():
    """Test 2"""

    # Same input data as in the first test.
    input = slit_data_a()               # MultiSlitModel

    # Check that expand_to_2d works if the wavelength array is reversed.
    # The flux array is also reversed, so the results should be unchanged.
    m_bkg_spec = user_bkg_spec_b()

    bkg = expand_to_2d.expand_to_2d(input, m_bkg_spec)

    # Same truth array as in the first test.
    truth_a = truth_array_a()

    assert np.allclose(bkg.slits[0].data, truth_a, rtol=1.e-6)