This file is indexed.

/usr/lib/python3/dist-packages/reproject/healpix/tests/test_utils.py is in python3-reproject 0.3.1-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import numpy as np

from astropy.tests.helper import pytest
from astropy.coordinates import FK5, Galactic, ICRS
from astropy.io import fits

try:
    import healpy
    HAS_HEALPY = True
except:
    HAS_HEALPY = False

from ..utils import parse_coord_system, parse_input_healpix_data

def test_parse_coord_system():

    frame = parse_coord_system(Galactic())
    assert isinstance(frame, Galactic)

    frame = parse_coord_system('fk5')
    assert isinstance(frame, FK5)

    with pytest.raises(ValueError) as exc:
        frame = parse_coord_system('e')
    assert exc.value.args[0] == "Ecliptic coordinate frame not yet supported"

    frame = parse_coord_system('g')
    assert isinstance(frame, Galactic)

    with pytest.raises(ValueError) as exc:
        frame = parse_coord_system('spam')
    assert exc.value.args[0] == "Could not determine frame for system=spam"


@pytest.mark.skipif('not HAS_HEALPY')
def test_parse_input_healpix_data(tmpdir):

    data = np.arange(3072)

    col = fits.Column(array=data, name='flux', format="E")
    hdu = fits.BinTableHDU.from_columns([col])
    hdu.header['NSIDE'] = 512
    hdu.header['COORDSYS'] = "G"

    # As HDU
    array, coordinate_system = parse_input_healpix_data(hdu)
    np.testing.assert_allclose(array, data)

    # As filename
    filename = tmpdir.join('test.fits').strpath
    hdu.writeto(filename)
    array, coordinate_system = parse_input_healpix_data(filename)
    np.testing.assert_allclose(array, data)

    # As array
    array, coordinate_system = parse_input_healpix_data((data, "galactic"))
    np.testing.assert_allclose(array, data)

    # Invalid
    with pytest.raises(TypeError) as exc:
        parse_input_healpix_data(data)
    assert exc.value.args[0] == "input_data should either be an HDU object or a tuple of (array, frame)"