In [1]:
import astropy.io.ascii as asc, astropy.table, numpy
table = asc.read('one-table-to-rule-them-all.tbl')
In [2]:
sp = table['Component Sp (Franzen)']
s = table['Component S (Franzen)']
franzen_ratios = s / sp
clean = astropy.table.Table(data=[table['Key'], franzen_ratios < 1], names=['Key', 'Clean'], dtype=[int, int])
clean.write('clean-atlas.tbl', format='ascii')
resolved = astropy.table.Table(data=[table['Key'], franzen_ratios > 1], names=['Key', 'Clean'], dtype=[int, int])
resolved.write('resolved-atlas.tbl', format='ascii')
clean
Out[2]:
In [35]:
# Analysis: How many of the clean objects have Norris labels?
has_norris_label = [bool(i) and i.startswith('SWIRE') for i in table['Source SWIRE (Norris)']]
print('Compact and Norris-labelled:', numpy.logical_and(franzen_ratios < 1, has_norris_label).sum())
print('Resolved and Norris-labelled:', numpy.logical_and(franzen_ratios > 1, has_norris_label).sum())
In [36]:
# Analysis: How many of the clean objects have RGZ labels?
has_rgz_label = [bool(i) for i in table['Source SWIRE Name (RGZ)']]
print('Compact and RGZ-labelled:', numpy.logical_and(franzen_ratios < 1, has_rgz_label).sum())
print('Resolved and RGZ-labelled:', numpy.logical_and(franzen_ratios > 1, has_rgz_label).sum())
In [38]:
# Analysis: How many of the clean objects have both Norris and RGZ labels?
has_both_label = numpy.logical_and(has_norris_label, has_rgz_label)
print('Compact and labelled:', numpy.logical_and(franzen_ratios < 1, has_both_label).sum())
print('Resolved and labelled:', numpy.logical_and(franzen_ratios > 1, has_both_label).sum())
In [ ]: