Example #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
Example #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
Example #3
0
def simple_position_columns_file(make_data_path):
    return read(make_data_path('simple-position-columns.vot.xml'))
Example #4
0
def example_file(make_data_path):
    return read(make_data_path('ivoa.vot.xml'))
Example #5
0
def simple_position_file(make_data_path):
    return read(make_data_path('simple-position.vot.xml'))
Example #6
0
def time_series(make_data_path):
    return read(make_data_path('time-series.vot.xml'))
Example #7
0
def source_data(make_data_path):
    return read(make_data_path('photdm-source-test.vot.xml'))
Example #8
0
def constants_file(make_data_path):
    return read(make_data_path('constants.vot.xml'))
Example #9
0
def ts_file(make_data_path):
    return read(make_data_path('time-series.vot.xml'))
Example #10
0
def invalid_file(make_data_path):
    return read(make_data_path('invalid.vot.xml'))
Example #11
0
def asymmetric_data_file(make_data_path):
    return read(make_data_path('asymmetric-2d-position.vot.xml'))
Example #12
0
def time_file(make_data_path):
    return read(make_data_path('time.vot.xml'), fmt='votable')
Example #13
0
def sample_file(make_data_path):
    return read(make_data_path('sample.vot.xml'))
Example #14
0
def hsc_data_file(make_data_path):
    return read(make_data_path('hsc.vot.xml'))
Example #15
0
def orm_file(make_data_path):
    return read(make_data_path('orm.vot.xml'))
Example #16
0
def attributes_file(make_data_path):
    return read(make_data_path('attributes.vot.xml'))
Example #17
0
def compositions_file(make_data_path):
    return read(make_data_path('compositions.vot.xml'))
Example #18
0
def columns_file(make_data_path):
    return read(make_data_path('columns.vot.xml'))
Example #19
0
def references_file(make_data_path):
    return read(make_data_path('references.vot.xml'))
Example #20
0
def times_file(make_data_path):
    return read(make_data_path('time.vot.xml'))
Example #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)
Example #22
0
def literals_file(make_data_path):
    return read(make_data_path('literals.vot.xml'))