In this notebook we demonstrate the basic functionality of the om10 package, including how to:
You will need to have followed the installation instructions in the OM10 README.
In [ ]:
from __future__ import division, print_function
import os, numpy as np
import matplotlib
matplotlib.use('TkAgg')
%matplotlib inline
import om10
In [ ]:
%load_ext autoreload
%autoreload 2
In [ ]:
quads, doubles = {}, {}
In [ ]:
DES = om10.DB()
DES.select_random(maglim=23.6, area=5000.0, IQ=0.9)
quads['DES'] = DES.sample[DES.sample['NIMG'] == 4]
doubles['DES'] = DES.sample[DES.sample['NIMG'] == 2]
print('Predicted number of LSST quads, doubles: ', len(quads['DES']),',',len(doubles['DES']))
print('Predicted LSST quad fraction: ', str(int(100.0*len(quads['DES'])/(1.0*len(doubles['DES']))))+'%')
In [ ]:
LSST = om10.DB()
LSST.select_random(maglim=23.3, area=18000.0, IQ=0.7)
quads['LSST'] = LSST.sample[LSST.sample['NIMG'] == 4]
doubles['LSST'] = LSST.sample[LSST.sample['NIMG'] == 2]
print('Predicted number of LSST quads, doubles: ', len(quads['LSST']),',',len(doubles['LSST']))
print('Predicted LSST quad fraction: ', str(int(100.0*len(quads['LSST'])/(1.0*len(doubles['LSST']))))+'%')
In [ ]:
fig = om10.plot_sample(doubles['LSST'], color='blue')
fig = om10.plot_sample(quads['LSST'], color='red', fig=fig)
In [ ]:
db = om10.DB()
# Pull out a specific lens and plot it:
id = 7176527
lens = db.get_lens(id)
om10.plot_lens(lens)
In [ ]:
# Plot 3 random lenses from a given survey and plot them:
db.select_random(maglim=21.4, area=30000.0, IQ=1.0, Nlens=3)
for id in db.sample['LENSID']:
lens = db.get_lens(id)
om10.plot_lens(lens, IQ=1.0)
In [ ]: