In [ ]:
# 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 [124]:
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 [48]:
hhecto = hosts.NSAHost(147100)
hnew = hosts.NSAHost(150238,'N7393')

In [22]:
hnew.sdss_environs_query(True)
hnew.usnob_environs_query(True)


File catalogs/NGC7393_sdss.dat exists - not downloading anything.
File catalogs/NGC7393_usnob.dat exists - not downloading anything.

In [82]:
hhecto.sdss_environs_query(True)
hhecto.usnob_environs_query(True)


File catalogs/NSA147100_sdss.dat exists - not downloading anything.
Downloading USNO-B to catalogs/NSA147100_usnob.dat
Unknown Size
1541 kB downloaded

In [26]:
magellan.build_imacs_targeting_files(hnew, 'Munoz', onlygals=True)


Wrote catalog to imacs_targets/NGC7393.cat
Wrote obs file to imacs_targets/NGC7393_ini.obs

In [43]:
hnew.physical_to_projected(300)


Out[43]:
19.273387598877768

In [44]:
(coords.Angle('22h51m37.8s') - coords.Angle(20/60,'degree')).hms


Out[44]:
(22.0, 50, 17.800000000006833)

In [49]:
magellan.plot_imacs_masks(hnew)



In [52]:
magellan.imagelist_imacs_targets('imacs_targets/N7393_4.SMF')


Out[52]:
'name ra dec\n1237680064809796276 342.619816667 -5.48311388889\n1237680064809861478 342.715679167 -5.54152222222\n1237680064809730834 342.513554167 -5.54718888889\n1237680064809927164 342.938975 -5.50375833333\n1237680064809730572 342.504475 -5.58321666667\n1237680064809861537 342.75655 -5.53515833333\n1237680064809796147 342.6838125 -5.46891944444\n1237680064809796056 342.63405 -5.55008333333\n1237680189904192147 342.522191667 -5.43700833333\n1237680064809795918 342.641333333 -5.52743333333\n1237680189904257325 342.624291667 -5.43586111111\n1237680064809861529 342.749670833 -5.57936111111\n1237680064809927325 342.919416667 -5.53484444444\n1237680064809796112 342.6643125 -5.48399444444\n1237680189904388657 342.925645833 -5.47198055556\n1237680189904322920 342.6943375 -5.45423888889\n1237680189904257296 342.568695833 -5.43251388889\n1237680064809927152 342.9303625 -5.49271666667\n1237680189904323157 342.8191125 -5.45199722222\n1237680064809730859 342.539204167 -5.56315555556\n1237680064809927086 342.8760375 -5.49933333333\n1237680189904388597 342.896258333 -5.47385555556\n1237680064809861471 342.711129167 -5.59136111111\n1237680064809795948 342.548858333 -5.58335555556\n1237680064809730600 342.527754167 -5.515125\n1237680064809861485 342.719766667 -5.52273055556\n1237680189904323071 342.783966667 -5.43284166667\n1237680189904257565 342.647091667 -5.43948611111\n1237680189904257045 342.5593 -5.44591666667\n1237680189904322817 342.703370833 -5.45234444444\n1237680189904323060 342.779641667 -5.46046666667\n1237680064809730263 342.486191667 -5.52624444444\n1237680064809927106 342.881716667 -5.51961944444\n1237680064809861542 342.761595833 -5.52445\n1237680064809861457 342.6998625 -5.55808333333\n1237680189904323117 342.801366667 -5.45504166667\n1237680189904323025 342.76695 -5.42696944444\n1237680064809730818 342.499275 -5.57141388889\n1237680064809927012 342.913358333 -5.52488333333\n1237680189904257446 342.584358333 -5.45460277778\n1237680064809796124 342.6706375 -5.47456111111\n1237680064809796133 342.6765375 -5.46921388889\n1237680064809795823 342.6086875 -5.57751388889\n1237680064809861566 342.775133333 -5.50558611111\n1237680064809796090 342.656679167 -5.48748055556\n1237680189904388530 342.8725125 -5.44403611111\n1237680064809927294 342.8868 -5.52583333333\n1237680189904257134 342.564475 -5.426925\n1237680064809795807 342.554191667 -5.58195555556\n1237680064809861229 342.739375 -5.56160833333\n1237680064809861407 342.788304167 -5.50593333333\n1237680064809861629 342.824745833 -5.50236388889\n1237680189904192128 342.508883333 -5.439325\n1237680064809861594 342.795145833 -5.55978055556\n1237680064809730613 342.5312625 -5.59304166667\n1237680064809796000 342.597008333 -5.50181666667\n1237680189904257428 342.573525 -5.42552777778\n1237680189904257224 342.542883333 -5.43833055556\n1237680064809796012 342.6032 -5.55676666667\n1237680064809730346 342.490191667 -5.47605\n1237680064809796041 342.628020833 -5.49765\n1237680189904388482 342.8471375 -5.45607222222'

In [83]:
magellan.build_imacs_targeting_files(hhecto, 'Munoz', onlygals=True)


Wrote catalog to imacs_targets/NSA147100.cat
Wrote obs file to imacs_targets/NSA147100_ini.obs

In [127]:
fncat = 'imacs_targets/{0}.cat'.format(hhecto.name)
fnhecto = 'mmthecto/try4_finish_NSA147100.cfg'
fnout = 'imacs_targets/{0}.filtered.cat'.format(hhecto.name)
remras, remdecs = magellan.reprocess_catalog_for_prev_mmt_obs(fncat, fnhecto, fnout, hectofields=[4,5,6,7,8,9,10], magrng=(21,-100),tolarcsec=1)
remras2, remdecs2 = magellan.reprocess_catalog_for_prev_mmt_obs(fnout, fnhecto, fnout, hectofields=[1,2,3], magrng=(20,-100),tolarcsec=1)


Removing 2700 of 4800 objects due to not being in the requested fields
Removed 844 from magellan catalog, leaving 2901 
writing new catalog to imacs_targets/NSA147100.filtered.cat
Removing 3900 of 4800 objects due to not being in the requested fields
Removed 129 from magellan catalog, leaving 2772 
writing new catalog to imacs_targets/NSA147100.filtered.cat

In [131]:
figure(figsize=(12,10))
magellan.plot_imacs_masks(hhecto)
scatter(remras,remdecs,lw=0,s=5,c='r')
scatter(remras2,remdecs2,lw=0,s=8,c='b')
title('removed from hecto')


Out[131]:
<matplotlib.text.Text at 0x10aba9a90>

In [ ]: