%pylab inline

import seaborn as sns
sns.set_context("notebook", font_scale=1.5)

#import warnings
#warnings.filterwarnings("ignore")

import pandas as pd

"""
Explanation: ApJdataFrames Muzic2014
Title: SUBSTELLAR OBJECTS IN NEARBY YOUNG CLUSTERS (SONYC). VIII. SUBSTELLAR POPULATION IN LUPUS 3
Authors: Muzic et al.
Data is from this paper:
http://iopscience.iop.org/0004-637X/785/2/159/article#apj492858t1
End of explanation
"""


tbl2 = pd.read_clipboard(#"http://iopscience.iop.org/0004-637X/785/2/159/suppdata/apj492858t2_ascii.txt",
                   sep='\t', skiprows=[0,1,2,4], skipfooter=7, engine='python', na_values=" sdotsdotsdot", usecols=range(15))
tbl2.rename(columns={"Unnamed: 6": "Av_phot", "Unnamed: 8":"Av_spec"}, inplace=True)
tbl2

! mkdir ../data/Muzic2014

tbl2.to_csv("../data/Muzic2014/tbl2.csv", index=False)

"""
Explanation: Table 2 - Photometry and Spectral Types for the Objects of Spectral Type M, or Slightly Earlier, Identified Toward Lupus 3
Internet is still not working
End of explanation
"""


tbl4 = pd.read_clipboard(#"http://iopscience.iop.org/0004-637X/785/2/159/suppdata/apj492858t4_ascii.txt",
                   sep='\t', skiprows=[0,1,2,4], skipfooter=2, engine='python', na_values=" sdotsdotsdot", usecols=range(8))
tbl4

tbl4.to_csv("../data/Muzic2014/tbl4.csv", index=False)

"""
Explanation: Table 4-
http://iopscience.iop.org/0004-637X/785/2/159/suppdata/apj492858t4_ascii.txt
End of explanation
"""


