In [31]:
%matplotlib inline
import matplotlib
matplotlib.rcParams['figure.figsize'] = (10,8)
import pylab as plt
import numpy as np
from astropy.table import Table
In [32]:
# Retrieve from  http://portal.nersc.gov/project/cosmo/temp/dstn/sdss-gaia-synflux-gals.fits
S = Table.read('sdss-gaia-synflux-gals.fits')
In [20]:
for k,v in S.columns.items():
    setattr(S, k, v)
In [26]:
I = np.flatnonzero((S.synflux_g > 0.) * np.isfinite(S.phot_bp_mean_flux) * np.isfinite(S.phot_rp_mean_flux)
                  * (S.synflux_bp > 0) * (S.synflux_rp > 0)
                  * (S.gal)
                  * (S.wavemax>9000)
                  * (S.wavemin<3900))
print(len(I), 'objects')
plt.loglog(S.synflux_bp[I], S.phot_bp_mean_flux[I], 'b.')
plt.loglog(S.synflux_rp[I], S.phot_rp_mean_flux[I], 'r.')
plt.loglog(S.synflux_g[I], S.phot_g_mean_flux[I], 'g.')

lo,hi = 1e1, 1e4
plt.plot([lo,hi],[lo,hi], 'k-')
plt.axis([lo,hi,lo,hi])

plt.xlabel('Synthetic flux from SDSS Spectroscopy')
plt.ylabel('Gaia measured flux (BP/RP/G flux)');
plt.title('SDSS galaxies x Gaia filter curves');
261661 objects
In [27]:
np.seterr(divide='ignore', invalid='ignore')
xx = S.phot_bp_mean_flux / S.synflux_bp
yy = S.phot_rp_mean_flux / S.synflux_rp
plt.loglog(xx[I], yy[I], 'k.', alpha=0.5)

# Absolutely bluest
#J = np.argsort(-xx[I])
# Relatively bluest
J = np.argsort(-xx[I] / yy[I])
# Relatively reddest
#J = np.argsort(-yy[I] / xx[I])
J = I[J]
plt.plot(xx[J[:50]], yy[J[:50]], 'o', mec='r', mfc='none')

lo,hi = 1e-1, 1e2
plt.plot([lo,hi],[lo,hi], 'k-')
plt.axis([lo,hi,lo,hi])

plt.xlabel('BP measured/predicted')
plt.ylabel('RP measured/predicted');
In [30]:
from IPython.core.display import HTML
html = '<table>'
for ii,j in enumerate(J[:200]):
    if S.dec[j] > 30.:
        blink='mzls+bass-dr6'
    else:
        blink='decals-dr5'
    blink = blink.replace('+', '%2B')
    html += '<tr><td>'
    html += '<a href="http://legacysurvey.org/viewer-dev/?layer=sdss2&ra=%.4f&dec=%.4f&zoom=16">' % (S.ra[j], S.dec[j])
    html += '<img src="http://legacysurvey.org/viewer-dev/jpeg-cutout/?layer=sdss2&ra=%.4f&dec=%.4f&pixscale=0.262&size=100" width="100" height="100">' % (S.ra[j], S.dec[j])
    html += '</a></td><td>'
    html += '<img src="http://legacysurvey.org/viewer-dev/jpeg-cutout/?layer=%s&ra=%.4f&dec=%.4f&pixscale=0.262&size=100" width="100" height="100">' % (blink, S.ra[j], S.dec[j])
    html += '</td><td>#%i: %s</td></tr>' % (ii,S.source_id[j])
html += '</table>'
HTML(html)
Out[30]:
#0: 851779838288128896
#1: 3695394637484693504
#2: 2500319132672196096
#3: 1877393942397959936
#4: 3889076329430243328
#5: 3889076329430243328
#6: 2651165805811367552
#7: 688547475900184832
#8: 3999647238808642944
#9: 1485584485667856256
#10: 664441817332387712
#11: 581421611329659904
#12: 3835817184475584256
#13: 1402503123624821632
#14: 3269827768598404096
#15: 1896800253909843584
#16: 628608149267523328
#17: 1016103813859997312
#18: 2541429975514380416
#19: 2873776396009949824
#20: 3918861171713923840
#21: 3725476347907527424
#22: 3958154414459829632
#23: 3426230377075425152
#24: 4559137196640591616
#25: 4019159374017683200
#26: 1321925375328955008
#27: 681967551643827328
#28: 1324890792548374784
#29: 1500214897286656
#30: 1484444910584168064
#31: 1680672105094520832
#32: 609599620450728704
#33: 611078188710867328
#34: 1246729367083348096
#35: 1334293339249262336
#36: 2732129817696366080
#37: 1592520959360107392
#38: 2732129817696366080
#39: 3921996527905980416
#40: 1306421372319489280
#41: 2686909412708191488
#42: 2854028170744515200
#43: 3095928975190495360
#44: 3739106443799119744
#45: 905549736458486016
#46: 3994486680983053696
#47: 867567313435266176
#48: 2462473358328750592
#49: 1333454205718943488
#50: 3264269256283421312
#51: 3741078898939872640
#52: 2686909412708191488
#53: 2686909412708191488
#54: 1579506143303267200
#55: 922487163328680448
#56: 3671738339868164480
#57: 1446785022425650560
#58: 679490626825172224
#59: 900802285767084800
#60: 2644049384304301568
#61: 1157698710833023232
#62: 3978253246498636544
#63: 1313262739826733056
#64: 3920039813817907200
#65: 1446785022425650560
#66: 1473252981729566080
#67: 2587108979931328640
#68: 682247553446782464
#69: 877819469090230912
#70: 799226240497446912
#71: 3937843037375762560
#72: 2465203097807435904
#73: 678609230814900096
#74: 1325960037542790016
#75: 3985361073774690176
#76: 2854028170744515200
#77: 2771430245924494336
#78: 4464398979824359680
#79: 4564020608816741632
#80: 582816444909380352
#81: 3649015935647518464
#82: 1213118288759334400
#83: 4574274585537101824
#84: 4413416515433137024
#85: 900927183416789504
#86: 1578120140175365376
#87: 667926861172315136
#88: 4419647894501170816
#89: 2449397858678540800
#90: 926802613324379264
#91: 2543888032541650816
#92: 1486419156726708096
#93: 860204811776652928
#94: 1556023323716903040
#95: 2747373451198780288
#96: 3924358725556683648
#97: 4562367630522439168
#98: 4031115085501092352
#99: 4447157125671864320
#100: 3989951981497589120
#101: 4025923157234896640
#102: 3806412468273195648
#103: 3715847928875989376
#104: 905370520358490112
#105: 1664887619245043328
#106: 799791874807345280
#107: 1992570534191531136
#108: 2699683435722000256
#109: 1315536525577382272
#110: 893673945727697792
#111: 748214742124220544
#112: 1174103286879806592
#113: 1310748805272018432
#114: 1175997337391775872
#115: 844797595855848960
#116: 294518276993187200
#117: 3960785408346408448
#118: 3921409113816324480
#119: 1030499066767502592
#120: 582342314878622976
#121: 3892542574196406016
#122: 1244036109057446912
#123: 3096211755838020096
#124: 6880534206586440960
#125: 3981267076588702208
#126: 4455925490388789504
#127: 916351751006278272
#128: 1218971268328848896
#129: 3653882064875024256
#130: 4600264772678956160
#131: 745745823124094464
#132: 747235558300349056
#133: 1261411141554757632
#134: 799226240497446912
#135: 2644049384304301568
#136: 2519389371582016512
#137: 671701622029187456
#138: 2507507013844500992
#139: 703297733624499840
#140: 2694049366338995328
#141: 2825308308552664320
#142: 1162334423653839872
#143: 2497756544729609216
#144: 366103733865945216
#145: 3913976690090642432
#146: 2526770526283141376
#147: 3217529742837899904
#148: 1205013479312918016
#149: 4466095599280106240
#150: 1911540963920232576
#151: 1894788358086659456
#152: 2848192650217813376
#153: 3745619091689016320
#154: 3877889893833564672
#155: 3265668217326641280
#156: 2485963973283948800
#157: 3147081795167342592
#158: 1403001541694476800
#159: 1301929107111452928
#160: 4028566451908347904
#161: 3923307832959772544
#162: 3792739590216130816
#163: 1370472765065086080
#164: 1801132022056638464
#165: 602780174454368896
#166: 1472750539270959488
#167: 1339844356845903872
#168: 293739547882420096
#169: 784314732526119552
#170: 1469717089771042560
#171: 3996098663813722624
#172: 3927474672790599296
#173: 3091714134804409472
#174: 585806910377713152
#175: 4406560789848156544
#176: 3219363483420234368
#177: 2674764172908369408
#178: 4457124855710650496
#179: 2449794851093389952
#180: 1506276847825690368
#181: 2686029597245505280
#182: 2738484479508401024
#183: 606199346379789440
#184: 689274223021259904
#185: 1555443468766489600
#186: 3818610308537636480
#187: 1322154348625113344
#188: 1740677883460914560
#189: 1174672833902617728
#190: 2644049384304301568
#191: 3671459922908149248
#192: 3084325382305467264
#193: 916969882700146944
#194: 4420489433216212096
#195: 3832121901988626048
#196: 3921705088605093888
#197: 1163764166725527296
#198: 1172800060657437440
#199: 1554402952810093056