In [1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from IPython.display import display
from astropy.io import ascii
from astropy.table import Table, Column
%matplotlib inline
In [2]:
from astropy.coordinates import SkyCoord
from astropy import units as u
In [3]:
cat = ascii.read('cat_lau.csv')
In [4]:
RA = cat['RAh'] + cat['RAm']*(1/60.) + cat['RAs']*(1./3600.)
Dec= -1 * (cat['DEd']*u.deg + cat['DEm']*u.arcmin + cat['DEs']*u.arcsec)
coord = SkyCoord(ra=RA*15.*u.deg, dec=Dec)
In [5]:
cat['l'] = coord.galactic.l.deg
cat['b'] = coord.galactic.b.deg
cat['J-Ks'] = cat['J$_{2\\prime\\prime}$'] - cat['Ks$_{2\\prime\\prime}$']
cat['H-Ks'] = cat['H$_{2\\prime\\prime}$'] - cat['Ks$_{2\\prime\\prime}$']
cat['J-H'] = cat['J$_{2\\prime\\prime}$'] - cat['H$_{2\\prime\\prime}$']
In [6]:
plt.figure(figsize=(12, 6))
#plt.suptitle(r'$(2 \pi R_{1/2}^2)$', fontsize=14)
plt.subplot(121)
plt.scatter(cat['l'][cat['b']>0.],
cat['b'][cat['b']>0.],
c=cat['J-Ks'][cat['b']>0.],
s=3.*2*np.pi*cat['R$_{1/2}$'][cat['b']>0.]**2.,
cmap='RdBu_r')
plt.colorbar(label=r'$J-Ks$')
plt.title(r'Tile d115 $area=(2 \pi R_{1/2}^2)$')
plt.xlabel(r'$l$')
plt.ylabel(r'$b$')
plt.grid()
plt.subplot(122)
plt.scatter(cat['l'][cat['b']<0.],
cat['b'][cat['b']<0.],
c=cat['J-Ks'][cat['b']<0.],
s=3.*2*np.pi*cat['R$_{1/2}$'][cat['b']<0.]**2.,
cmap='RdBu_r')
plt.colorbar(label=r'$J-Ks$')
plt.title(r'Tile d010 $area=(2 \pi R_{1/2}^2)$')
plt.xlabel(r'$l$')
plt.ylabel(r'$b$')
plt.grid()
plt.tight_layout()
plt.show()
In [7]:
plt.figure(figsize=(12, 6))
#plt.suptitle(r'$(2 \pi R_{1/2}^2)$', fontsize=14)
plt.subplot(121)
plt.scatter(cat['l'][cat['b']>0.],
cat['b'][cat['b']>0.],
c=cat['Visual'][cat['b']>0.]=='True',
s=3.*2*np.pi*cat['R$_{1/2}$'][cat['b']>0.]**2.)
#cmap='tab10')
plt.colorbar(label=r'Visual?')
plt.title(r'Tile d115 $area=(2 \pi R_{1/2}^2)$')
plt.xlabel(r'$l$')
plt.ylabel(r'$b$')
plt.grid()
plt.subplot(122)
plt.scatter(cat['l'][cat['b']<0.],
cat['b'][cat['b']<0.],
c=cat['Visual'][cat['b']<0.]=='True',
s=3.*2*np.pi*cat['R$_{1/2}$'][cat['b']<0.]**2.)
#cmap='RdBu_r')
plt.colorbar(label=r'Visual?')
plt.title(r'Tile d010 $area=(2 \pi R_{1/2}^2)$')
plt.xlabel(r'$l$')
plt.ylabel(r'$b$')
plt.grid()
plt.tight_layout()
plt.show()
In [8]:
filtrado = (cat['l']>308.8) & (cat['b']<-2.)
plt.subplot(121)
plt.scatter(cat['J'][filtrado], cat['J-Ks'][filtrado])
plt.xlabel('J')
plt.ylabel('J-Ks')
plt.subplot(122)
plt.hist(cat['J-Ks'][filtrado])
plt.xlabel(r'$J-Ks$')
Out[8]:
In [9]:
d010 = ascii.read('d010_resto.dat', format='ipac')
d115 = ascii.read('d115_resto.dat', format='ipac')
In [4]:
print cat.colnames
In [541]:
gxs = cat[['J', 'H', 'Ks', 'J-Ks', 'J-H', 'H-Ks', 'R$_{1/2}$', 'C', '$\\epsilon$', 'n']].to_pandas()
In [542]:
d010['J-Ks'] = d010['MAG_APER_J_C'] - d010['MAG_APER_Ks_C']
d010['H-Ks'] = d010['MAG_APER_H_C'] - d010['MAG_APER_Ks_C']
d010['J-H'] = d010['MAG_APER_J_C'] - d010['MAG_APER_H_C']
d115['J-Ks'] = d115['MAG_APER_J_C'] - d115['MAG_APER_Ks_C']
d115['H-Ks'] = d115['MAG_APER_H_C'] - d115['MAG_APER_Ks_C']
d115['J-H'] = d115['MAG_APER_J_C'] - d115['MAG_APER_H_C']
In [543]:
strs_d010= d010[['MAG_PSF_J_C','MAG_PSF_H_C','MAG_PSF_Ks_C', 'J-Ks', 'J-H', 'H-Ks',
'FLUX_RADIUS_051','C','ELLIPTICITY','SPHEROID_SERSICN']].to_pandas()
In [544]:
strs_d115= d115[['MAG_PSF_J_C','MAG_PSF_H_C','MAG_PSF_Ks_C', 'J-Ks', 'J-H', 'H-Ks',
'FLUX_RADIUS_051','C','ELLIPTICITY','SPHEROID_SERSICN']].to_pandas()
In [545]:
strs = pd.concat([strs_d010, strs_d115])
In [546]:
strs = strs[strs.MAG_PSF_J_C < 30]
gxs = gxs[gxs.J<30]
In [547]:
pd.scatter_matrix(gxs, alpha=0.3, figsize=(8, 8), diagonal='kde')
plt.show()