In this notebook we look at the intersections between three catalogues: 20140111!Franzen, RGZ, and Norris. This incarnation of the Franzen was a prerelease catalogue used for RGZ, so everything in Franzen should be in RGZ. Additionally, the component IDs should all match up. We expect that for every Norris object, there should be a corresponding Franzen object, modulo the edges of the SWIRE field. If there is not, we need to look at the flux distributions of the different parts of the Venn diagram, as well as the position of the objects on the sky.
In [57]:
import astropy.io.ascii as asc
table = asc.read('one-table-to-rule-them-all.tbl')
table
Out[57]:
In [63]:
# Venn diagram time!
rgz = {i['Key'] for i in table if i['Component Zooniverse ID (RGZ)']}
norris = {i['Key'] for i in table if i['Component # (Norris)']}
franzen = {i['Key'] for i in table if i['Component ID (Franzen)']}
In [60]:
import matplotlib.pyplot as plt
from matplotlib_venn import venn3
import matplotlib.patches
%matplotlib inline
def plot_venn():
plt.figure(figsize=(8, 8))
v = venn3([rgz, norris, franzen], set_labels=None, set_colors=('r', 'g', 'b'))
plt.legend(handles=[
matplotlib.patches.Patch(color='r', alpha=0.5, label='RGZ'),
matplotlib.patches.Patch(color='g', alpha=0.5, label='Norris'),
matplotlib.patches.Patch(color='b', alpha=0.5, label='Franzen'),
], loc='best')
plt.show()
plot_venn()
So RGZ is a proper(!) subset of Franzen, and Norris is not a subset of Franzen. Let's plot the integrated flux distributions for each subset.
In [64]:
import seaborn, numpy
In [65]:
# Overall flux distribution.
# Columns: Component Int flux (Norris), Component S (Franzen)
fluxes = []
for nflux, fflux in zip(table['Component Int flux (Norris)'], table['Component S (Franzen)']):
if fflux:
fluxes.append(fflux)
elif nflux:
fluxes.append(nflux)
else:
continue
seaborn.distplot(numpy.log(fluxes))
plt.title('Overall Flux Distribution')
plt.xlabel('log $S$')
plt.ylabel('Number Density')
Out[65]:
In [66]:
# Norris & Franzen flux distribution.
norris_franzen_fluxes = []
for row in table:
if row['Key'] not in norris & franzen:
continue
nflux, fflux = row['Component Int flux (Norris)'], row['Component S (Franzen)']
if fflux:
norris_franzen_fluxes.append(fflux)
elif nflux:
norris_franzen_fluxes.append(nflux)
else:
continue
seaborn.distplot(numpy.log(norris_franzen_fluxes), color='brown')
plt.title('Norris $\cap$ Franzen Flux Distribution')
plt.xlabel('log $S$')
plt.ylabel('Number Density')
Out[66]:
In [67]:
# Norris - Franzen flux distribution.
norris_no_franzen_fluxes = []
for row in table:
if row['Key'] not in norris - franzen:
continue
nflux, fflux = row['Component Int flux (Norris)'], row['Component S (Franzen)']
if fflux:
norris_no_franzen_fluxes.append(fflux)
elif nflux:
norris_no_franzen_fluxes.append(nflux)
else:
continue
seaborn.distplot(numpy.log(norris_no_franzen_fluxes), color='green')
plt.title('Norris \\ Franzen Flux Distribution')
plt.xlabel('log $S$')
plt.ylabel('Number Density')
Out[67]:
In [68]:
# Franzen - Norris flux distribution.
franzen_no_norris_fluxes = []
for row in table:
if row['Key'] not in franzen - norris:
continue
nflux, fflux = row['Component Int flux (Norris)'], row['Component S (Franzen)']
if fflux:
franzen_no_norris_fluxes.append(fflux)
elif nflux:
franzen_no_norris_fluxes.append(nflux)
else:
continue
seaborn.distplot(numpy.log(franzen_no_norris_fluxes))
plt.title('Franzen \\ Norris Flux Distribution')
plt.xlabel('log $S$')
plt.ylabel('Number Density')
Out[68]:
In [69]:
# Franzen - RGZ flux distribution.
franzen_no_rgz_fluxes = []
for row in table:
if row['Key'] not in franzen - rgz:
continue
nflux, fflux = row['Component Int flux (Norris)'], row['Component S (Franzen)']
if fflux:
franzen_no_rgz_fluxes.append(fflux)
elif nflux:
franzen_no_rgz_fluxes.append(nflux)
else:
continue
seaborn.distplot(numpy.log(franzen_no_rgz_fluxes), color='blue')
plt.title('Franzen \\ RGZ Flux Distribution')
plt.xlabel('log $S$')
plt.ylabel('Number Density')
Out[69]:
Let's plot the positions on the sky of each subset.
In [75]:
def decimalify(ras, decs):
from astropy.coordinates import SkyCoord
coords = []
for ra, dec in zip(ras, decs):
sc = SkyCoord(ra=ra, dec=dec, unit=('hourangle', 'deg'))
coords.append((sc.ra.deg, sc.dec.deg))
return zip(*coords)
plt.scatter(table[sorted(franzen - rgz - norris)]['Component RA (Franzen)'],
table[sorted(franzen - rgz - norris)]['Component DEC (Franzen)'],
color='lightblue', marker='+', label='Franzen \\ (RGZ $\cup$ Norris)')
plt.scatter(table[sorted((franzen - rgz) & norris)]['Component RA (Franzen)'],
table[sorted((franzen - rgz) & norris)]['Component DEC (Franzen)'],
color='blue', marker='+', label='(Franzen \\ RGZ) $\cap$ Norris')
plt.scatter(table[sorted(rgz - norris)]['Component RA (Franzen)'],
table[sorted(rgz - norris)]['Component DEC (Franzen)'],
color='pink', marker='+', label='RGZ \\ Norris')
plt.scatter(table[sorted(rgz & norris)]['Component RA (Franzen)'],
table[sorted(rgz & norris)]['Component DEC (Franzen)'],
color='hotpink', marker='+', label='RGZ $\cap$ Norris')
plt.scatter(*decimalify(table[sorted(norris - franzen)]['Component Radio RA (Norris)'],
table[sorted(norris - franzen)]['Component Radio dec (Norris)']),
color='green', marker='+', label='Norris \\ RGZ')
plt.legend(loc=9, bbox_to_anchor=(0.5, -0.1), ncol=3)
Out[75]:
In [47]:
ras, decs = decimalify(table[sorted(norris - franzen)]['Component Radio RA (Norris)'], table[sorted(norris - franzen)]['Component Radio dec (Norris)'])
In [51]:
import astropy.table
norris_not_franzen = astropy.table.Table(data=[ras, decs, [0.05] * len(ras), [0.05] * len(ras)],
names=['ra', 'dec', 'w', 'h'])
In [52]:
for row in norris_not_franzen:
print('CROSS', row['ra'], row['dec'], row['w'], row['h'])
In [ ]:
In [ ]: