ApJdataFrames
Erickson2011Title
: THE INITIAL MASS FUNCTION AND DISK FREQUENCY OF THE Rho OPHIUCHI CLOUD: AN EXTINCTION-LIMITED SAMPLE
Authors
: Erickson et al.
Data is from this paper:
http://iopscience.iop.org/1538-3881/142/4/140/
In [1]:
%pylab inline
import seaborn as sns
sns.set_context("notebook", font_scale=1.5)
#import warnings
#warnings.filterwarnings("ignore")
In [2]:
import pandas as pd
In [3]:
addr = "http://iopscience.iop.org/1538-3881/142/4/140/suppdata/aj403656t2_ascii.txt"
names = ['F', 'Ap', 'Alt_Names', 'X-Ray ID', 'RA', 'DEC', 'Li', 'EW_Ha', 'I', 'R-I',
'SpT_Lit', 'Spectral_Type', 'Adopt', 'Notes', 'blank']
tbl2 = pd.read_csv(addr, sep='\t', skiprows=[0,1,2,3,4], skipfooter=7, engine='python', na_values=" ... ",
index_col=False, names = names, usecols=range(len(names)-1))
tbl2.head()
Out[3]:
In [4]:
addr = "http://iopscience.iop.org/1538-3881/142/4/140/suppdata/aj403656t3_ascii.txt"
names = ['F', 'Ap', 'Alt_Names', 'WMR', 'Spectral_Type', 'A_v', 'M_I',
'log_T_eff', 'log_L_bol', 'Mass', 'log_age', 'Criteria', 'Notes', 'blank']
tbl3 = pd.read_csv(addr, sep='\t', skiprows=[0,1,2,3,4], skipfooter=9, engine='python', na_values=" ... ",
index_col=False, names = names, usecols=range(len(names)-1))
tbl3.head()
Out[4]:
In [5]:
! mkdir ../data/Erickson2011
on_F_ap = ["F", "Ap"]
on_name = "Alt_Names"
erickson2011 = pd.merge(tbl2, tbl3, on=on_F_ap, how="right")
erickson2011 = pd.merge(tbl2, erickson2011, on="Alt_Names", how="right")
message = "Table 2: {} entries \nTable 3: {} entries \nMerge: {} entries"
print message.format(len(tbl2), len(tbl3), len(erickson2011))
In [6]:
plt.plot(10**tbl3.log_T_eff, 10**tbl3.log_L_bol, '.')
plt.yscale("log")
plt.xlim(5000, 2000)
plt.ylim(1.0E-4, 1.0E1)
plt.xlabel(r"$T_{eff}$")
plt.ylabel(r"$L/L_{sun}$")
plt.title("Erickson et al. 2011 Table 3 HR Diagram")
Out[6]:
Another thing to do would be to filter out the "Possible dwarfs", etc...
Save the data tables locally.
In [7]:
tbl2.to_csv("../data/Erickson2011/tbl2.csv", sep="\t", index=False)
tbl3.to_csv("../data/Erickson2011/tbl3.csv", sep="\t", index=False)
Script finished.