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 [29]:
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 [37]:
magellan.build_imacs_targeting_files(hosts.h6, 'Munoz')


Wrote catalog to imacs_targets/DLG6.cat
Wrote obs file to imacs_targets/DLG6_ini.obs

In [61]:
figure(figsize=(10,10))
magellan.plot_imacs_masks(hosts.h6,save=True)



In [69]:
hosts.h2.open_on_nsasite()

In [50]:
print magellan.imagelist_imacs_targets('imacs_targets/DLG6_1.SMF')


name ra dec
1237648702964957778 180.008670833 -1.15709722222
1237648702964957579 180.0232 -1.09286944444
1237654668674990352 180.029425 -1.12206111111
1237654668674990354 180.033720833 -1.13570277778
1237654668674990494 180.039154167 -1.05602222222
1237648720157016523 180.045070833 -1.04021111111
1237654668674990504 180.050891667 -1.17503611111
1237654668674990509 180.055054167 -1.06404444444
1237648720157016560 180.064504167 -1.03873888889
1237648672893567770 180.071083333 -1.05264444444
1237654668674990389 180.076670833 -1.16050833333
1237654668674990526 180.080895833 -1.15735833333
1237648720157016631 180.089116667 -1.04094166667
DLG6 180.098429167 -1.10007777778
1237654668675056047 180.131920833 -1.14871388889
1237654668675055870 180.142025 -1.12735277778
1237674648855052672 180.153929167 -1.11749444444
1237648720157082077 180.161108333 -1.03243888889
1237674648855052706 180.167266667 -1.10724722222
1237648720157082095 180.172804167 -1.02135833333
1237674648855052734 180.1789 -1.04958333333
1237648720157081614 180.184854167 -1.04278611111
1237674648855052442 180.1888 -1.17811666667
1237674648855052452 180.195616667 -1.10915277778
1237674648855052794 180.2002875 -1.09123888889
1237674648855052813 180.206829167 -1.15015555556
1237674648855052610 180.212041667 -1.07376944444
1237674648855052612 180.215704167 -1.16988333333
1237674648855052853 180.221420833 -1.06031944444
1237674648855052868 180.227733333 -1.09525
1237674648855052557 180.233454167 -1.07456666667
1237674648855052889 180.237366667 -1.15699444444
1237674648855052902 180.242395833 -1.08100277778
1237674648855052621 180.2465 -1.0728
1237648720157082261 180.251408333 -1.04096388889
1237674648855052924 180.257458333 -1.08620555556
1237648720157081857 180.2616625 -1.042525
1237674648855052631 180.265279167 -1.14289444444
1237648720157082309 180.271041667 -1.043875
1237674648855052963 180.275570833 -1.09426666667
1237674648855052981 180.283545833 -1.06908333333
1237674648855053001 180.289879167 -1.16551666667
1237648720157147435 180.298545833 -1.04683333333
1237674648855118222 180.302404167 -1.15668888889
1237674648855117836 180.311625 -1.08027222222
1237674648855118243 180.316495833 -1.11721666667
1237674648855118253 180.320258333 -1.14748888889
1237674648855118263 180.323958333 -1.177025
1237674648855118287 180.33035 -1.15573888889
1237674648855118311 180.337516667 -1.09141111111
1237674648855118318 180.342283333 -1.13851944444
1237674648855118333 180.346404167 -1.13720277778
1237674648855117859 180.350454167 -1.11497777778
1237674648855118350 180.356195833 -1.06696111111
1237648720157147307 180.363379167 -1.02751111111
1237674648855118374 180.369183333 -1.08146666667
1237674648855118379 180.37525 -1.14028611111
1237674648855118383 180.380325 -1.07924166667
1237674648855118398 180.386133333 -1.07882777778
1237674648855118406 180.3900875 -1.09513888889
1237648720157147784 180.419908333 -1.04346111111
1237674648855118454 180.424445833 -1.16418611111
1237674648855118463 180.4288 -1.08495833333
1237674648855118478 180.4336375 -1.14910555556
1237674648855118494 180.441066667 -1.07198888889
1237674648855183477 180.452579167 -1.13448888889
1237674648855183478 180.457329167 -1.13526944444
1237674648855183712 180.462404167 -1.16215555556

In [51]:
print magellan.imagelist_imacs_targets('imacs_targets/DLG6_2.SMF')


name ra dec
1237674648855052307 180.169720833 -1.21461666667
1237674648855052742 180.1817625 -1.23353333333
1237674648855052439 180.185808333 -1.20185
1237674648855052783 180.195345833 -1.19941388889
1237674648855052797 180.1992 -1.14775833333
1237674648855052809 180.204608333 -1.10900833333
1237674648855052832 180.212991667 -1.14629166667
1237674648855052850 180.220170833 -1.19830277778
1237650372092625668 180.223704167 -1.26360277778
1237650372092625687 180.230891667 -1.27388333333
1237674648855052887 180.236375 -1.20340833333
1237674648855052894 180.2399875 -1.17391388889
1237650372092690760 180.248720833 -1.27111666667
1237674648855053284 180.255925 -1.25444166667
1237674648855052628 180.260629167 -1.108325
1237674648855052940 180.265883333 -1.12653611111
1237674648855052950 180.270495833 -1.25364166667
1237674648855052960 180.274275 -1.23188055556
1237674648855052972 180.2785375 -1.18993333333
1237674648855052984 180.2834875 -1.20741388889
1237674648855118221 180.301908333 -1.20977222222
1237674648855118232 180.3109625 -1.15909444444
1237674648855118241 180.316629167 -1.18823333333
1237674648855118258 180.320970833 -1.19891388889
1237674648855118290 180.3316125 -1.14308055556
1237674648855118310 180.337208333 -1.15300555556
1237674648855118324 180.344458333 -1.18711388889
1237674648855118628 180.350070833 -1.25086666667
1237674648855118346 180.354520833 -1.17728888889
1237674648855118355 180.359020833 -1.24742777778
1237674648855118363 180.364266667 -1.258325
1237674648855118368 180.3685625 -1.12716388889
1237674648855118377 180.3746375 -1.10761388889
1237650372092691146 180.380204167 -1.26868333333
1237674648855118164 180.3838875 -1.17236388889
1237674648855118167 180.390270833 -1.2475
1237674648855118413 180.395216667 -1.12096388889
1237674648855118440 180.416904167 -1.18475
1237674648855118446 180.4209125 -1.16055
1237674648855118453 180.425829167 -1.16339444444
1237674648855118748 180.429933333 -1.16072222222
1237674648855118504 180.445679167 -1.15721666667
1237674648855183957 180.45045 -1.12366388889
1237674648855183713 180.462795833 -1.20399722222
1237674648855183741 180.4806375 -1.16750555556
1237674648855183749 180.48575 -1.19757222222
1237674648855184340 180.491929167 -1.17681388889
1237674648855183638 180.496066667 -1.20185555556
1237674648855183640 180.500633333 -1.20167222222
1237674648855184055 180.5064 -1.14367777778
1237674648855183784 180.510283333 -1.21671388889
1237674648855183794 180.518770833 -1.15106388889
1237674648855183820 180.535179167 -1.11460555556
1237674648855183530 180.541370833 -1.1486
1237674648855184394 180.5504875 -1.13878055556
1237674648855183660 180.555229167 -1.20318333333
1237674648855183852 180.560345833 -1.22928611111
1237674648855183870 180.5672125 -1.11281388889
1237674648855183671 180.5708 -1.160975
1237674648855183893 180.574975 -1.12989444444
1237674648855183902 180.581683333 -1.16886666667
1237674648855183923 180.592845833 -1.23874166667
1237650372092821944 180.600583333 -1.26395833333
1237674648855249242 180.604375 -1.144825
1237674648855248905 180.611333333 -1.17674722222
1237674648855249269 180.616045833 -1.14567222222
1237674648855249290 180.623004167 -1.15207222222

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


name ra dec
1237650762927505783 180.1363375 -1.61922222222
1237650762927505650 180.1201625 -1.61410555556
1237650762927440490 180.1059375 -1.60660277778
1237650762927505837 180.154483333 -1.60033333333
1237650762927440082 180.086829167 -1.59185555556
1237650762927440419 180.088441667 -1.58650555556
1237650762927505831 180.151704167 -1.58080277778
1237650762927440372 180.067816667 -1.57589444444
1237650762927505776 180.135358333 -1.56483055556
1237650762927440479 180.104066667 -1.55829444444
1237650762927506130 180.123366667 -1.55106111111
1237650762927440348 180.060629167 -1.53631111111
1237650762927440486 180.105820833 -1.53113611111
1237650762927440460 180.100770833 -1.52297777778
1237650762927505757 180.12745 -1.51855277778
1237650762927440343 180.058966667 -1.51355
1237650762927440008 180.063408333 -1.50708333333
1237650762927440743 180.058995833 -1.50263611111
1237650762927505732 180.122241667 -1.49461111111
1237650762927505828 180.1509625 -1.49078888889
1237650762927440331 180.0530625 -1.48649166667
1237650762927505823 180.148775 -1.48050555556
1237650762927440373 180.0687375 -1.47494166667
1237650762927505829 180.150816667 -1.47037222222
1237650762927505793 180.140495833 -1.46562222222
1237650762927505980 180.204629167 -1.46190277778
1237650762927440322 180.050054167 -1.45714166667
1237650762927505929 180.183620833 -1.44800833333
1237650762927505657 180.1524 -1.44376944444
1237650372092560152 180.093054167 -1.43898055556
1237650372092625214 180.1191375 -1.433775
1237650372092625449 180.144454167 -1.42822222222
1237650372092625229 180.143791667 -1.42130277778
1237650372092559578 180.078395833 -1.41698333333
1237650372092560033 180.057675 -1.40566666667
1237650372092625246 180.184641667 -1.40006111111
1237650372092560131 180.0893 -1.39425833333
1237650372092625326 180.103654167 -1.387525
1237650372092559685 180.085708333 -1.37915
1237650372092560075 180.070925 -1.37373888889
1237650372092625573 180.188054167 -1.36684722222
1237650372092625236 180.164304167 -1.35801111111
1237650372092625461 180.147604167 -1.35376944444
1237650372092625414 180.1314875 -1.34991666667
1237650372092625602 180.1994375 -1.34535555556
1237650372092625395 180.1264875 -1.34007777778
1237650372092559675 180.0711625 -1.33630555556
1237650372092559513 180.055829167 -1.33158611111
1237650372092560115 180.083454167 -1.325925
1237650372092559661 180.053808333 -1.31515
1237650372092560093 180.077808333 -1.30879722222
1237650372092560052 180.0656 -1.303325
1237650372092625252 180.2004875 -1.29953055556
1237650372092559648 180.0355375 -1.29022777778
1237650372092625544 180.176870833 -1.28582222222
1237650372092559536 180.067229167 -1.28025
1237650372092625473 180.1523875 -1.27566388889
1237650372092625493 180.160641667 -1.2718
1237650372092625604 180.200116667 -1.26767777778
1237650372092559979 180.0374625 -1.26296944444
1237650372092559659 180.0479125 -1.25863611111
1237650372092625232 180.149483333 -1.25123888889
1237650372092625380 180.119895833 -1.24483055556
1237650372092560320 180.095333333 -1.24095833333
1237674648855052741 180.18315 -1.23691666667
1237674648855052800 180.202145833 -1.23281111111
1237654668674990248 180.071025 -1.22769166667
1237654668674990249 180.079779167 -1.22375555556
1237674648855052431 180.1788375 -1.21940277778
1237674648855052725 180.177791667 -1.21442777778
1237674648855052602 180.177208333 -1.21023611111
1237654668675055849 180.10255 -1.20601666667
1237674648855052769 180.190670833 -1.20076666667
1237654668675055868 180.133429167 -1.19736944444
1237654668674990376 180.057895833 -1.18808333333
1237654668674990402 180.094475 -1.18031388889
1237654668674990393 180.08315 -1.17471388889
1237674648855052731 180.178383333 -1.16213888889

Below is investigating possible hosts


In [2]:
candidates = [hosts.h5, hosts.NSAHost(140594), hosts.NSAHost(13927)]
for c in candidates:
    c.usnob_environs_query(dl=True)
    c.sdss_environs_query(dl=True)


Using cached NSA for file nsa_v0_1_2.fits
Using cached NSA for file nsa_v0_1_2.fits
File catalogs/DLG5_usnob.dat exists - not downloading anything.
File catalogs/DLG5_sdss.dat exists - not downloading anything.
File catalogs/NSA140594_usnob.dat exists - not downloading anything.
File catalogs/NSA140594_sdss.dat exists - not downloading anything.
File catalogs/NSA13927_usnob.dat exists - not downloading anything.
File catalogs/NSA13927_sdss.dat exists - not downloading anything.

In [178]:
[c.open_on_nsasite() for c in candidates];

In [5]:
[len(targeting.select_targets(c)) for c in candidates]


Out[5]:
[3327, 5147, 3704]

In [6]:
[len(targeting.select_targets(c,removegalsathighz=False))-len(targeting.select_targets(c)) for c in candidates]


Out[6]:
[0, 232, 181]

In [7]:
[len(targeting.select_targets(c)) - sum(targeting.select_targets(c)['r']<19.8) for c in candidates]


Out[7]:
[2601, 4024, 2760]

In [177]:
for c in candidates:
    figure(figsize=(6,6))
    magellan.plot_targets_and_imacs_fov(c,'short')
    gca().set_aspect(1)
    title(c.name)


Using cached GAMA for file catalogs/GamaCoreDR1_v1.csv.gz
Host not in GAMA area - not looking at GAMA
Using cached GAMA for file catalogs/GamaCoreDR1_v1.csv.gz
Using cached GAMA for file catalogs/GamaCoreDR1_v1.csv.gz
Using cached GAMA for file catalogs/GamaCoreDR1_v1.csv.gz
Using cached GAMA for file catalogs/GamaCoreDR1_v1.csv.gz

In [188]:
print 'WITH STARS'
for c in candidates:
    t1 = targeting.select_targets(c,removegama=False)
    t2 = targeting.select_targets(c,removegama='all')
    t3 = targeting.select_targets(c,removegama='now')
    print h.name,'w/o gama',len(t1),'GAMA planned',len(t2),'Only current GAMA',len(t3)
print '\nW/O STARS'
for c in candidates:
    t1 = targeting.select_targets(c,removegama=False,galvsallcutoff=21)
    t2 = targeting.select_targets(c,removegama='all',galvsallcutoff=21)
    t3 = targeting.select_targets(c,removegama='now',galvsallcutoff=21)
    print h.name,'w/o gama',len(t1),'GAMA planned',len(t2),'Only current GAMA',len(t3)


WITH STARS
Host not in GAMA area - not looking at GAMA
Host not in GAMA area - not looking at GAMA
NSA140594 w/o gama 3327 GAMA planned 3327 Only current GAMA 3327
NSA140594 w/o gama 5147 GAMA planned 4045 Only current GAMA 4765
NSA140594 w/o gama 3704 GAMA planned 3217 Only current GAMA 3563

W/O STARS
Host not in GAMA area - not looking at GAMA
Host not in GAMA area - not looking at GAMA
NSA140594 w/o gama 2300 GAMA planned 2300 Only current GAMA 2300
NSA140594 w/o gama 3972 GAMA planned 2871 Only current GAMA 3590
NSA140594 w/o gama 2909 GAMA planned 2424 Only current GAMA 2768

In [190]:
#examine the targets
h = candidates[1]
t = targeting.select_targets(c,removegama='now')
targeting.sampled_imagelist(t['ra'],t['dec'],names=t['objID'])


Out[190]:
'name ra dec\n1237651753473671555 180.460241521 2.22764005733\n1237651752936669891 180.246451253 1.82030819115\n1237651736294195681 180.84776161 2.32530032178\n1237651752936866223 180.611116168 1.79708135006\n1237651752937062921 181.042111433 1.70617976647\n1237651753473736958 180.616064373 2.26815271196\n1237651753473736965 180.626661414 2.10159908735\n1237651752936800782 180.5375069 1.70908232921\n1237651752936997542 180.936464933 1.81561192021\n1237651736294130006 180.607771924 2.39320198924\n1237651735220257404 180.428149044 1.5559444341\n1237651735757193770 180.596319476 1.89699983828\n1237651753473737280 180.683635526 2.24539352842\n1237651752936931933 180.846732545 1.72444019591\n1237651735757390367 180.978753712 1.93297760806\n1237651735757062714 180.252557525 1.90267173408\n1237651753473933737 181.051022949 2.0899549215\n1237651735220453807 180.778543845 1.51641002735\n1237651735757324619 180.834055029 1.98466419838\n1237651753473671431 180.542800324 2.24564671236\n1237651752937062423 181.037300246 1.71835959407\n1237651753473671710 180.524273693 2.24999269887\n1237651752936735347 180.421388113 1.84481741251\n1237651735757259296 180.742945938 2.00662966898\n1237651753473540609 180.231337274 2.09183066716'

In [192]:
#see what gal-only targets look like
h = candidates[1]
t = targeting.select_targets(c,removegama='now',galvsallcutoff=21)
targeting.sampled_imagelist(t['ra'],t['dec'],names=t['objID']);

In [204]:
#check to make sure reference star-like things are good
cat=h.get_sdss_catalog()
refmsk = (17 < cat['psf_r']) & (cat['psf_r'] < 19)
for band in 'gri':
    refmsk = refmsk & (np.abs(cat[band] - cat['psf_' + band]) < 0.25)
sum(refmsk)
cr = cat[refmsk]
targeting.sampled_imagelist(cr['ra'],cr['dec'],names=cr['objID'])


Out[204]:
'name ra dec\n1237648720157016122 180.013595314 -0.931985470947\n1237648720156885201 179.728524445 -0.839974315456\n1237674648855118038 180.447110154 -1.18408810428\n1237674649391857750 180.112327535 -0.735641469574\n1237674649391661321 179.634657689 -0.782143660786\n1237650372092756072 180.501185155 -1.39129700605\n1237674649391661163 179.662877846 -0.803205969538\n1237674648855052491 180.259367541 -1.10332712532\n1237674649391726685 179.739978464 -0.740361984262\n1237674649391988921 180.407226087 -0.667053549279\n1237650372092428471 179.730930485 -1.36865453936\n1237648720157016092 180.011257815 -1.01214826663\n1237648720693821753 179.899407917 -0.612265013042\n1237648720156819691 179.678785279 -0.858841838549\n1237674648854855785 179.708299431 -1.2213954062\n1237650372092559472 179.99771848 -1.29220490161\n1237648720156950615 179.925566759 -1.00257773916\n1237650762927571094 180.381565632 -1.53110518652\n1237674648855052465 180.200056942 -1.08289345444\n1237650372092756083 180.510474113 -1.26298479728\n1237674648854855839 179.741860178 -1.2484632767\n1237650372092559424 180.091213656 -1.35878390129\n1237674649392054411 180.51315125 -0.759547401633\n1237650372092690613 180.336928036 -1.28647315985\n1237648720157016107 180.104335397 -1.04707854816'

Testing stuff below here


In [162]:
h = candidates[1]
raddeg = np.degrees(250 / (1000 * h.distmpc))
m,g,ds = targeting.find_gama(h.get_sdss_catalog(), h, raddeg,1/3600)


Using cached GAMA for file catalogs/GamaCoreDR1_v1.csv.gz

In [129]:
from scipy import spatial
g=targeting.get_gama()
kdt = spatial.cKDTree(np.array([g['RA_J2000'], g['DEC_J2000']]).T)


Using cached GAMA for file catalogs/GamaCoreDR1_v1.csv.gz

In [142]:
cat = candidates[1].get_sdss_catalog()
d,idx = kdt.query(np.array([cat['ra'], cat['dec']]).T)

In [151]:
tol = 1/3600
gi=g[idx[d<tol]]
i=110
gi[i],cat[d<tol][i],d[d<tol][i]*3600


Out[151]:
(<Row 110 of table
 values=('GAMAJ115944.66-003326.0', 560318, 588848899375759794, 179.936103420826, -0.557245681403581, 19.2575631588697, -2.0, 4, 5, 20090422, 2.78, 'G12_Y2_044_303', 'rd', 21.5305944717573, 19.9958279949774, 19.2940292838697, 18.9253131000699, 18.8007680168329, 18.6595501649027, 17.9621915096899, 18.4807029196126, 18.2367893831869, 0.457507734322071, 0.0167077613234361, 0.0127886759374746, 0.0139137780948756, 0.0422155468955937, 0.0216909742581582, 0.0413146839326975, 0.0249918665616394, 0.0236277924591799, 0.0842337161302567, 19.3280000007487)
 dtype=[('GAMA_IAU_ID', '|S23'), ('GAMA_ID', '<i8'), ('SDSS_ID', '<i8'), ('RA_J2000', '<f8'), ('DEC_J2000', '<f8'), ('r_PETRO', '<f8'), ('Z_HELIO', '<f8'), ('Z_QUALITY', '<i8'), ('Z_SOURCE', '<i8'), ('Z_DATE', '<i8'), ('Z_SN', '<f8'), ('Z_ID', '|S18'), ('PHOT_SOURCE', '|S2'), ('u_KRON', '<f8'), ('g_KRON', '<f8'), ('r_KRON', '<f8'), ('i_KRON', '<f8'), ('z_KRON', '<f8'), ('Y_KRON', '<f8'), ('J_KRON', '<f8'), ('H_KRON', '<f8'), ('K_KRON', '<f8'), ('u_KRON_ERR', '<f8'), ('g_KRON_ERR', '<f8'), ('r_KRON_ERR', '<f8'), ('i_KRON_ERR', '<f8'), ('z_KRON_ERR', '<f8'), ('Y_KRON_ERR', '<f8'), ('J_KRON_ERR', '<f8'), ('H_KRON_ERR', '<f8'), ('K_KRON_ERR', '<f8'), ('EXTINCTION_r', '<f8'), ('r_SERS_MAG_10RE', '<f8')]>,
 <Row 110 of table
 values=(1237648720693821948, 179.936102308866, -0.557238812942069, 3, 35287719870808, 0, 0.0, 21.29647, 20.06263, 19.30999, 18.8879, 18.71147, 0.1412383, 0.02534776, 0.02003229, 0.0195611, 0.05862344, 22.00736, 21.0657, 20.45693, 19.98348, 19.79586, 0.1578444, 0.1161404, 0.0842347, 0.06387262, 0.04528648, -1.0, -1.0, -1, 'null', 'null')
 dtype=[('objID', '<i8'), ('ra', '<f8'), ('dec', '<f8'), ('type', '<i8'), ('flags', '<i8'), ('specObjID', '<i8'), ('fracDeV_r', '<f8'), ('u', '<f8'), ('g', '<f8'), ('r', '<f8'), ('i', '<f8'), ('z', '<f8'), ('u_err', '<f8'), ('g_err', '<f8'), ('r_err', '<f8'), ('i_err', '<f8'), ('z_err', '<f8'), ('psf_u', '<f8'), ('psf_g', '<f8'), ('psf_r', '<f8'), ('psf_i', '<f8'), ('psf_z', '<f8'), ('Au', '<f8'), ('Ag', '<f8'), ('Ar', '<f8'), ('Ai', '<f8'), ('Az', '<f8'), ('spec_z', '<f8'), ('spec_z_err', '<f8'), ('spec_z_warn', '<i8'), ('spec_class', '|S6'), ('spec_subclass', '|S19')]>,
 0.025048400198842847)

In [154]:
m,gm, dm = targeting.find_gama(cat,h,.5,1/3600)
i=110
gm[i],cat[m][i],dm[i]*3600


Using cached GAMA for file catalogs/GamaCoreDR1_v1.csv.gz
Out[154]:
(<Row 110 of table
 values=('GAMAJ115843.47-012859.3', 185271, 587725041702404188, 179.681163509156, -1.48316579668053, 18.5853471159935, 0.14588, 4, 5, 20080309, 10.86, 'G12_Y1_ES2_145', 'rd', 20.0274637324634, 19.1614685298555, 18.5391412532005, 18.2041683194944, 18.0329336858764, 18.0299441114082, 17.6213238317838, 17.7063455531721, 17.7481867831693, 0.221004100790038, 0.00999346481610316, 0.00799468914726346, 0.00869786399224525, 0.0244921208026225, 0.0143298408657862, 0.0339408832230199, 0.0142695562042236, 0.017191986485966, 0.071749746799469, 18.6515770796944)
 dtype=[('GAMA_IAU_ID', '|S23'), ('GAMA_ID', '<i8'), ('SDSS_ID', '<i8'), ('RA_J2000', '<f8'), ('DEC_J2000', '<f8'), ('r_PETRO', '<f8'), ('Z_HELIO', '<f8'), ('Z_QUALITY', '<i8'), ('Z_SOURCE', '<i8'), ('Z_DATE', '<i8'), ('Z_SN', '<f8'), ('Z_ID', '|S18'), ('PHOT_SOURCE', '|S2'), ('u_KRON', '<f8'), ('g_KRON', '<f8'), ('r_KRON', '<f8'), ('i_KRON', '<f8'), ('z_KRON', '<f8'), ('Y_KRON', '<f8'), ('J_KRON', '<f8'), ('H_KRON', '<f8'), ('K_KRON', '<f8'), ('u_KRON_ERR', '<f8'), ('g_KRON_ERR', '<f8'), ('r_KRON_ERR', '<f8'), ('i_KRON_ERR', '<f8'), ('z_KRON_ERR', '<f8'), ('Y_KRON_ERR', '<f8'), ('J_KRON_ERR', '<f8'), ('H_KRON_ERR', '<f8'), ('K_KRON_ERR', '<f8'), ('EXTINCTION_r', '<f8'), ('r_SERS_MAG_10RE', '<f8')]>,
 <Row 110 of table
 values=(1237650762927308882, 179.681172706328, -1.48316274262596, 3, 68988043264, 0, 0.7160127, 20.07079, 19.0859, 18.51041, 18.1385, 17.96761, 0.06757192, 0.01385386, 0.01225202, 0.01359444, 0.03992071, 20.59299, 19.64997, 19.09813, 18.69563, 18.56722, 0.1344522, 0.09892868, 0.07175133, 0.05440686, 0.03857514, -1.0, -1.0, -1, 'null', 'null')
 dtype=[('objID', '<i8'), ('ra', '<f8'), ('dec', '<f8'), ('type', '<i8'), ('flags', '<i8'), ('specObjID', '<i8'), ('fracDeV_r', '<f8'), ('u', '<f8'), ('g', '<f8'), ('r', '<f8'), ('i', '<f8'), ('z', '<f8'), ('u_err', '<f8'), ('g_err', '<f8'), ('r_err', '<f8'), ('i_err', '<f8'), ('z_err', '<f8'), ('psf_u', '<f8'), ('psf_g', '<f8'), ('psf_r', '<f8'), ('psf_i', '<f8'), ('psf_z', '<f8'), ('Au', '<f8'), ('Ag', '<f8'), ('Ar', '<f8'), ('Ai', '<f8'), ('Az', '<f8'), ('spec_z', '<f8'), ('spec_z_err', '<f8'), ('spec_z_warn', '<i8'), ('spec_class', '|S6'), ('spec_subclass', '|S19')]>,
 0.034887551932978815)

In [159]:
targeting.sampled_imagelist(gm['RA_J2000'],gm['DEC_J2000'],names=gm['GAMA_IAU_ID'])


Out[159]:
'name ra dec\nGAMAJ115841.81-004726.3 179.674217654 -0.790652666887\nGAMAJ115906.90-004504.0 179.778762155 -0.751136421904\nGAMAJ120052.16-004636.0 180.217372949 -0.776673982026\nGAMAJ115843.93-005747.1 179.683048019 -0.963095700293\nGAMAJ120040.52-005218.5 180.168834642 -0.871818965756\nGAMAJ120126.44-012631.4 180.360184302 -1.44207737341\nGAMAJ115857.93-003941.7 179.741375175 -0.661588633898\nGAMAJ120019.98-004058.9 180.083282923 -0.683034974592\nGAMAJ120007.49-005105.5 180.031216769 -0.851545924385\nGAMAJ120108.04-010408.8 180.283511209 -1.06911617162\nGAMAJ115900.79-004237.6 179.75332439 -0.710466843599\nGAMAJ120128.22-005330.1 180.367596092 -0.891720949938\nGAMAJ120007.22-011628.1 180.030083875 -1.27448586336\nGAMAJ115905.75-005028.7 179.773998477 -0.8413130969\nGAMAJ115922.32-011533.1 179.843025588 -1.25920579069\nGAMAJ115841.95-011800.2 179.674794575 -1.30007639695\nGAMAJ120036.23-012926.8 180.150963224 -1.49079577552\nGAMAJ120107.06-011130.3 180.279445055 -1.19176606795\nGAMAJ115934.82-005328.3 179.895107795 -0.891216631559\nGAMAJ120033.72-012756.2 180.140500861 -1.46563110306\nGAMAJ120042.76-010740.9 180.178196666 -1.12804193306\nGAMAJ115836.58-010005.8 179.652444587 -1.00162448468\nGAMAJ115929.29-005230.5 179.872065759 -0.875157108232\nGAMAJ120125.18-012426.7 180.354922714 -1.40741969764\nGAMAJ115825.85-005152.0 179.607709904 -0.864452672133'

Matching reduced spectra to catalogs


In [30]:
rvdct = magellan.load_ricardo_rvs_and_match()
rvdct.keys()


Out[30]:
['fns', 'nms', 'rvs', 'ras', 'specclass', 'rverrs', 'decs']

In [31]:
#rvs are relative to host - so smallest absolute ones are of interest
sorti = np.argsort(np.abs(rvdct['rvs']))

In [32]:
lns = ['name ra dec']
for dv, ra, dec in zip(rvdct['rvs'][sorti], rvdct['ras'][sorti], rvdct['decs'][sorti]):
    lns.append(' '.join(('dv=' + str(dv),str(ra),str(dec))))
print '\n'.join(lns)
#paste into http://skyserver.sdss3.org/dr9/en/tools/chart/list.asp


name ra dec
dv=0.0 180.098429167 -1.10007777778
dv=229.5723 180.3685625 -1.12716388889
dv=-684.812 180.48575 -1.19757222222
dv=-1075.081 180.029425 -1.12206111111
dv=-1260.977 180.185808333 -1.20185
dv=-1533.833 180.260629167 -1.108325
dv=1670.5796 180.0232 -1.09286944444
dv=2395.8103 180.283545833 -1.06908333333
dv=3055.8918 180.342283333 -1.13851944444
dv=-3491.013 180.076670833 -1.16050833333
dv=-3784.275 180.185808333 -1.20185
dv=-3828.565 180.441066667 -1.07198888889
dv=3899.5591 180.131920833 -1.14871388889
dv=4391.3008 180.227733333 -1.09525
dv=5442.0156 180.323958333 -1.177025
dv=5855.5337 180.195345833 -1.19941388889
dv=6233.3374 180.1888 -1.17811666667
dv=6249.8301 180.080895833 -1.15735833333
dv=6489.9849 180.518770833 -1.15106388889
dv=6782.9414 180.2465 -1.0728
dv=-7802.866 180.581683333 -1.16886666667
dv=8395.9199 180.255925 -1.25444166667
dv=8717.0498 180.2002875 -1.09123888889
dv=9181.8125 180.45045 -1.12366388889
dv=-9313.495 180.5708 -1.160975
dv=10510.357 180.3838875 -1.17236388889
dv=10951.205 180.008670833 -1.15709722222
dv=11033.551 180.337516667 -1.09141111111
dv=11215.186 180.5672125 -1.11281388889
dv=11702.856 180.206829167 -1.15015555556
dv=11814.221 180.4336375 -1.14910555556
dv=11943.614 180.153929167 -1.11749444444
dv=12672.79 180.369183333 -1.08146666667
dv=12914.077 180.172804167 -1.02135833333
dv=-13475.44 180.416904167 -1.18475
dv=14538.394 180.425829167 -1.16339444444
dv=14568.889 180.316629167 -1.18823333333
dv=14983.569 180.212041667 -1.07376944444
dv=15401.564 180.424445833 -1.16418611111
dv=15863.047 180.3316125 -1.14308055556
dv=15912.492 180.301908333 -1.20977222222
dv=16049.195 180.167266667 -1.10724722222
dv=16987.637 180.223704167 -1.26360277778
dv=-17439.4 180.592845833 -1.23874166667
dv=-17529.49 180.535179167 -1.11460555556
dv=18997.08 180.419908333 -1.04346111111
dv=-19108.05 180.4806375 -1.16750555556
dv=19204.139 180.386133333 -1.07882777778
dv=19213.861 180.452579167 -1.13448888889
dv=19350.494 180.311625 -1.08027222222
dv=19679.592 180.4288 -1.08495833333
dv=-19970.81 180.204608333 -1.10900833333
dv=20384.625 180.560345833 -1.22928611111
dv=21249.059 180.071083333 -1.05264444444
dv=21258.248 180.363379167 -1.02751111111
dv=21947.902 180.555229167 -1.20318333333
dv=22053.914 180.055054167 -1.06404444444
dv=22428.309 180.301908333 -1.20977222222
dv=22721.928 180.169720833 -1.21461666667
dv=23549.615 180.555229167 -1.20318333333
dv=-24630.2 180.1817625 -1.23353333333
dv=24740.271 180.142025 -1.12735277778
dv=24802.721 180.236375 -1.20340833333
dv=24825.029 180.354520833 -1.17728888889
dv=26110.932 180.616045833 -1.14567222222
dv=26706.695 180.248720833 -1.27111666667
dv=26988.146 180.4209125 -1.16055
dv=27246.641 180.212991667 -1.14629166667
dv=27429.127 180.316495833 -1.11721666667
dv=28455.174 180.390270833 -1.2475
dv=28876.379 180.350070833 -1.25086666667
dv=29051.889 180.3109625 -1.15909444444
dv=29120.496 180.220170833 -1.19830277778
dv=29135.275 180.320970833 -1.19891388889
dv=29372.957 180.359020833 -1.24742777778
dv=29604.061 180.419908333 -1.04346111111
dv=30685.406 180.541370833 -1.1486
dv=30934.629 180.045070833 -1.04021111111
dv=31181.705 180.089116667 -1.04094166667
dv=31946.506 180.230891667 -1.27388333333
dv=32777.691 180.346404167 -1.13720277778
dv=32953.918 180.457329167 -1.13526944444
dv=33026.34 180.257458333 -1.08620555556
dv=33503.613 180.265883333 -1.12653611111
dv=33911.762 180.380204167 -1.26868333333
dv=34103.133 180.195616667 -1.10915277778
dv=35355.461 180.3746375 -1.10761388889
dv=-35932.12 180.462404167 -1.16215555556
dv=37380.973 180.221420833 -1.06031944444
dv=37504.867 180.611333333 -1.17674722222
dv=39069.898 180.270495833 -1.25364166667
dv=39524.852 180.033720833 -1.13570277778
dv=39537.523 180.600583333 -1.26395833333
dv=40237.082 180.039154167 -1.05602222222
dv=40434.531 180.5504875 -1.13878055556
dv=40457.047 180.37525 -1.14028611111
dv=40579.48 180.215704167 -1.16988333333
dv=42632.094 180.3900875 -1.09513888889
dv=43356.094 180.242395833 -1.08100277778
dv=43568.633 180.320258333 -1.14748888889
dv=44393.672 180.1992 -1.14775833333
dv=46977.691 180.289879167 -1.16551666667
dv=47469.316 180.302404167 -1.15668888889
dv=47481.34 180.364266667 -1.258325
dv=47500.34 180.3109625 -1.15909444444
dv=49210.32 180.1789 -1.04958333333
dv=49264.547 180.064504167 -1.03873888889
dv=49902.727 180.611333333 -1.17674722222
dv=50541.949 180.491929167 -1.17681388889
dv=51685.781 180.380325 -1.07924166667
dv=51690.074 180.251408333 -1.04096388889
dv=52470.289 180.184854167 -1.04278611111
dv=52736.605 180.445679167 -1.15721666667
dv=53421.727 180.429933333 -1.16072222222
dv=54733.004 180.2399875 -1.17391388889
dv=56535.129 180.604375 -1.144825
dv=58782.625 180.2616625 -1.042525
dv=59049.941 180.298545833 -1.04683333333
dv=60066.184 180.2834875 -1.20741388889
dv=68636.172 180.623004167 -1.15207222222
dv=74125.891 180.496066667 -1.20185555556
dv=77156.625 180.161108333 -1.03243888889
dv=81462.023 180.592845833 -1.23874166667
dv=86164.133 180.344458333 -1.18711388889
dv=89044.375 180.275570833 -1.09426666667
dv=90714.25 180.337208333 -1.15300555556
dv=-105328.8 180.265279167 -1.14289444444
dv=107993.7 180.574975 -1.12989444444
dv=109685.42 180.050891667 -1.17503611111
dv=116044.0 180.5064 -1.14367777778
dv=116259.07 180.33035 -1.15573888889
dv=117019.22 180.500633333 -1.20167222222
dv=126500.5 180.462795833 -1.20399722222
dv=156231.27 180.271041667 -1.043875

In [33]:
print rvdct['fns'][sorti]


['DLG6_1_16_1spec.0001.fits' 'DLG6_2_37_1spec.0001.fits'
 'DLG6_2_54_1spec.0001.fits' 'DLG6_1_05_1spec.0001.fits'
 'DLG6_2_04_1spec.0001.fits' 'DLG6_2_17_1spec.0001.fits'
 'DLG6_1_04_1spec.0001.fits' 'DLG6_1_48_1spec.0001.fits'
 'DLG6_1_60_1spec.0001.fits' 'DLG6_1_13_1spec.0001.fits'
 'DLG6_2_04_1spec.0002.fits' 'DLG6_1_75_1spec.0001.fits'
 'DLG6_1_20_1spec.0001.fits' 'DLG6_1_36_1spec.0001.fits'
 'DLG6_1_57_1spec.0001.fits' 'DLG6_2_06_1spec.0001.fits'
 'DLG6_1_29_1spec.0001.fits' 'DLG6_1_14_1spec.0001.fits'
 'DLG6_2_61_1spec.0001.fits' 'DLG6_1_40_1spec.0001.fits'
 'DLG6_2_71_1spec.0001.fits' 'DLG6_2_16_1spec.0001.fits'
 'DLG6_1_31_1spec.0001.fits' 'DLG6_2_50_1spec.0001.fits'
 'DLG6_2_69_1spec.0001.fits' 'DLG6_2_40_1spec.0001.fits'
 'DLG6_1_02_1spec.0001.fits' 'DLG6_1_59_1spec.0001.fits'
 'DLG6_2_68_1spec.0001.fits' 'DLG6_1_32_1spec.0001.fits'
 'DLG6_1_74_1spec.0001.fits' 'DLG6_1_23_1spec.0001.fits'
 'DLG6_1_65_1spec.0001.fits' 'DLG6_1_26_1spec.0001.fits'
 'DLG6_2_44_1spec.0001.fits' 'DLG6_2_46_1spec.0001.fits'
 'DLG6_2_27_1spec.0001.fits' 'DLG6_1_33_1spec.0001.fits'
 'DLG6_1_72_1spec.0001.fits' 'DLG6_2_30_1spec.0001.fits'
 'DLG6_2_25_1spec.0001.fits' 'DLG6_1_25_1spec.0001.fits'
 'DLG6_2_11_1spec.0001.fits' 'DLG6_2_72_1spec.0001.fits'
 'DLG6_2_62_1spec.0001.fits' 'DLG6_1_71_1spec.0002.fits'
 'DLG6_2_53_1spec.0001.fits' 'DLG6_1_68_1spec.0001.fits'
 'DLG6_1_78_1spec.0001.fits' 'DLG6_1_54_1spec.0001.fits'
 'DLG6_1_73_1spec.0001.fits' 'DLG6_2_08_1spec.0001.fits'
 'DLG6_2_67_1spec.0001.fits' 'DLG6_1_12_1spec.0001.fits'
 'DLG6_1_64_1spec.0001.fits' 'DLG6_2_66_1spec.0001.fits'
 'DLG6_1_10_1spec.0001.fits' 'DLG6_2_25_1spec.0002.fits'
 'DLG6_2_01_1spec.0001.fits' 'DLG6_2_66_1spec.0002.fits'
 'DLG6_2_03_1spec.0001.fits' 'DLG6_1_21_1spec.0001.fits'
 'DLG6_2_13_1spec.0001.fits' 'DLG6_2_34_1spec.0001.fits'
 'DLG6_2_77_1spec.0001.fits' 'DLG6_2_15_1spec.0001.fits'
 'DLG6_2_45_1spec.0001.fits' 'DLG6_2_09_1spec.0001.fits'
 'DLG6_1_55_1spec.0001.fits' 'DLG6_2_41_1spec.0001.fits'
 'DLG6_2_33_1spec.0001.fits' 'DLG6_2_26_1spec.0002.fits'
 'DLG6_2_10_1spec.0001.fits' 'DLG6_2_28_1spec.0001.fits'
 'DLG6_2_35_1spec.0001.fits' 'DLG6_1_71_1spec.0001.fits'
 'DLG6_2_63_1spec.0001.fits' 'DLG6_1_08_1spec.0001.fits'
 'DLG6_1_15_1spec.0001.fits' 'DLG6_2_12_1spec.0001.fits'
 'DLG6_1_61_1spec.0001.fits' 'DLG6_1_79_1spec.0001.fits'
 'DLG6_1_42_1spec.0001.fits' 'DLG6_2_18_1spec.0001.fits'
 'DLG6_2_39_1spec.0001.fits' 'DLG6_1_30_1spec.0001.fits'
 'DLG6_2_38_1spec.0001.fits' 'DLG6_1_80_1spec.0001.fits'
 'DLG6_1_35_1spec.0001.fits' 'DLG6_2_76_1spec.0001.fits'
 'DLG6_2_19_1spec.0001.fits' 'DLG6_1_06_1spec.0001.fits'
 'DLG6_2_74_1spec.0001.fits' 'DLG6_1_07_1spec.0001.fits'
 'DLG6_2_65_1spec.0001.fits' 'DLG6_1_66_1spec.0001.fits'
 'DLG6_1_34_1spec.0001.fits' 'DLG6_1_69_1spec.0001.fits'
 'DLG6_1_39_1spec.0001.fits' 'DLG6_1_56_1spec.0001.fits'
 'DLG6_2_07_1spec.0001.fits' 'DLG6_1_49_1spec.0001.fits'
 'DLG6_1_53_1spec.0001.fits' 'DLG6_2_36_1spec.0001.fits'
 'DLG6_2_26_1spec.0001.fits' 'DLG6_1_27_1spec.0001.fits'
 'DLG6_1_11_1spec.0001.fits' 'DLG6_2_76_1spec.0002.fits'
 'DLG6_2_55_1spec.0001.fits' 'DLG6_1_67_1spec.0001.fits'
 'DLG6_1_41_1spec.0001.fits' 'DLG6_1_28_1spec.0001.fits'
 'DLG6_2_49_1spec.0001.fits' 'DLG6_2_47_1spec.0001.fits'
 'DLG6_2_14_1spec.0001.fits' 'DLG6_2_75_1spec.0001.fits'
 'DLG6_1_43_1spec.0001.fits' 'DLG6_1_52_1spec.0001.fits'
 'DLG6_2_22_1spec.0001.fits' 'DLG6_2_79_1spec.0001.fits'
 'DLG6_2_56_1spec.0001.fits' 'DLG6_1_24_1spec.0001.fits'
 'DLG6_2_72_1spec.0002.fits' 'DLG6_2_32_1spec.0001.fits'
 'DLG6_1_46_1spec.0001.fits' 'DLG6_2_31_1spec.0001.fits'
 'DLG6_1_44_1spec.0001.fits' 'DLG6_2_70_1spec.0001.fits'
 'DLG6_1_09_1spec.0001.fits' 'DLG6_2_58_1spec.0001.fits'
 'DLG6_1_58_1spec.0001.fits' 'DLG6_2_57_1spec.0001.fits'
 'DLG6_2_51_1spec.0001.fits' 'DLG6_1_45_1spec.0001.fits']

In [ ]: