<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 ApJdataFrames 010
Step1:  Table 6 - Derived Properties for Members of Chamaeleon I
Step2:  Custom analysis
Cross-match with Simbad
Retrieve UBVRIJHKLM, IRAC, MIPS, IRAS phototometry
Retrieve spectral type and spectral type reference.
Retrieve coordinates
Calculate match difference in coordinates, when possible
Convert spectral type to numbers
Cross-match with Simbad
Step3:  Save data tables locally.
!mkdir ../data/Luhman2007
<ASSISTANT_TASK:>
Python Code:
%pylab inline
import seaborn as sns
import warnings
warnings.filterwarnings("ignore")
import pandas as pd
Explanation: ApJdataFrames 010: Luhman2007
Title: The Stellar Population of the Chamaeleon I Star-forming Region
Authors: Kevin L Luhman
Data is from this paper:
http://iopscience.iop.org/0067-0049/173/1/104/fulltext/71585.tables.html
End of explanation
names = ["Name_2MASS","Name_alt","Spectral_Type","T_eff","AJ","L_bol","IMF"]
tbl6 = pd.read_csv("http://iopscience.iop.org/0067-0049/173/1/104/fulltext/71585.tb6.txt", 
                   sep='\t', names=names, na_values='\ldots')
tbl6.head()
upper_limits = (tbl6.T_eff == "\\leq 2400")
measurements = ~upper_limits
print "There are {} upper limits and {} measurements".format(upper_limits.sum(), measurements.sum())
sns.set_context("notebook", font_scale=1.5)
plt.plot(tbl6.T_eff[measurements], tbl6.L_bol[measurements], '.')
#plt.errorbar([2400.0]*upper_limits.sum(), tbl6.L_bol[upper_limits], xerr=0.0001, yerr=None, xlolims=True)
plt.ylabel(r"$L/L_{sun}$")
plt.xlabel(r"$T_{eff} (K)$")
plt.yscale("log")
plt.title("Luhman 2007 Chamaeleon I Members")
plt.xlim(5000,2000)
Explanation: Table 6 - Derived Properties for Members of Chamaeleon I
End of explanation
from astroquery.simbad import Simbad
import astropy.coordinates as coord
import astropy.units as u
customSimbad = Simbad()
customSimbad.add_votable_fields('otype', 'id', 'sptype')
query_list = '2MASS'+tbl6.Name_2MASS.dropna().values
result = customSimbad.query_objects(query_list, verbose=True)
print "There were {} sources queried, and {} sources found.".format(len(query_list), len(result))
if len(query_list) == len(result):
    print "Hooray!  Everything matched"
else:
    print "Which ones were not found?"
result[0:2]
Explanation: Custom analysis
Cross-match with Simbad
Retrieve UBVRIJHKLM, IRAC, MIPS, IRAS phototometry
Retrieve spectral type and spectral type reference.
Retrieve coordinates
Calculate match difference in coordinates, when possible
Convert spectral type to numbers
Cross-match with Simbad
End of explanation
tbl6.to_csv("../data/Luhman2007/tbl6.csv", sep="\t")
Explanation: Save data tables locally.
!mkdir ../data/Luhman2007
End of explanation
<END_TASK>