Example #1
0
def test_match_template_to_layer():
    result = match_template_to_layer(test_layer, test_template)
    assert_allclose(
        result.shape,
        layer_shape - template_shape + 1,
    )
    assert_allclose(np.max(result), 1.00, rtol=1e-2, atol=0)
Example #2
0
def test_find_best_match_location():
    result = match_template_to_layer(test_layer, test_template)
    match_location = u.Quantity(find_best_match_location(result))
    assert_allclose(match_location.value,
                    np.array(result.shape) / 2. - 0.5 + shift,
                    rtol=1e-3,
                    atol=0)
Example #3
0
def test_match_template_to_layer(
    aia171_test_map_layer, aia171_test_template, aia171_test_map_layer_shape, aia171_test_template_shape
):

    result = match_template_to_layer(aia171_test_map_layer, aia171_test_template)
    assert_allclose(result.shape[0], aia171_test_map_layer_shape[0] - aia171_test_template_shape[0] + 1)
    assert_allclose(result.shape[1], aia171_test_map_layer_shape[1] - aia171_test_template_shape[1] + 1)
    assert_allclose(np.max(result), 1.00, rtol=1e-2, atol=0)
Example #4
0
def test_match_template_to_layer(aia171_test_map_layer,
                                 aia171_test_template,
                                 aia171_test_map_layer_shape,
                                 aia171_test_template_shape):

    result = match_template_to_layer(aia171_test_map_layer, aia171_test_template)
    assert_allclose(result.shape[0], aia171_test_map_layer_shape[0] - aia171_test_template_shape[0] + 1, )
    assert_allclose(result.shape[1], aia171_test_map_layer_shape[1] - aia171_test_template_shape[1] + 1, )
    assert_allclose(np.max(result), 1.00, rtol=1e-2, atol=0)
Example #5
0
def test_find_best_match_location(aia171_test_map_layer, aia171_test_template,
                                  aia171_test_shift):

    result = match_template_to_layer(aia171_test_map_layer, aia171_test_template)
    match_location = u.Quantity(find_best_match_location(result))
    assert_allclose(match_location.value, np.array(result.shape)/2. - 0.5 + aia171_test_shift, rtol=1e-3, atol=0)
Example #6
0
def test_find_best_match_location():
    result = match_template_to_layer(test_layer, test_template)
    y_test, x_test = find_best_match_location(result)
    assert_allclose(y_test, 257.0, rtol=1e-3, atol=0)
    assert_allclose(x_test, 258.0, rtol=1e-3, atol=0)
Example #7
0
def test_match_template_to_layer():
    result = match_template_to_layer(test_layer, test_template)
    assert(result.shape[0] == 513)
    assert(result.shape[1] == 513)
    assert_allclose(np.max(result), 1.00, rtol=1e-2, atol=0)
Example #8
0
def test_find_best_match_location():
    result = match_template_to_layer(test_layer, test_template)
    y_test, x_test = find_best_match_location(result)
    assert_allclose(y_test, 257.0, rtol=1e-3, atol=0)
    assert_allclose(x_test, 258.0, rtol=1e-3, atol=0)
Example #9
0
def test_match_template_to_layer():
    result = match_template_to_layer(test_layer, test_template)
    assert(result.shape[0] == 513)
    assert(result.shape[1] == 513)
    assert_allclose(np.max(result), 1.00, rtol=1e-2, atol=0)