Exemple #1
0
def getUCD(tab):
    """Returns a list with all (valid) UCDs from a table"""
    from astropy.io.votable import ucd
    l1 = []
    for f in tab.fields():
        if not f.ucd:
            continue
        if not ucd.check_ucd(f.ucd):
            continue
        l2 = []
        for u in ucd.parse_ucd(f.ucd):
            _u = str(u[1])
            if not _u in l1:
                l2.append(_u)
        l1.extend(l2)
    return l1
Exemple #2
0
def test_none():
    assert ucd.check_ucd(None)
Exemple #3
0
def test_check():
    for s, p in examples.items():
        assert ucd.parse_ucd(s, True, True) == p
        assert ucd.check_ucd(s, True, True)