plt.scatter(db.lenses['ZLENS'],db.lenses['APMAG_I'],color='Orange',marker='.',label='OM10')
plt.scatter(data[:,2],data[:,6],color='Blue',marker='.',label='CFHTLS')
plt.scatter(matched['ZLENS'],matched['APMAG_I'],color='Lime',marker='.',label='Matched OM10',alpha=.05)
plt.title('CFHTLS vs. OM10 Catalogs')
plt.xlabel('Deflector redshift z')
plt.ylabel('Deflector i-band magnitude (AB)')
plt.legend(loc=4)

"""
Explanation: We see that the strange footprint observed in our OM10 matched catalog comes directly from the footprint of the input CFHTLS catalog
End of explanation
"""


print len(matched)/len(db.lenses)

db.select_random(maglim=21.4,area=100000.0,IQ=1.0)

ps1matched = db.sample[db.sample['DEC'] > -99]
plt.scatter(db.sample['ZLENS'],db.sample['APMAG_I'],color='Orange',marker='.',label='OM10--PS1')
plt.scatter(data[:,2],data[:,6],color='Blue',marker='.',label='CFHTLS')
plt.scatter(ps1matched['ZLENS'],ps1matched['APMAG_I'],color='Fuchsia',marker='.',label='Matched OM10--PS1',alpha=.5)
plt.title('CFHTLS vs. OM10 Catalogs')
plt.xlabel('Deflector redshift z')
plt.ylabel('Deflector i-band magnitude (AB)')
plt.legend(loc=4)

print len(ps1matched)/len(db.sample)

"""
Explanation: Clearly, the OM10 catalog is extended in MAGI/z space well beyond the CFHT reference.
End of explanation
"""


