ApJdataFrames
Muzic2015Title
: SUBSTELLAR OBJECTS IN NEARBY YOUNG CLUSTERS (SONYC) IX: THE PLANETARY-MASS DOMAIN OF CHAMAELEON-I AND UPDATED MASS FUNCTION IN LUPUS-3
Authors
: Muzic et al.
Data is from this paper:
http://iopscience.iop.org/article/10.1088/0004-637X/810/2/159/meta
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
Awful mutliple line formatting. Whyyyy?
Data Cleaning:
You have to do a regex search and replace using \n{8}\t
as the search match, and replace with nothing. Once that is complete, trim the footer and then save the file.
In [3]:
#tbl2 = pd.read_csv("http://iopscience.iop.org/0004-637X/810/2/159/suppdata/apj517985t2_ascii.txt",
# sep='\t|\n{8}', skiprows=11, skipfooter=3, engine='python', na_values="cdots")
#tbl2
In [4]:
names = ['id','alpha(J2000)','delta(J2000)','Date','Slit','I','J','K','Comments']
tbl2 = pd.read_csv('../data/Muzic2015/muzic2015_tbl2.txt',
sep='\t', na_values='cdots', names=names, header=1, index_col=False)
tbl2
Out[4]:
The $I-$band data is Cousins $I$ for Cha, and DENIS $i$ for Lupus.
In [5]:
tbl2.to_csv("../data/Muzic2015/tbl2.csv", index=False)
In [7]:
I_J = tbl2.I - tbl2.J
In [9]:
sns.distplot(I_J, axlabel='$I-J$')
Out[9]: