In [34]:
# 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 [35]:
%matplotlib inline
from matplotlib import pyplot as plt
from matplotlib import rcParams
rcParams['figure.figsize'] = (16, 10)
rcParams['image.interpolation'] = 'none'
rcParams['image.origin'] = 'lower'
In [144]:
for module in ['hosts', 'targeting', 'magellan']:
if module in globals():
reload(globals()[module])
else:
globals()[module] = __import__(module)
#g = targeting.get_gama() #re-caches the gama catalog
In [122]:
hostlst = hosts.get_saga_hosts_from_google('etollerud', )
In [133]:
gilg = hosts.gilgamesh
gilg.shortname = 'Gg15A'
gilgcat = ascii.read('catalogs/imacs2015a_gilgamesh.dat', names='objID,ra,dec,r,imacs_pri'.split(','))
In [197]:
magellan.build_imacs_targeting_files(gilg, 'Munoz', targs=gilgcat, date='2015-3-25', inclhost=False)
In [211]:
magellan.plot_imacs_masks(gilg, eastleft=True, plotpris=True,showfootprint=True, skipnums=range(100))
plt.gca().add_artist(plt.Circle((gilg.coords.ra.deg, gilg.coords.dec.deg), .5,ec='g',fc='none'))
plt.figure()
magellan.plot_imacs_masks(gilg, eastleft=True, plotpris=[0,1],showfootprint=True, skipnums=range(100))
plt.gca().add_artist(plt.Circle((gilg.coords.ra.deg, gilg.coords.dec.deg), .5,ec='g',fc='none'))
None
In [212]:
magellan.plot_imacs_masks(gilg, eastleft=True, plotpris=True)
In [78]:
sopranos = hosts.NSAHost(13927 , 'Sopranos',shortname='Sopr')
sopranoscat = ascii.read('catalogs/imacs2015a_sopranos.dat', names='objID,ra,dec,r,imacs_pri'.split(','))
In [79]:
magellan.build_imacs_targeting_files(sopranos, 'Munoz', targs=sopranoscat, date='2015-3-17')
In [80]:
magellan.plot_imacs_masks(sopranos, eastleft=True, plotpris=True,showfootprint=True, skipnums=range(100))
plt.figure()
magellan.plot_imacs_masks(sopranos, eastleft=True, plotpris=[0,1],showfootprint=True, skipnums=range(100))
In [105]:
magellan.plot_imacs_masks(sopranos, eastleft=True, plotpris=True, skipnums=[])
In [146]:
import erikutils
from astropy import units as u
from astropy.coordinates import SkyCoord
In [153]:
sopp1msk = sopranoscat['imacs_pri']==1
sopp1sc = SkyCoord(sopranoscat['ra'][sopp1msk]*u.deg, sopranoscat['dec'][sopp1msk]*u.deg)
centermsk = sopp1sc.separation(sopranos.coords) < .1*u.deg
targeting.sampled_imagelist(sopp1sc[centermsk], None, None)
Out[153]:
In [126]:
dune = [host for host in hostlst if host.name=='Dune']
assert len(dune) == 1
dune = dune[0]
dunecat = ascii.read('catalogs/imacs2015a_dune.dat', names='objID,ra,dec,r,imacs_pri'.split(','))
dune.shortname
Out[126]:
In [195]:
magellan.build_imacs_targeting_files(dune, 'Munoz', targs=dunecat, date='2015-3-25', inclhost=False)
In [213]:
magellan.plot_imacs_masks(dune, eastleft=True, plotpris=True,showfootprint=True, skipnums=range(100))
plt.gca().add_artist(plt.Circle((dune.coords.ra.deg, dune.coords.dec.deg), .5,ec='g',fc='none'))
plt.figure()
magellan.plot_imacs_masks(dune, eastleft=True, plotpris=[0,1],showfootprint=True, skipnums=range(100))
plt.gca().add_artist(plt.Circle((dune.coords.ra.deg, dune.coords.dec.deg), .5,ec='g',fc='none'))
Out[213]:
In [216]:
magellan.plot_imacs_masks(dune, eastleft=True, plotpris=True)
In [218]:
magellan.plot_imacs_masks(dune, eastleft=True, plotpris=[1,2])