示例#1
0
def votablefile_errorstatus():
    votablefile = _votablefile()

    info = Info(name='QUERY_STATUS', value='ERROR')
    info.content = 'ERROR'
    votablefile.resources[0].infos[0] = info

    return votablefile
示例#2
0
def _votablefile():
    table = Table(
        [[23, 42, 1337],
         [b'Illuminatus', b"Don't panic, and always carry a towel", b'Elite']],
        names=('1', '2'))

    table['1'].meta['ucd'] = 'foo;bar'

    table['2'].meta['utype'] = 'foobar'

    votablefile = VOTableFile.from_table(table)

    info = Info(name='QUERY_STATUS', value='OK')
    info.content = 'OK'
    votablefile.resources[0].infos.append(info)

    return votablefile
示例#3
0
def votablefile_dataset():
    table = Table([[
        'image/fits', 'application/x-votable+xml',
        'application/x-votable+xml;content=datalink'
    ],
                   [
                       b'http://example.com/querydata/image.fits',
                       b'http://example.com/querydata/votable.xml',
                       b'http://example.com/querydata/votable-datalink.xml'
                   ]],
                  names=('dataformat', 'dataurl'))

    table['dataformat'].meta['ucd'] = 'meta.code.mime'
    table['dataurl'].meta['utype'] = 'Access.Reference'
    table['dataurl'].meta['ucd'] = 'meta.dataset;meta.ref.url'

    votablefile = VOTableFile.from_table(table)

    info = Info(name='QUERY_STATUS', value='OK')
    info.content = 'OK'
    votablefile.resources[0].infos.append(info)

    return votablefile