%pylab inline
import seaborn as sns

import warnings
warnings.filterwarnings("ignore")

import pandas as pd

from astropy.io import ascii
from astropy.table import Table, join

"""
Explanation: ApJdataFrames 013: Lada2006
Title: Spitzer Observations of IC 348: The Disk Population at 2-3 Million Years
Authors: Charles J Lada, August A Muench, Kevin L Luhman, Lori E Allen, Lee Hartmann, Tom Megeath, Philip Myers, Giovanni Fazio, Kenneth Wood, James Muzerolle, George Rieke, Nick Siegler, and Erick Young  
Data is from this paper:
http://iopscience.iop.org/1538-3881/131/3/1574/fulltext/204953.html
End of explanation
"""


tbl1 = ascii.read("http://iopscience.iop.org/1538-3881/131/3/1574/fulltext/datafile1.txt")
tbl1[0:4]

"""
Explanation: Table 1 - Spitzer IRAC/MIPS IC348 catalog
End of explanation
"""


tbl2 = ascii.read("http://iopscience.iop.org/1538-3881/131/3/1574/fulltext/datafile2.txt")
tbl2[0:4]

join_tbls = join(tbl1, tbl2, keys="Seq")
print "There are {} rows in tbl1, {} in tbl2, and {} in the joined table.".format(len(tbl1), len(tbl2), len(join_tbls))

join_tbls[0:4]

"""
Explanation: Table 2 - SED Derived $\alpha_{IRAC}$ and $A_V$
But really... spectral types
End of explanation
"""


names = ["PASSBAND","DATA SYSTEM","REFERENCES","center_wavelength","F_{nu} (Jy)","References"]
tbl3 = pd.read_csv("http://iopscience.iop.org/1538-3881/131/3/1574/fulltext/204953.tb3.txt", 
                   na_values="\ldots", names = names, sep='\t')
tbl3.head()

"""
Explanation: Table 3 - Convenient passbands table
End of explanation
"""


