コード例 #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
コード例 #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
コード例 #3
0
def simple_position_columns_file(make_data_path):
    return read(make_data_path('simple-position-columns.vot.xml'))
コード例 #4
0
def example_file(make_data_path):
    return read(make_data_path('ivoa.vot.xml'))
コード例 #5
0
def simple_position_file(make_data_path):
    return read(make_data_path('simple-position.vot.xml'))
コード例 #6
0
def time_series(make_data_path):
    return read(make_data_path('time-series.vot.xml'))
コード例 #7
0
def source_data(make_data_path):
    return read(make_data_path('photdm-source-test.vot.xml'))
コード例 #8
0
def constants_file(make_data_path):
    return read(make_data_path('constants.vot.xml'))
コード例 #9
0
ファイル: test_timeseries.py プロジェクト: mcdittmar/rama
def ts_file(make_data_path):
    return read(make_data_path('time-series.vot.xml'))
コード例 #10
0
def invalid_file(make_data_path):
    return read(make_data_path('invalid.vot.xml'))
コード例 #11
0
def asymmetric_data_file(make_data_path):
    return read(make_data_path('asymmetric-2d-position.vot.xml'))
コード例 #12
0
ファイル: test_time.py プロジェクト: tomdonaldson/rama
def time_file(make_data_path):
    return read(make_data_path('time.vot.xml'), fmt='votable')
コード例 #13
0
def sample_file(make_data_path):
    return read(make_data_path('sample.vot.xml'))
コード例 #14
0
def hsc_data_file(make_data_path):
    return read(make_data_path('hsc.vot.xml'))
コード例 #15
0
def orm_file(make_data_path):
    return read(make_data_path('orm.vot.xml'))
コード例 #16
0
def attributes_file(make_data_path):
    return read(make_data_path('attributes.vot.xml'))
コード例 #17
0
def compositions_file(make_data_path):
    return read(make_data_path('compositions.vot.xml'))
コード例 #18
0
def columns_file(make_data_path):
    return read(make_data_path('columns.vot.xml'))
コード例 #19
0
def references_file(make_data_path):
    return read(make_data_path('references.vot.xml'))
コード例 #20
0
def times_file(make_data_path):
    return read(make_data_path('time.vot.xml'))
コード例 #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)
コード例 #22
0
def literals_file(make_data_path):
    return read(make_data_path('literals.vot.xml'))