Exemplo n.º 1
0
def test_extractNoTrim():
    """
    2. Test the spectrum extraction function without a trim value.
    """

    testSpec = extractSpectrum(cube, [[30, 30]],
                               cals,
                               iscontinuum=False,
                               display=False)
    assert testSpec.shape[0] == 3 and isinstance(testSpec, np.ndarray)
Exemplo n.º 2
0
def test_extractContinuum():
    """
    3. Test continuum-extracted spectrum.
    """

    testSpec = extractSpectrum(cube, [[30, 30]],
                               cals,
                               iscontinuum=True,
                               display=False)
    assert testSpec.shape[0] == 3 and isinstance(testSpec, np.ndarray)
Exemplo n.º 3
0
def test_extractSpaxel():
    """
    1. Test the spectrum extraction function on a single spaxel.
    """

    testSpec = extractSpectrum(cube, [[30, 30]],
                               cals,
                               region=[100, -100],
                               iscontinuum=False,
                               display=False)
    assert testSpec.shape[0] == 3 and isinstance(testSpec, np.ndarray)
Exemplo n.º 4
0
def test_extractPairs():
    """
    5. Test the spectrum extraction function on a range of spaxels.
    
    Test passes, but as pairs of lists (list of [[x1, y1], [x2, y2] ...[xn, yn]]).
    """

    testSpec = extractSpectrum(cube, [[27, 27], [33, 33], [15, 30]],
                               cals,
                               region=[100, -100],
                               iscontinuum=False,
                               display=False)
    assert testSpec.shape[0] == 3 and isinstance(testSpec, np.ndarray)
Exemplo n.º 5
0
def test_extractLists():
    """
    4. Test the spectrum extraction function on a range of spaxels.
    
    Test passes, but as a list of spaxels (list of [[x1, x2, ... xn], [y1, y2, ... yn]]).
    """

    testSpec = extractSpectrum(cube, [[27, 33, 30], [27, 33, 30]],
                               cals,
                               region=[100, -100],
                               iscontinuum=False,
                               display=False)
    assert testSpec.shape[0] == 3 and isinstance(testSpec, np.ndarray)