Summary
By galaxy:
NSAID 70630 (202.306824, 11.275839)
NSAID 70685 (202.269455, 12.238585)
NSAID 43712 (244.129181, 35.708172)
NSAID 69538 (244.060699, 34.258434)
NSAID 18158 (219.578888, 3.639615)
NSAID 68283 (242.047577, 24.507439)
NSAID 68286 (241.749313, 24.160772)
NSAID 68299 (240.918945, 24.602676)
NSAID 68342 (241.297867, 24.960102)
NSAID 113068 (175.995667, 20.077011)
NSAID 72631 (230.999481, 8.508963)
NSAID 103927 (194.490204, 27.443319)
NSAID 103966 (194.025421, 27.677467)
In [178]:
%run ~/Dropbox/pythonCode/LCSanalyzeblue.py
In [185]:
t = s.galfitflag & s.lirflag & s.sizeflag & ~s.agnflag & s.sbflag
galfitnogim = t & ~s.gim2dflag
In [186]:
sum(galfitnogim)
Out[186]:
In [181]:
s.s.ISDSS[galfitnogim]
print sum(s.s.ISDSS[galfitnogim] == -1)
In [7]:
galfitsdssnogim = galfitnogim & (s.s.ISDSS != -1)
sum(galfitsdssnogim)
Out[7]:
In [8]:
s.s.NSAID[galfitsdssnogim]
Out[8]:
In [11]:
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.table import Table
try:
# Python 3.x
from urllib.parse import urlencode
from urllib.request import urlretrieve
except ImportError:
# Python 2.x
from urllib import urlencode
from urllib import urlretrieve
import IPython.display
In [188]:
r = 22.5 - 2.5*log10(s.s.NMGY[:,4])
flag = galfitnogim & (r >= 14.) & (r <= 18.)
print sum(flag)
In [189]:
ra = s.s.RA[flag]
dec = s.s.DEC[flag]
ids = s.s.NSAID[flag]
coords = SkyCoord(ra*u.deg, dec*u.deg, frame='icrs')
testcoord = coords[0]
In [183]:
impix = 100
imsize = 1*u.arcmin
cutoutbaseurl = 'http://skyservice.pha.jhu.edu/DR12/ImgCutout/getjpeg.aspx'
for i in range(len(coords.ra)):
query_string = urlencode(dict(ra=coords[i].ra.deg,
dec=coords[i].dec.deg,
width=impix, height=impix,
scale=imsize.to(u.arcsec).value/impix))
url = cutoutbaseurl + '?' + query_string
# this downloads the image to your disk
urlretrieve(url, 'images/'+str(ids[i])+'_SDSS_cutout.jpg')
print 'NSAID %i (%10.6f, %10.6f)'%(ids[i],ra[i],dec[i])
t = IPython.display.Image('images/'+str(ids[i])+'_SDSS_cutout.jpg')
IPython.display.display(t)
In [200]:
for i in range(10,len(ids)):
print '* NSAID %i (%10.6f, %10.6f)'%(ids[i],ra[i],dec[i])
print 'http://cas.sdss.org/dr7/en/tools/explore/obj.asp?ra=%.5f&dec=%.5f'%(ra[i],dec[i])
NSAID 166124 (230.213974, 8.623065)
NSAID 146012 (229.295181, 6.941795)
In [41]:
for i in range(len(coords.ra)):
query_string = urlencode(dict(ra=coords[i].ra.deg,
dec=coords[i].dec.deg,
width=impix, height=impix,
scale=imsize.to(u.arcsec).value/impix))
url = cutoutbaseurl + '?' + query_string
# this downloads the image to your disk
urlretrieve(url, 'images/'+str(nsaids[i])+'_SDSS_cutout.jpg')
print i, nsaids[i],coords[i].ra,coords[i].dec
print 'NSAID %i (%10.6f, %10.6f)'%(nsaids[i],coords[i].ra.deg,coords[i].dec)
t = IPython.display.Image('images/'+str(nsaids[i])+'_SDSS_cutout.jpg')
IPython.display.display(t)
In [32]:
for i in range(len(coords.ra)):
print 'NSAID %i (%10.6f, %10.6f)'%(ids[i],ra[i],dec[i])
In [34]:
ids = where(galfitnogim & (s.s.ISDSS == -1))
print ids
NSAID 146659 (241.416641, 18.055758)
NSAID 146664 (241.435760, 17.715572)
NSAID 140139 (175.954529, 19.968401)
NSAID 140160 (176.071716, 20.223295)
NSAID 140174 (176.204865, 19.795046)
NSAID 140175 (176.195999, 20.125084)
NSAID 140187 (176.228104, 20.017143)
NSAID 146094 (230.452133, 8.410197)
NSAID 146121 (230.750824, 8.465475)
NSAID 146127 (230.785812, 8.334576)
NSAID 146130 (230.800995, 8.549866)
NSAID 145965 (228.749756, 6.804669)
NSAID 145984 (229.076614, 6.803605)
NSAID 145998 (229.185364, 7.021626)
NSAID 145999 (229.187805, 7.055664)
NSAID 146012 (229.295181, 6.941795)
NSAID 146041 (229.713806, 6.435888)
NSAID 166042 (228.910904, 8.302397)
NSAID 166044 (228.936951, 6.958703)
NSAID 166083 (229.217957, 6.539137)
NSAID 142797 (195.073654, 27.955275)
NSAID 142819 (195.169479, 28.519848)
NSAID 142833 (195.214752, 28.042875)
NSAID 162838 (195.280670, 28.121592)
In [50]:
lcs = fits.getdata('/Users/rfinn/research/LocalClusters/NSAmastertables/LCS_all_size.fits')
In [52]:
gim = fits.getdata('/Users/rfinn/research/SimardSDSS2011/table1.fits')virgocat = SkyCoord(vdat.RA*u.degree,vdat.DEC*u.degree,frame='icrs')
In [118]:
from astropy.coordinates import SkyCoord
from astropy import units as u
%matplotlib inline
In [56]:
lcat = SkyCoord(lcs.RA*u.degree,lcs.DEC*u.degree,frame='icrs')
gcat = SkyCoord(gim._RAJ2000*u.degree,gim._DEJ2000*u.degree,frame='icrs')
index,dist2d,dist3d = lcat.match_to_catalog_sky(gcat)
In [113]:
plt.figure()
plt.plot
Out[113]:
In [169]:
# only keep matches with matched RA and Dec w/in 1 arcsec
matchflag = dist2d.degree < 3./3600
matchedarray1=np.zeros(len(lcat),dtype=gim.dtype)
matchedarray1[matchflag] = gim[index[matchflag]]
print 'percent of LCS galaxies matched = %.1f'%(sum(matchflag)*1./len(matchflag)*100.)
In [170]:
# get rid of names that start with __
# these cause trouble in the analysis program
t = []
for a in matchedarray1.dtype.names:
t.append(a)
for i in range(len(t)):
if t[i].startswith('__'):
t[i] = t[i][2:]
t = tuple(t)
#print t
In [171]:
matchedarray1.dtype.names = t
In [172]:
outfile = '/Users/rfinn/research/LocalClusters/NSAmastertables/LCS_all.gim2d.tab1.fits'
fits.writeto(outfile,matchedarray1,overwrite=True)
In [174]:
diff = (lcs.B_T_r - matchedarray1['B_T_r'])
bad_matches = (abs(diff) > .01) & matchflag
print 'number of bad matches = ',sum(bad_matches)
In [175]:
s.s.NSAID[bad_matches]
Out[175]:
In [176]:
plt.figure()
plt.plot(lcs.RA[bad_matches],lcs.DEC[bad_matches],'ko')
print lcs.CLUSTER[bad_matches]
print sum(s.galfitflag[bad_matches])
In [177]:
print sum(diff < 0.)
In [134]:
outfile = '/Users/rfinn/research/LocalClusters/NSAmastertables/LCS_all.gim2d.tab1.fits'
gdat = fits.getdata(outfile)
In [135]:
gdat.__B_T_r
Out[135]:
In [ ]: