Exemplo n.º 1
0
def test_read_bad_format(recwarn):
    """
    Tests read() with unsupported format
    """
    try:
        read('sample.vot.xml', 'fits')
    except AttributeError as ex:
        assert "No such format" in str(ex)
        pass

    assert len(recwarn) == 0
Exemplo n.º 2
0
def test_read_file_dne(recwarn):
    """
    Tests read() with non-existing file
    """
    try:
        read('sample.vot.xml', 'votable')
    except OSError as ex:
        assert "Error reading file" in str(ex)
        pass

    assert len(recwarn) == 0
Exemplo n.º 3
0
def simple_position_columns_file(make_data_path):
    return read(make_data_path('simple-position-columns.vot.xml'))
Exemplo n.º 4
0
def example_file(make_data_path):
    return read(make_data_path('ivoa.vot.xml'))
Exemplo n.º 5
0
def simple_position_file(make_data_path):
    return read(make_data_path('simple-position.vot.xml'))
Exemplo n.º 6
0
def time_series(make_data_path):
    return read(make_data_path('time-series.vot.xml'))
Exemplo n.º 7
0
def source_data(make_data_path):
    return read(make_data_path('photdm-source-test.vot.xml'))
Exemplo n.º 8
0
def constants_file(make_data_path):
    return read(make_data_path('constants.vot.xml'))
Exemplo n.º 9
0
def ts_file(make_data_path):
    return read(make_data_path('time-series.vot.xml'))
Exemplo n.º 10
0
def invalid_file(make_data_path):
    return read(make_data_path('invalid.vot.xml'))
Exemplo n.º 11
0
def asymmetric_data_file(make_data_path):
    return read(make_data_path('asymmetric-2d-position.vot.xml'))
Exemplo n.º 12
0
def time_file(make_data_path):
    return read(make_data_path('time.vot.xml'), fmt='votable')
Exemplo n.º 13
0
def sample_file(make_data_path):
    return read(make_data_path('sample.vot.xml'))
Exemplo n.º 14
0
def hsc_data_file(make_data_path):
    return read(make_data_path('hsc.vot.xml'))
Exemplo n.º 15
0
def orm_file(make_data_path):
    return read(make_data_path('orm.vot.xml'))
Exemplo n.º 16
0
def attributes_file(make_data_path):
    return read(make_data_path('attributes.vot.xml'))
Exemplo n.º 17
0
def compositions_file(make_data_path):
    return read(make_data_path('compositions.vot.xml'))
Exemplo n.º 18
0
def columns_file(make_data_path):
    return read(make_data_path('columns.vot.xml'))
Exemplo n.º 19
0
def references_file(make_data_path):
    return read(make_data_path('references.vot.xml'))
Exemplo n.º 20
0
def times_file(make_data_path):
    return read(make_data_path('time.vot.xml'))
Exemplo n.º 21
0
from rama import read
from rama.models.source import SourcePosition
from rama.models.coordinates import SpaceFrame
from rama.models.photdmalt import PhotometryFilter

parser = read('simple.vot.xml')

print(parser)

print('SpaceFrame:')
space_frames = parser.find_instances(SpaceFrame)
for sf in space_frames:
    print(sf.space_ref_frame)

print('\nSourcePosition:')
source_positions = parser.find_instances(SourcePosition)
for pos in source_positions:
    print(pos.coord)
    print(pos.coord.frame)
    print(pos.coord.ra.degree)
    print(type(pos.coord.frame))

print('\nPhotometryFilter:')
phot_filters = parser.find_instances(PhotometryFilter)
for pf in phot_filters:
    print(pf.name)
    print('   TransmissionPoint:')
    if pf.transmission_point is not None:
        for tp in pf.transmission_point:
            print(tp.spectral)
            print(tp.spectral_error)
Exemplo n.º 22
0
def literals_file(make_data_path):
    return read(make_data_path('literals.vot.xml'))