In [1]:
# This changes the current directory to the base saga directory - make sure to run this first!
# This is necessary to be able to import the py files and use the right directories,
# while keeping all the notebooks in their own directory.
import os
import sys
if 'saga_base_dir' not in locals():
saga_base_dir = os.path.abspath('..')
if saga_base_dir not in sys.path:
os.chdir(saga_base_dir)
In [45]:
import hosts
import targeting
import mmthecto
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.table import Table
In [3]:
%matplotlib inline
from matplotlib import pyplot as plt
from matplotlib import rcParams
rcParams['image.interpolation'] = 'none'
rcParams['figure.figsize'] = (16, 10)
In [14]:
hostlst = hosts.get_saga_hosts_from_google(useobservingsummary=True)
In [17]:
st = [h for h in hostlst if h.name == 'StarTrek']
assert len(st)==1
st = st[0]
In [18]:
dune = [h for h in hostlst if h.name == 'Dune']
assert len(dune)==1
dune = dune[0]
In [19]:
md = [h for h in hostlst if h.name == 'MobyDick']
assert len(md)==1
md = md[0]
In [46]:
gilg = hosts.gilgamesh
In [22]:
stcat = ascii.read('catalogs/mmt2015a2_nsa{0}.dat'.format(st.nsaid), format='basic', names='ra,dec,objID,r,fibermag_r,rank'.split(','))
len(stcat)
Out[22]:
In [29]:
plt.scatter(stcat['ra'],stcat['dec'], c=stcat['rank'])
plt.colorbar()
None
In [30]:
plt.hist(stcat['fibermag_r'],bins=100)
None
In [34]:
msk = stcat['fibermag_r'] < 20
targeting.sampled_imagelist(stcat['ra'][msk],stcat['dec'][msk],None,
names=['fm_r={0}-rank={1}'.format(icat['fibermag_r'],icat['rank']) for icat in stcat[msk]])
None
In [36]:
msk = stcat['fibermag_r'] > 22
targeting.sampled_imagelist(stcat['ra'][msk],stcat['dec'][msk],None,
names=['fm_r={0}-rank={1}'.format(icat['fibermag_r'],icat['rank']) for icat in stcat[msk]])
None
In [43]:
stoutcat = mmthecto.generate_catalog(st, stcat, stcat['rank'],
repeatflux=5, removefluxdistance=1*u.arcmin,
fnout='mmthecto/{0}_mar2015.cat'.format(st.name),
fluxfnout='mmthecto/{0}_mar2015.fluxstars'.format(st.name))
In [23]:
mdcat = ascii.read('catalogs/mmt2015a2_nsa{0}.dat'.format(md.nsaid), format='basic', names='ra,dec,objID,r,fibermag_r,rank'.split(','))
len(mdcat)
Out[23]:
In [32]:
plt.scatter(mdcat['ra'],mdcat['dec'], c=mdcat['rank'])
plt.colorbar()
None
In [42]:
stoutcat = mmthecto.generate_catalog(md, mdcat, mdcat['rank'],
repeatflux=5, removefluxdistance=1*u.arcmin,
fnout='mmthecto/{0}_mar2015.cat'.format(md.name),
fluxfnout='mmthecto/{0}_mar2015.fluxstars'.format(md.name))
In [24]:
dunecat = ascii.read('catalogs/mmt2015a2_nsa{0}.dat'.format(dune.nsaid), format='basic', names='ra,dec,objID,r,fibermag_r,rank'.split(','))
len(dunecat)
Out[24]:
In [31]:
plt.scatter(dunecat['ra'], dunecat['dec'], c=dunecat['rank'])
plt.colorbar()
None
In [41]:
stoutcat = mmthecto.generate_catalog(dune, dunecat, dunecat['rank'],
repeatflux=5, removefluxdistance=1*u.arcmin,
fnout='mmthecto/{0}_mar2015.cat'.format(dune.name),
fluxfnout='mmthecto/{0}_mar2015.fluxstars'.format(dune.name))
In [48]:
gilgcat = ascii.read('catalogs/mmt2015a2_nsa{0}.dat'.format(gilg.nsaid), format='basic', names='ra,dec,objID,r,fibermag_r,rank'.split(','))
len(gilgcat)
Out[48]:
In [49]:
plt.scatter(gilgcat['ra'], gilgcat['dec'], c=gilgcat['rank'])
plt.colorbar()
None
In [50]:
goutcat = mmthecto.generate_catalog(gilg, gilgcat, gilgcat['rank'],
repeatflux=1, removefluxdistance=1*u.arcmin,
fnout='mmthecto/{0}_mar2015.cat'.format(gilg.name),
fluxfnout='mmthecto/{0}_mar2015.fluxstars'.format(gilg.name))
In [ ]: