In [3]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [2]:
import lmc_cal

In [1]:
import ResolvedStellarPops as rsp

In [4]:
tri_outs = lmc_cal.make_trilegal_sim(overwrite=False)


/home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_CAF09_S_MAR13.dat found, not going to run trilegal and overwrite.
/home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_CAF09_S_OCT13.dat found, not going to run trilegal and overwrite.
/home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_CAF09_S_APR13VW93.dat found, not going to run trilegal and overwrite.

In [5]:
sgals = [rsp.Galaxies.simgalaxy(tri_out, filter1='J', filter2='Ks', photsys='2mass') for tri_out in tri_outs]

In [33]:
lmc_cal.main()


Found option -f /home/rosenfield/research/TP-AGBcalib/cmd_inputfiles/cmd_input_CAF09_S_MAR13.dat: inputfile reset
Found option -a: will output AGB data
Found option -l: will output labels
Input cmdfile is set to /home/rosenfield/research/TP-AGBcalib/cmd_inputfiles/cmd_input_CAF09_S_MAR13.dat
RGB mass loss is Reimers with eta=0.3500

Model input = /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_galinp.dat , output = /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_MAR13.dat
0.000100 0.249000 -2.191552
0.000200 0.249000 -1.890465
0.000500 0.249000 -1.492351
0.001000 0.250000 -1.190452
0.002000 0.252000 -0.887679
0.004000 0.256000 -0.583142
0.006000 0.259000 -0.404106
0.008000 0.263000 -0.275608
0.010000 0.267000 -0.175109
0.014000 0.273000 -0.022932
0.017000 0.279000 0.066906
0.020000 0.284000 0.142450
0.030000 0.302000 0.336374
0.040000 0.321000 0.480589
0.050000 0.339000 0.596958
0.060000 0.356000 0.695768

Pointing (l,b) = 0.000 0.000,  1.00000 sqrdeg
(alpha,delta) = 17.760 -28.934
Reading mag files from tab_mag_odfnew/tab_mag_2mass.dat

Reading 7 O-rich BC tables.
Reading also 7 C-rich BC tables.
Reading dust files from tab_dust/tab_dust_dpmod60alox40_2mass.dat and tab_dust/tab_dust_AMCSIC15_2mass.dat
File tab_dust/tab_dust_dpmod60alox40_2mass.dat

Reading 11 O-rich dust tables.
File tab_dust/tab_dust_AMCSIC15_2mass.dat
Reading 5 C-rich dust tables.

Limiting mag = 20.00 at filter 3, resolution 0.10 mag

tab_imf/imf_chabrier_lognormal.dat read
Leggendo file IMF : tab_imf/imf_chabrier_lognormal.dat

IMF total mass = 1.0000
IMF stars per mass = 3.3364
Will make binaries
Will make object of 4.2e+06 Msun
Will output catalogue

Sftot(local_object)=2.10e+07, norm=1.59e-07
4.76e+04, 1.84e+01
Found option -f /home/rosenfield/research/TP-AGBcalib/cmd_inputfiles/cmd_input_CAF09_S_OCT13.dat: inputfile reset
Found option -a: will output AGB data
Found option -l: will output labels
Input cmdfile is set to /home/rosenfield/research/TP-AGBcalib/cmd_inputfiles/cmd_input_CAF09_S_OCT13.dat
RGB mass loss is Reimers with eta=0.3500

Model input = /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_galinp.dat , output = /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_OCT13.dat
0.000100 0.249000 -2.191552
0.000200 0.249000 -1.890465
0.000500 0.249000 -1.492351
0.001000 0.250000 -1.190452
0.002000 0.252000 -0.887679
0.004000 0.256000 -0.583142
0.006000 0.259000 -0.404106
0.008000 0.263000 -0.275608
0.010000 0.267000 -0.175109
0.014000 0.273000 -0.022932
0.017000 0.279000 0.066906
0.020000 0.284000 0.142450
0.030000 0.302000 0.336374
0.040000 0.321000 0.480589
0.050000 0.339000 0.596958
0.060000 0.356000 0.695768

Pointing (l,b) = 0.000 0.000,  1.00000 sqrdeg
(alpha,delta) = 17.760 -28.934
Reading mag files from tab_mag_odfnew/tab_mag_2mass.dat

Reading 7 O-rich BC tables.
Reading also 7 C-rich BC tables.
Reading dust files from tab_dust/tab_dust_dpmod60alox40_2mass.dat and tab_dust/tab_dust_AMCSIC15_2mass.dat
File tab_dust/tab_dust_dpmod60alox40_2mass.dat

Reading 11 O-rich dust tables.
File tab_dust/tab_dust_AMCSIC15_2mass.dat
Reading 5 C-rich dust tables.

Limiting mag = 20.00 at filter 3, resolution 0.10 mag

tab_imf/imf_chabrier_lognormal.dat read
Leggendo file IMF : tab_imf/imf_chabrier_lognormal.dat

IMF total mass = 1.0000
IMF stars per mass = 3.3364
Will make binaries
Will make object of 4.2e+06 Msun
Will output catalogue

Sftot(local_object)=2.10e+07, norm=1.59e-07
4.76e+04, 1.84e+01
Found option -f /home/rosenfield/research/TP-AGBcalib/cmd_inputfiles/cmd_input_CAF09_S_APR13VW93.dat: inputfile reset
Found option -a: will output AGB data
Found option -l: will output labels
Input cmdfile is set to /home/rosenfield/research/TP-AGBcalib/cmd_inputfiles/cmd_input_CAF09_S_APR13VW93.dat
RGB mass loss is Reimers with eta=0.2000

Model input = /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_galinp.dat , output = /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_APR13VW93.dat
0.000100 0.249000 -2.191552
0.000200 0.249000 -1.890465
0.000500 0.249000 -1.492351
0.001000 0.250000 -1.190452
0.002000 0.252000 -0.887679
0.004000 0.256000 -0.583142
0.006000 0.259000 -0.404106
0.008000 0.263000 -0.275608
0.010000 0.267000 -0.175109
0.014000 0.273000 -0.022932
0.017000 0.279000 0.066906
0.020000 0.284000 0.142450
0.030000 0.302000 0.336374
0.040000 0.321000 0.480589
0.050000 0.339000 0.596958
0.060000 0.356000 0.695768

Pointing (l,b) = 0.000 0.000,  1.00000 sqrdeg
(alpha,delta) = 17.760 -28.934
Reading mag files from tab_mag_odfnew/tab_mag_2mass.dat

Reading 7 O-rich BC tables.
Reading also 7 C-rich BC tables.
Reading dust files from tab_dust/tab_dust_dpmod60alox40_2mass.dat and tab_dust/tab_dust_AMCSIC15_2mass.dat
File tab_dust/tab_dust_dpmod60alox40_2mass.dat

Reading 11 O-rich dust tables.
File tab_dust/tab_dust_AMCSIC15_2mass.dat
Reading 5 C-rich dust tables.

Limiting mag = 20.00 at filter 3, resolution 0.10 mag

tab_imf/imf_chabrier_lognormal.dat read
Leggendo file IMF : tab_imf/imf_chabrier_lognormal.dat

IMF total mass = 1.0000
IMF stars per mass = 3.3364
Will make binaries
Will make object of 4.2e+06 Msun
Will output catalogue

Sftot(local_object)=2.10e+07, norm=1.59e-07
4.76e+04, 1.84e+01
not using ASTs!!
wrote /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_MAR13__2mass.png
wrote /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_MAR13__2mass_by_mass.png
not using ASTs!!
wrote /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_OCT13__2mass.png
wrote /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_OCT13__2mass_by_mass.png
not using ASTs!!
wrote /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_APR13VW93__2mass.png
wrote /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_APR13VW93__2mass_by_mass.png
Found option -f /home/rosenfield/research/TP-AGBcalib/cmd_inputfiles/cmd_input_CAF09_S_MAR13.dat: inputfile reset
Found option -a: will output AGB data
Found option -l: will output labels
Input cmdfile is set to /home/rosenfield/research/TP-AGBcalib/cmd_inputfiles/cmd_input_CAF09_S_MAR13.dat
RGB mass loss is Reimers with eta=0.3500

Model input = /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_galinp.dat , output = /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_MAR13.dat
0.000100 0.249000 -2.191552
0.000200 0.249000 -1.890465
0.000500 0.249000 -1.492351
0.001000 0.250000 -1.190452
0.002000 0.252000 -0.887679
0.004000 0.256000 -0.583142
0.006000 0.259000 -0.404106
0.008000 0.263000 -0.275608
0.010000 0.267000 -0.175109
0.014000 0.273000 -0.022932
0.017000 0.279000 0.066906
0.020000 0.284000 0.142450
0.030000 0.302000 0.336374
0.040000 0.321000 0.480589
0.050000 0.339000 0.596958
0.060000 0.356000 0.695768

Pointing (l,b) = 0.000 0.000,  1.00000 sqrdeg
(alpha,delta) = 17.760 -28.934
Reading mag files from tab_mag_odfnew/tab_mag_2mass.dat

Reading 7 O-rich BC tables.
Reading also 7 C-rich BC tables.
Reading Cspec files from bc_odfnew/2mass/bc_cspec.dat

File bc_odfnew/2mass/bc_cspec.dat
file bc_odfnew/2mass/bc_cspec.dat: 514 spectra read, 3 metallicities
file bc_odfnew/2mass/bc_cspec.dat: 219 spectra in dmass table
Reading dust files from tab_dust/tab_dust_dpmod60alox40_2mass.dat and tab_dust/tab_dust_AMCSIC15_2mass.dat
File tab_dust/tab_dust_dpmod60alox40_2mass.dat

Reading 11 O-rich dust tables.
File tab_dust/tab_dust_AMCSIC15_2mass.dat
Reading 5 C-rich dust tables.

Limiting mag = 20.00 at filter 3, resolution 0.10 mag

tab_imf/imf_chabrier_lognormal.dat read
Leggendo file IMF : tab_imf/imf_chabrier_lognormal.dat

IMF total mass = 1.0000
IMF stars per mass = 3.3364
Will make binaries
Will make object of 4.2e+06 Msun
Will output catalogue

Sftot(local_object)=2.10e+07, norm=1.59e-07
4.76e+04, 1.84e+01
Found option -f /home/rosenfield/research/TP-AGBcalib/cmd_inputfiles/cmd_input_CAF09_S_OCT13.dat: inputfile reset
Found option -a: will output AGB data
Found option -l: will output labels
Input cmdfile is set to /home/rosenfield/research/TP-AGBcalib/cmd_inputfiles/cmd_input_CAF09_S_OCT13.dat
RGB mass loss is Reimers with eta=0.3500

Model input = /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_galinp.dat , output = /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_OCT13.dat
0.000100 0.249000 -2.191552
0.000200 0.249000 -1.890465
0.000500 0.249000 -1.492351
0.001000 0.250000 -1.190452
0.002000 0.252000 -0.887679
0.004000 0.256000 -0.583142
0.006000 0.259000 -0.404106
0.008000 0.263000 -0.275608
0.010000 0.267000 -0.175109
0.014000 0.273000 -0.022932
0.017000 0.279000 0.066906
0.020000 0.284000 0.142450
0.030000 0.302000 0.336374
0.040000 0.321000 0.480589
0.050000 0.339000 0.596958
0.060000 0.356000 0.695768

Pointing (l,b) = 0.000 0.000,  1.00000 sqrdeg
(alpha,delta) = 17.760 -28.934
Reading mag files from tab_mag_odfnew/tab_mag_2mass.dat

Reading 7 O-rich BC tables.
Reading also 7 C-rich BC tables.
Reading Cspec files from bc_odfnew/2mass/bc_cspec.dat

File bc_odfnew/2mass/bc_cspec.dat
file bc_odfnew/2mass/bc_cspec.dat: 514 spectra read, 3 metallicities
file bc_odfnew/2mass/bc_cspec.dat: 219 spectra in dmass table
Reading dust files from tab_dust/tab_dust_dpmod60alox40_2mass.dat and tab_dust/tab_dust_AMCSIC15_2mass.dat
File tab_dust/tab_dust_dpmod60alox40_2mass.dat

Reading 11 O-rich dust tables.
File tab_dust/tab_dust_AMCSIC15_2mass.dat
Reading 5 C-rich dust tables.

Limiting mag = 20.00 at filter 3, resolution 0.10 mag

tab_imf/imf_chabrier_lognormal.dat read
Leggendo file IMF : tab_imf/imf_chabrier_lognormal.dat

IMF total mass = 1.0000
IMF stars per mass = 3.3364
Will make binaries
Will make object of 4.2e+06 Msun
Will output catalogue

Sftot(local_object)=2.10e+07, norm=1.59e-07
4.76e+04, 1.84e+01
Found option -f /home/rosenfield/research/TP-AGBcalib/cmd_inputfiles/cmd_input_CAF09_S_APR13VW93.dat: inputfile reset
Found option -a: will output AGB data
Found option -l: will output labels
Input cmdfile is set to /home/rosenfield/research/TP-AGBcalib/cmd_inputfiles/cmd_input_CAF09_S_APR13VW93.dat
RGB mass loss is Reimers with eta=0.2000

Model input = /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_galinp.dat , output = /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_APR13VW93.dat
0.000100 0.249000 -2.191552
0.000200 0.249000 -1.890465
0.000500 0.249000 -1.492351
0.001000 0.250000 -1.190452
0.002000 0.252000 -0.887679
0.004000 0.256000 -0.583142
0.006000 0.259000 -0.404106
0.008000 0.263000 -0.275608
0.010000 0.267000 -0.175109
0.014000 0.273000 -0.022932
0.017000 0.279000 0.066906
0.020000 0.284000 0.142450
0.030000 0.302000 0.336374
0.040000 0.321000 0.480589
0.050000 0.339000 0.596958
0.060000 0.356000 0.695768

Pointing (l,b) = 0.000 0.000,  1.00000 sqrdeg
(alpha,delta) = 17.760 -28.934
Reading mag files from tab_mag_odfnew/tab_mag_2mass.dat

Reading 7 O-rich BC tables.
Reading also 7 C-rich BC tables.
Reading Cspec files from bc_odfnew/2mass/bc_cspec.dat

File bc_odfnew/2mass/bc_cspec.dat
file bc_odfnew/2mass/bc_cspec.dat: 514 spectra read, 3 metallicities
file bc_odfnew/2mass/bc_cspec.dat: 219 spectra in dmass table
Reading dust files from tab_dust/tab_dust_dpmod60alox40_2mass.dat and tab_dust/tab_dust_AMCSIC15_2mass.dat
File tab_dust/tab_dust_dpmod60alox40_2mass.dat

Reading 11 O-rich dust tables.
File tab_dust/tab_dust_AMCSIC15_2mass.dat
Reading 5 C-rich dust tables.

Limiting mag = 20.00 at filter 3, resolution 0.10 mag

tab_imf/imf_chabrier_lognormal.dat read
Leggendo file IMF : tab_imf/imf_chabrier_lognormal.dat

IMF total mass = 1.0000
IMF stars per mass = 3.3364
Will make binaries
Will make object of 4.2e+06 Msun
Will output catalogue

Sftot(local_object)=2.10e+07, norm=1.59e-07
4.76e+04, 1.84e+01
not using ASTs!!
wrote /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_MAR13__2mass.png
wrote /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_MAR13__2mass_by_mass.png
not using ASTs!!
wrote /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_OCT13__2mass.png
wrote /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_OCT13__2mass_by_mass.png
not using ASTs!!
wrote /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_APR13VW93__2mass.png
wrote /home/rosenfield/research/TP-AGBcalib/LMC_Calib/tri_SFR_LMC88_2mass_CAF09_S_APR13VW93__2mass_by_mass.png

In [6]:
lmc_cal.cslf(sgals)



In [7]:
sgal = sgals[0]

In [12]:
sgal.data.key_dict


Out[12]:
{'Av': 8,
 'C/O': 15,
 'Gc': 0,
 'H': 12,
 'J': 11,
 'Ks': 13,
 'Mact': 19,
 'Mcore': 14,
 'Per': 16,
 '[M/H]': 2,
 'logAge': 1,
 'logL': 4,
 'logML': 18,
 'logTe': 5,
 'logg': 6,
 'm-M0': 7,
 'm2/m1': 9,
 'm_ini': 3,
 'mbol': 10,
 'mode': 17,
 'stage': 20}

In [15]:
import galaxy_tests

In [39]:
import brewer2mpl

In [28]:
from TPAGBparams import research_path
photom_file = research_path + 'TP-AGBcalib/LMC_Calib/photom.dat'
photom = rsp.fileIO.readfile(photom_file)

In [46]:
results_file = research_path + 'TP-AGBcalib/LMC_Calib/photom_model.dat'
dtype = [('RAJ2000', '<f8'),    ('DEJ2000', '<f8'), ('recno', '<f8'),
             ('Seq', '<f8'),    ('tau', '<f8'),     ('logML', '<f8'), ('Lsun', '<f8'),
             ('Cl', '|S4'),     ('Q', '|S1'),       ('P', '|S1'), ('SED', '|S3'),
             ('recno1', '<f8'), ('Seq1', '<f8'),    ('Umag', '<f8'),
             ('Bmag', '<f8'),   ('Vmag', '<f8'),    ('Imag', '<f8'),
             ('YmagV', '<f8'),  ('JmagV', '<f8'),   ('KsmagV', '<f8'),
             ('Jmag2', '<f8'),  ('Hmag2', '<f8'),   ('Ksmag2', '<f8'),
             ('[3.6]1', '<f8'), ('[3.6]2', '<f8'),  ('[4.5]1', '<f8'),
             ('[4.5]2', '<f8'), ('[5.8]1', '<f8'),  ('[5.8]2', '<f8'),
             ('[8.0]1', '<f8'), ('[8.0]2', '<f8'),  ('[24]1', '<f8'),
             ('[24]2', '<f8'),  ('chi2C', '<f8'),   ('chi2O', '<f8')] 
results = np.genfromtxt(results_file, dtype=dtype)

In [81]:
data_color = results['Jmag2'] - results['Ksmag2']
data_logML = results['logML']
data_icstar = np.nonzero(results['Cl'] == 'C')
data_imstar = np.nonzero(results['Cl'] == 'O')

In [83]:
bmap = brewer2mpl.get_map('Set1', 'Qualitative', 3)
cols = bmap.mpl_colors
fig, (axs) = plt.subplots(nrows=3, sharex=True, sharey=True, figsize=(8,8))
for i, sgal in enumerate(sgals):
    model = sgal.name.split('_')[-1].split('.dat')[0]
    lab = galaxy_tests.translate_model_name(model)
    logml = sgal.data.get_col('logML')
    color = sgal.data.get_col('J') - sgal.data.get_col('Ks')
    axs[i].plot(color[sgal.icstar], logml[sgal.icstar], '.', label=lab, color=cols[i])
    axs[i].plot(color[sgal.imstar], logml[sgal.imstar], 'x', label=lab, color=cols[i])
    axs[i].plot(data_color[data_icstar], data_logML[data_icstar], '.', color='k')
    axs[i].plot(data_color[data_imstar], data_logML[data_imstar], 'x', color='k')
    axs[i].text(0.85, 0.1, lab, transform=axs[i].transAxes, fontsize=16)
    
axs[1].set_ylabel('$\log \dot{M}\ ({\\rm M_\odot/yr})$', fontsize=20)
axs[0].set_ylim(-11, -4)
axs[0].yaxis.set_major_locator(matplotlib.ticker.MultipleLocator(2))
axs[0].yaxis.set_minor_locator(matplotlib.ticker.MultipleLocator(.5))
axs[0].xaxis.set_minor_locator(matplotlib.ticker.MultipleLocator(.2))
axs[2].set_xlabel('$J-Ks$', fontsize=20)
plt.tick_params(labelsize=16)
fig.savefig('mdot_jks.png', dpi=300)



In [72]:
plt.subplots?