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', )


Using cached version of google hosts list from file "hosts_dl.pkl"

Gilgamesh


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)


onlygals was set, but no "type" in the catalog.  Not cutting.
Wrote catalog to imacs_targets/Gg15A.cat
Wrote obs file to imacs_targets/Gg15A_ini.obs

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


['imacs_targets/Gg15A_1.SMF', 'imacs_targets/Gg15A_2.SMF']
Total targets already observed= 0
Priority distribution of slitted targets:
Priority 1.0 : 0 targeted, 49 remaining
Priority 2.0 : 0 targeted, 33 remaining
Priority 3.0 : 0 targeted, 28 remaining
Priority 4.0 : 0 targeted, 110 remaining
Priority 5.0 : 0 targeted, 218 remaining
Priority 6.0 : 0 targeted, 397 remaining
Priority 7.0 : 0 targeted, 582 remaining
['imacs_targets/Gg15A_1.SMF', 'imacs_targets/Gg15A_2.SMF']
Total targets already observed= 0
Priority distribution of slitted targets:
Priority 1.0 : 0 targeted, 49 remaining
Priority 2.0 : 0 targeted, 33 remaining
Priority 3.0 : 0 targeted, 28 remaining
Priority 4.0 : 0 targeted, 110 remaining
Priority 5.0 : 0 targeted, 218 remaining
Priority 6.0 : 0 targeted, 397 remaining
Priority 7.0 : 0 targeted, 582 remaining

In [212]:
magellan.plot_imacs_masks(gilg, eastleft=True, plotpris=True)


['imacs_targets/Gg15A_1.SMF', 'imacs_targets/Gg15A_2.SMF']
Total targets already observed= 151
Priority distribution of slitted targets:
Priority 1.0 : 15 targeted, 34 remaining
Priority 2.0 : 5 targeted, 28 remaining
Priority 3.0 : 2 targeted, 26 remaining
Priority 4.0 : 13 targeted, 97 remaining
Priority 5.0 : 30 targeted, 188 remaining
Priority 6.0 : 51 targeted, 346 remaining
Priority 7.0 : 35 targeted, 547 remaining

Sopranos


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')


Could not find file "catalogs/Sopranos_sdss.dat" but did find "catalogs/NSA13927_sdss.dat" so using that.
onlygals was set, but no "type" in the catalog.  Not cutting.
Wrote catalog to imacs_targets/Sopr.cat
Wrote obs file to imacs_targets/Sopr_ini.obs

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))


Total targets already observed= 0
Priority distribution of slitted targets:
Priority 0.0 : 0 targeted, 1 remaining
Priority 1.0 : 0 targeted, 503 remaining
Priority 2.0 : 0 targeted, 413 remaining
Priority 3.0 : 0 targeted, 674 remaining
Priority 4.0 : 0 targeted, 628 remaining
Total targets already observed= 0
Priority distribution of slitted targets:
Priority 0.0 : 0 targeted, 1 remaining
Priority 1.0 : 0 targeted, 503 remaining
Priority 2.0 : 0 targeted, 413 remaining
Priority 3.0 : 0 targeted, 674 remaining
Priority 4.0 : 0 targeted, 628 remaining

In [105]:
magellan.plot_imacs_masks(sopranos, eastleft=True, plotpris=True, skipnums=[])


['imacs_targets/Sopr_1.SMF', 'imacs_targets/Sopr_2.SMF', 'imacs_targets/Sopr_3.SMF', 'imacs_targets/Sopr_4.SMF', 'imacs_targets/Sopr_5.SMF', 'imacs_targets/Sopr_6.SMF', 'imacs_targets/Sopr_7.SMF', 'imacs_targets/Sopr_8.SMF', 'imacs_targets/Sopr_9.SMF', 'imacs_targets/Sopr_10.SMF', 'imacs_targets/Sopr_11.SMF']
Total targets already observed= 1096
Priority distribution of slitted targets:
Priority 0.0 : 1 targeted, 0 remaining
Priority 1.0 : 334 targeted, 169 remaining
Priority 2.0 : 237 targeted, 176 remaining
Priority 3.0 : 322 targeted, 352 remaining
Priority 4.0 : 202 targeted, 426 remaining

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]:
'name ra dec\n0 180.64260018 2.02977635\n1 180.64790743 1.99117959\n2 180.64770423 1.9348228\n3 180.64569878 2.01797444\n4 180.71825192 1.98615968\n5 180.73210013 1.99821126\n6 180.64562776 2.00289535\n7 180.67864463 2.0340689\n8 180.64647442 2.01721076\n9 180.68567377 2.01510859\n10 180.68497441 2.02003017\n11 180.63805166 1.94826027\n12 180.66217333 2.01393421\n13 180.63671816 1.95178987\n14 180.65041007 2.014638\n15 180.65448455 1.89783565\n16 180.70133854 1.88348781\n17 180.63448844 1.9351029\n18 180.67234084 2.01302578\n19 180.67043212 1.9186137\n20 180.66152431 2.02085363\n21 180.68984887 1.93252758\n22 180.72007537 1.97341673\n23 180.75748373 2.03485164\n24 180.64271008 1.99826642\n25 180.5894359 1.97787152\n26 180.66009376 2.01255369\n27 180.70470469 2.00275972\n28 180.65567345 1.93623949\n29 180.64147967 2.00945139\n30 180.70942711 1.95363522\n31 180.69294807 2.00995569\n32 180.68715972 2.06360026\n33 180.72384436 1.9806876\n34 180.67628319 2.02085642\n35 180.63649431 1.95802948\n36 180.67201063 2.00968788\n37 180.66608652 1.92407259\n38 180.68229113 2.05172099\n39 180.6664965 2.01926045'

Dune


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]:
'Dune'

In [195]:
magellan.build_imacs_targeting_files(dune, 'Munoz', targs=dunecat, date='2015-3-25', inclhost=False)


onlygals was set, but no "type" in the catalog.  Not cutting.
Wrote catalog to imacs_targets/Dune.cat
Wrote obs file to imacs_targets/Dune_ini.obs

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'))


['imacs_targets/Dune_1.SMF']
Total targets already observed= 0
Priority distribution of slitted targets:
Priority 1.0 : 0 targeted, 202 remaining
Priority 2.0 : 0 targeted, 294 remaining
Priority 3.0 : 0 targeted, 444 remaining
Priority 4.0 : 0 targeted, 560 remaining
Priority 5.0 : 0 targeted, 234 remaining
['imacs_targets/Dune_1.SMF']
Total targets already observed= 0
Priority distribution of slitted targets:
Priority 1.0 : 0 targeted, 202 remaining
Priority 2.0 : 0 targeted, 294 remaining
Priority 3.0 : 0 targeted, 444 remaining
Priority 4.0 : 0 targeted, 560 remaining
Priority 5.0 : 0 targeted, 234 remaining
Out[213]:
<matplotlib.patches.Circle at 0x12fb20b50>

In [216]:
magellan.plot_imacs_masks(dune, eastleft=True, plotpris=True)


['imacs_targets/Dune_1.SMF', 'imacs_targets/Dune_2.SMF']
Total targets already observed= 160
Priority distribution of slitted targets:
Priority 1.0 : 34 targeted, 168 remaining
Priority 2.0 : 35 targeted, 259 remaining
Priority 3.0 : 48 targeted, 396 remaining
Priority 4.0 : 30 targeted, 530 remaining
Priority 5.0 : 13 targeted, 221 remaining

In [218]:
magellan.plot_imacs_masks(dune, eastleft=True, plotpris=[1,2])


['imacs_targets/Dune_1.SMF', 'imacs_targets/Dune_2.SMF']
Total targets already observed= 164
Priority distribution of slitted targets:
Priority 1.0 : 33 targeted, 169 remaining
Priority 2.0 : 33 targeted, 261 remaining
Priority 3.0 : 53 targeted, 391 remaining
Priority 4.0 : 33 targeted, 527 remaining
Priority 5.0 : 12 targeted, 222 remaining