In [1]:
%run ../../../utils/load_notebook.py
In [2]:
return_back_path = '../../notebooks/2f/test_short/'
In [3]:
import datetime
start = datetime.datetime.now()
start
Out[3]:
In [4]:
%%time
from n338 import *
In [5]:
name
Out[5]:
In [6]:
n338dict = dict(globals(), **locals())
In [7]:
n338dict['name']
Out[7]:
In [8]:
os.chdir(return_back_path)
In [9]:
%%time
from n1167 import *
In [10]:
name
Out[10]:
In [11]:
n1167dict = dict(globals(), **locals())
In [12]:
n1167dict['name']
Out[12]:
In [13]:
del n1167dict['n338dict']
In [14]:
os.chdir(return_back_path)
In [15]:
%%time
from n2985 import *
In [16]:
n2985dict = dict(globals(), **locals())
In [17]:
n2985dict['name']
Out[17]:
In [18]:
del n2985dict['n338dict']
del n2985dict['n1167dict']
In [19]:
os.chdir(return_back_path)
In [20]:
%%time
from n3898 import *
In [21]:
n3898dict = dict(globals(), **locals())
In [22]:
n3898dict['name']
Out[22]:
In [23]:
del n3898dict['n338dict']
del n3898dict['n1167dict']
del n3898dict['n2985dict']
In [24]:
os.chdir(return_back_path)
In [25]:
%%time
from n4258 import *
In [26]:
n4258dict = dict(globals(), **locals())
In [27]:
n4258dict['name']
Out[27]:
In [28]:
del n4258dict['n338dict']
del n4258dict['n1167dict']
del n4258dict['n2985dict']
del n4258dict['n3898dict']
In [29]:
os.chdir(return_back_path)
In [30]:
%%time
from n4725 import *
In [31]:
n4725dict = dict(globals(), **locals())
In [32]:
n4725dict['name']
Out[32]:
In [33]:
del n4725dict['n338dict']
del n4725dict['n1167dict']
del n4725dict['n2985dict']
del n4725dict['n3898dict']
del n4725dict['n4258dict']
In [34]:
os.chdir(return_back_path)
In [35]:
%%time
from n5533 import *
In [36]:
n5533dict = dict(globals(), **locals())
In [37]:
n5533dict['name']
Out[37]:
In [38]:
del n5533dict['n338dict']
del n5533dict['n1167dict']
del n5533dict['n2985dict']
del n5533dict['n3898dict']
del n5533dict['n4258dict']
del n5533dict['n4725dict']
In [39]:
end = datetime.datetime.now()
end
Out[39]:
In [40]:
finish = end-start
In [41]:
finish.total_seconds()/3600.
Out[41]:
In [ ]:
In [ ]:
In [42]:
# %%time
# for ind, name1 in enumerate(['n338', 'n1167', 'n2985', 'n3898', 'n4258', 'n4725', 'n5533']):
# for name2 in ['n338', 'n1167', 'n2985', 'n3898', 'n4258', 'n4725', 'n5533'][ind+1:]:
# dict1 = locals()[name1+'dict']
# dict2 = locals()[name2+'dict']
# for key in dict1.keys():
# if key in dict2.keys():
# try:
# if type(dict1[key]) == type(dict2[key]) == np.ndarray:
# if (dict1[key] == dict2[key]).all():
# del dict2[key]
# elif dict1[key] == dict2[key]:
# del dict2[key]
# except Exception:
# print key, name1, name2
In [ ]:
In [43]:
n338dict['star_approx'] == n2985dict['star_approx']
Out[43]:
In [ ]:
In [ ]:
In [ ]:
In [44]:
tex_imgs_dir = 'C:\\Users\\root\\Dropbox\\RotationCurves\\PhD\\paper2\\imgs'
In [45]:
os.chdir(tex_imgs_dir)
fig, axs = plt.subplots(nrows=7, ncols=3, sharex=False, sharey=False, figsize=[16,30])
names = [r'$\rm{NGC\, 338}$', r'$\rm{NGC\, 1167}$', r'$\rm{NGC\, 2985}$', r'$\rm{NGC\, 3898}$', r'$\rm{NGC\, 4258}$', r'$\rm{NGC\, 4725}$', r'$\rm{NGC\, 5533}$',]
ax1 = axs[0,0]
ax2 = axs[1,0]
ax3 = axs[2,0]
ax4 = axs[3,0]
ax5 = axs[4,0]
ax6 = axs[5,0]
ax7 = axs[6,0]
axes = [ax1, ax2, ax3, ax4, ax5, ax6, ax7]
# ===================================================
# Дисперии
# ===================================================
for ind, name in enumerate(['n338', 'n1167', 'n2985', 'n3898', 'n4258', 'n4725', 'n5533']):
ax = axes[ind]
try:
ax.errorbar(map(abs, locals()[name+'dict']['r_sig_ma']), locals()[name+'dict']['sig_ma'], yerr=locals()[name+'dict']['e_sig_ma'],
fmt='.', marker='.', mew=0, color='red', label='$\sigma_{los}^{maj}$')
ax.plot(points, map(locals()[name+'dict']['sig_R_maj_min'], locals()[name+'dict']['points']))
ax.plot(points, map(locals()[name+'dict']['sig_R_maj_max'], locals()[name+'dict']['points']))
# ax.plot(points, map(locals()[name+'dict']['sig_R_maj_maxmaxtrue'], locals()[name+'dict']['points']))
except Exception:
print 'WARNING S:{}'.format(name)
ax.xaxis.set_major_locator(MultipleLocator(10))
ax.xaxis.set_minor_locator(MultipleLocator(2))
# ax.plot([reb, reb],[0, (50 - 30*(ind/2))], color='black', lw=2)
# ax.axvline(x=reb, ls='--', color='black')
ax.text(0.8, 0.9, names[ind], fontsize=20, ha='center', va='center', transform=ax.transAxes)
ax.yaxis.set_label_coords(-0.055, 0.5)
ax.set_ylabel(r'$\sigma_{\rm{los}},\, \rm{km/s}$', fontsize=20)
ax.set_xlabel(r'$R,\, \rm{arcsec}$', fontsize=20)
ax.yaxis.set_major_locator(MultipleLocator(100))
# ===================================================
# Кривая вращения
# ===================================================
ax1 = axs[0,1]
ax2 = axs[1,1]
ax3 = axs[2,1]
ax4 = axs[3,1]
ax5 = axs[4,1]
ax6 = axs[5,1]
ax7 = axs[6,1]
axes = [ax1, ax2, ax3, ax4, ax5, ax6, ax7]
for ind, name in enumerate(['n338', 'n1167', 'n2985', 'n3898', 'n4258', 'n4725', 'n5533']):
ax = axes[ind]
try:
ax.plot(points, map(locals()[name+'dict']['spl_gas'], locals()[name+'dict']['points']), '--')
ax.plot(locals()[name+'dict']['r_g_b'], locals()[name+'dict']['vel_g_b'], '.')
except Exception:
print 'WARNING V:{}'.format(name)
try:
ax.plot(locals()[name+'dict']['r_wsrt'], locals()[name+'dict']['vel_wsrt'], '.')
except Exception:
print 'WARNING V:{}'.format(name)
try:
ax.plot(locals()[name+'dict']['r_noord'], locals()[name+'dict']['vel_noord'], '.')
ax.plot(locals()[name+'dict']['r_ma_n'], locals()[name+'dict']['vel_ma_n'], 's')
except Exception:
print 'WARNING V:{}'.format(name)
ax.text(0.8, 0.2, names[ind], fontsize=20, ha='center', va='center', transform=ax.transAxes)
ax.yaxis.set_label_coords(-0.055, 0.5)
ax.set_ylabel(r'$V,\, \rm{km/s}$', fontsize=20)
ax.set_xlabel(r'$R,\, \rm{arcsec}$', fontsize=20)
ax.set_ylim(0, 400)
ax.xaxis.set_major_locator(MultipleLocator(10))
# ax.xaxis.set_minor_locator(MultipleLocator(2))
ax.yaxis.set_major_locator(MultipleLocator(100))
# ax2.set_ylim(0, 400)
# ===================================================
# Поверхностная плотность
# ===================================================
ax1 = axs[0,2]
ax2 = axs[1,2]
ax3 = axs[2,2]
ax4 = axs[3,2]
ax5 = axs[4,2]
ax6 = axs[5,2]
ax7 = axs[6,2]
axes = [ax1, ax2, ax3, ax4, ax5, ax6, ax7]
# axes[3].plot(r_g_dens, gas_dens, 'd-')
# axes[3].plot(r_g_dens, [He_coeff*(y_interp_(l[0], h_disc_R) + l[1]) for l in zip(r_g_dens, gas_dens)], '*-')
# axes[3].plot(r_g_dens, [y_interp_(l, h_disc_R) for l in r_g_dens], '--', label='H2 (R-photom)')
# axes[3].set_title('Gas')
# axes[3].grid()
# axes[3].set_xlim(0, 200)
# axes[3].legend()
# axes[3].plot(r_g_dens, gas_dens, 'd-')
# axes[3].plot(r_g_dens, [He_coeff*(y_interp_(l[0], h_disc_I) + l[1]) for l in zip(r_g_dens, gas_dens)], '*-')
# axes[3].plot(r_g_dens, [y_interp_(l, h_disc_I) for l in r_g_dens], '--', label='H2 (I-photom)')
# axes[3].set_title('Gas')
# axes[3].grid()
# axes[3].set_xlim(0, 200)
# axes[3].legend()
# axes[3].plot(r_HI_dens, HI_dens, '--', label='HI')
# axes[3].plot(zip(*total_gas_data)[0], zip(*total_gas_data)[1], '*-')
# axes[3].plot(r_mol_dens, mol_dens, '--', label='mol')
# axes[3].set_title('Gas')
# axes[3].grid()
# axes[3].set_xlim(0, 200)
# axes[3].legend()
for ind, name in enumerate(['n338', 'n1167', 'n2985', 'n3898', 'n4258', 'n4725', 'n5533']):
ax = axes[ind]
try:
ax.plot(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'], 'o-')
except Exception:
print 'WARNING G:{}'.format(name)
try:
ax.plot(locals()[name+'dict']['r_HI_dens'], locals()[name+'dict']['HI_dens'], 'o-')
except Exception:
print 'WARNING G:{}'.format(name)
try:
ax.plot(zip(*locals()[name+'dict']['total_gas_data'])[0], zip(*locals()[name+'dict']['total_gas_data'])[1], 'o-')
except Exception:
print 'WARNING G:{}'.format(name)
try:
ax.plot(zip(*locals()[name+'dict']['total_gas_data_'])[0], zip(*locals()[name+'dict']['total_gas_data_'])[1], 'o-')
except Exception:
print 'WARNING G:{}'.format(name)
ax.xaxis.set_major_locator(MultipleLocator(100))
ax.xaxis.set_minor_locator(MultipleLocator(50))
# ax.plot([reb, reb],[0, (50 - 30*(ind/2))], color='black', lw=2)
# ax.axvline(x=reb, ls='--', color='black')
ax.text(0.8, 0.9, names[ind], fontsize=20, ha='center', va='center', transform=ax.transAxes)
ax.yaxis.set_label_coords(-0.055, 0.5)
ax.set_ylabel(r'$\Sigma_{\rm{los}},\, \rm{M_{sun}/{pc}^2}$', fontsize=20)
ax.set_xlabel(r'$R,\, \rm{arcsec}$', fontsize=20)
ax.yaxis.set_major_locator(MultipleLocator(10))
ax.yaxis.set_minor_locator(MultipleLocator(1))
if name == 'n4258':
ax.set_ylim(0, 30)
# ax1.set_xlim(0, 45)
# ax1.set_ylim(0)
# ax2.set_ylim(0, 240)
# ax2.set_xlim(0, 45)
# # ax2.set_ylabel(r'$\sigma_{\rm{los}},\, \rm{km/s}$', fontsize=15)
# ax3.set_ylim(0, 225)
# ax3.set_xlim(0, 60)
# # ax3.axes.yaxis.set_ticklabels([])
# # ax4.set_ylim(0, 150)
# # ax4.set_xlim(0, 72)
# # ax4.set_ylabel(r'$\sigma_{\rm{los}},\, \rm{km/s}$', fontsize=10)
# # ax4.set_xlabel(r'$R,\, \rm{arcsec}$', fontsize=15)
# ax4.set_ylim(0, 110)
# # ax5.set_xlim(0, 50)
# # ax5.axes.yaxis.set_ticklabels([])
# # ax5.set_ylabel(r'$\sigma_{\rm{gas}},\, \rm{km/s}$', fontsize=20)
# # ax5.set_xlabel(r'$R,\, \rm{arcsec}$', fontsize=20)
fig.subplots_adjust(wspace=0.15, hspace=0.25)
# plt.savefig('observ_data.eps', format='eps')
# plt.savefig('observ_data.png', format='png')
# plt.savefig('observ_data.pdf', format='pdf', dpi=150)
plt.show()
In [ ]:
In [ ]:
In [46]:
def plot_kennicutt(ax=None, total_gas_data=None, epicycl=None, gas_approx=None, sound_vel=None, scale=None, sigma_max=None, sigma_min=None, star_density_max=None,
star_density_min=None, data_lim=None, color=None, alpha=0.3, disk_scales=[], label=None, sfrange=None):
invQg, invQs, invQeff_min = zip(*get_invQeff_from_data(gas_data=total_gas_data,
epicycl=epicycl,
gas_approx=gas_approx,
sound_vel=sound_vel,
scale=scale,
sigma=sigma_max,
star_density=star_density_min))
invQg, invQs, invQeff_max = zip(*get_invQeff_from_data(gas_data=total_gas_data,
epicycl=epicycl,
gas_approx=gas_approx,
sound_vel=sound_vel,
scale=scale,
sigma=sigma_min,
star_density=star_density_max))
rr = zip(*total_gas_data)[0]
# ax.fill_between(rr, invQeff_min, invQeff_max, color=color, alpha=alpha, label=label)
ax.plot(np.array(rr)/sfrange, invQeff_min, '.-', color=color, alpha=0.8)
ax.plot(np.array(rr)/sfrange, invQeff_max, '--', color=color, alpha=0.8)
# ax.plot(rr, invQg, 'v-', color='b')
# ax.set_ylim(0., 1.5)
# ax.set_xlim(0., data_lim+50.)
# plot_SF(ax)
# plot_data_lim(ax, data_lim)
# for h, annot in disk_scales:
# plot_disc_scale(h, ax, annot)
# plot_Q_levels(ax, [1., 1.5, 2., 3.])
# ax.legend()
In [47]:
kenn_photom={'n338' : ['mu0d_Ic', 'h_disc_I', 6.23, 'I', 60.],
'n1167' : ['mu0d_Rc', 'h_disc_R', 5.53, 'R', 40.],
'n2985' : ['mudK', 'hK', 1.42, 'K', 70.],
'n3898' : ['mu0d_R', 'h_disc_R', 7.80, 'R', 80.],
'n4258' : ['mu0d_I', 'h_disc_I', 0.82, 'I', 150.],
'n4725' : ['mu0d_H', 'h_disc_H', 0.68, 'H', 55.],
'n5533' : ['MU0_r', 'hi_r', 4.41, 'r', 100.]}
fig = plt.figure(figsize=[16, 6])
for ind, name in enumerate(['n338', 'n1167', 'n2985', 'n3898', 'n4258', 'n4725', 'n5533']):
ax = plt.gca()
color = cm.rainbow(np.linspace(0, 1, 7))[ind]
phot = kenn_photom[name]
mud = locals()[name+'dict'][phot[0]]
h = locals()[name+'dict'][phot[1]]
# print name
# print mud
# print h
if name in ['n4258', 'n4725']:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], map(lambda l: l[0], zip(locals()[name+'dict']['gas_dens'])))[1:15]
elif name == 'n2985':
total_gas_data=locals()[name+'dict']['total_gas_data_']
else:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], [He_coeff*(locals()[name+'dict']['y_interp_'](l[0], h) + l[1]) for l in
zip(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'])])[1:15]
if total_gas_data[0][0] < 0.1:
total_gas_data = total_gas_data[1:]
# print total_gas_data
plot_kennicutt(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plt.plot([-1, -2], [-1, -2], '-', color=color, label=name+' '+phot[3])
plt.axvline(x=1, alpha=0.5)
plot_Q_levels(ax, [1.5, 2., 3.])
plt.legend()
plt.xlim(0, 3)
plt.ylim(0, 1.3)
plt.ylabel(r'$\Sigma_g/\Sigma_{cr}$', fontsize=20)
plt.xlabel(r'$R/R_{SF}$', fontsize=20)
plt.show()
Среднее значение
In [54]:
def plot_kennicutt_half(ax=None, total_gas_data=None, epicycl=None, gas_approx=None, sound_vel=None, scale=None, sigma_max=None, sigma_min=None, star_density_max=None,
star_density_min=None, data_lim=None, color=None, alpha=0.3, disk_scales=[], label=None, sfrange=None):
invQg, invQs, invQeff_min = zip(*get_invQeff_from_data(gas_data=total_gas_data,
epicycl=epicycl,
gas_approx=gas_approx,
sound_vel=sound_vel,
scale=scale,
sigma=sigma_max,
star_density=star_density_min))
invQg, invQs, invQeff_max = zip(*get_invQeff_from_data(gas_data=total_gas_data,
epicycl=epicycl,
gas_approx=gas_approx,
sound_vel=sound_vel,
scale=scale,
sigma=sigma_min,
star_density=star_density_max))
rr = zip(*total_gas_data)[0]
ax.plot(np.array(rr)/sfrange, (np.array(invQeff_min)+np.array(invQeff_max))/2., '.-', color=color, alpha=0.8)
In [55]:
kenn_photom={'n338' : ['mu0d_Ic', 'h_disc_I', 6.23, 'I', 60.],
'n1167' : ['mu0d_Rc', 'h_disc_R', 5.53, 'R', 40.],
'n2985' : ['mudK', 'hK', 1.42, 'K', 70.],
'n3898' : ['mu0d_R', 'h_disc_R', 7.80, 'R', 80.],
'n4258' : ['mu0d_I', 'h_disc_I', 0.82, 'I', 150.],
'n4725' : ['mu0d_H', 'h_disc_H', 0.68, 'H', 55.],
'n5533' : ['MU0_r', 'hi_r', 4.41, 'r', 100.]}
fig = plt.figure(figsize=[16, 6])
for ind, name in enumerate(['n338', 'n1167', 'n2985', 'n3898', 'n4258', 'n4725', 'n5533']):
ax = plt.gca()
color = cm.rainbow(np.linspace(0, 1, 7))[ind]
phot = kenn_photom[name]
mud = locals()[name+'dict'][phot[0]]
h = locals()[name+'dict'][phot[1]]
# print name
# print mud
# print h
if name in ['n4258', 'n4725']:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], map(lambda l: l[0], zip(locals()[name+'dict']['gas_dens'])))[1:15]
elif name == 'n2985':
total_gas_data=locals()[name+'dict']['total_gas_data_']
else:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], [He_coeff*(locals()[name+'dict']['y_interp_'](l[0], h) + l[1]) for l in
zip(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'])])[1:15]
if total_gas_data[0][0] < 0.1:
total_gas_data = total_gas_data[1:]
# print total_gas_data
plot_kennicutt_half(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plt.plot([-1, -2], [-1, -2], '-', color=color, label=name+' '+phot[3])
plt.axvline(x=1, alpha=0.5)
plot_Q_levels(ax, [1.5, 2., 3.])
plt.legend()
plt.xlim(0, 3)
plt.ylim(0, 1.3)
plt.ylabel(r'$\Sigma_g/\Sigma_{cr}$', fontsize=20)
plt.xlabel(r'$R/R_{SF}$', fontsize=20)
plt.show()
Только для галактик с молек. газом:
In [58]:
kenn_photom={'n338' : ['mu0d_Ic', 'h_disc_I', 6.23, 'I', 60.],
'n1167' : ['mu0d_Rc', 'h_disc_R', 5.53, 'R', 40.],
'n2985' : ['mudK', 'hK', 1.42, 'K', 70.],
'n3898' : ['mu0d_R', 'h_disc_R', 7.80, 'R', 80.],
'n4258' : ['mu0d_I', 'h_disc_I', 0.82, 'I', 150.],
'n4725' : ['mu0d_H', 'h_disc_H', 0.68, 'H', 55.],
'n5533' : ['MU0_r', 'hi_r', 4.41, 'r', 100.]}
fig = plt.figure(figsize=[16, 6])
for ind, name in enumerate(['n2985', 'n4258', 'n4725']):
ax = plt.gca()
color = cm.rainbow(np.linspace(0, 1, 7))[ind]
phot = kenn_photom[name]
mud = locals()[name+'dict'][phot[0]]
h = locals()[name+'dict'][phot[1]]
# print name
# print mud
# print h
if name in ['n4258', 'n4725']:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], map(lambda l: l[0], zip(locals()[name+'dict']['gas_dens'])))[1:15]
elif name == 'n2985':
total_gas_data=locals()[name+'dict']['total_gas_data_']
else:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], [He_coeff*(locals()[name+'dict']['y_interp_'](l[0], h) + l[1]) for l in
zip(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'])])[1:15]
if total_gas_data[0][0] < 0.1:
total_gas_data = total_gas_data[1:]
# print total_gas_data
plot_kennicutt_half(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plt.plot([-1, -2], [-1, -2], '-', color=color, label=name+' '+phot[3])
plt.axvline(x=1, alpha=0.5)
plot_Q_levels(ax, [1.5, 2., 3.])
plt.legend()
plt.xlim(0, 3)
plt.ylim(0, 1.3)
plt.ylabel(r'$\Sigma_g/\Sigma_{cr}$', fontsize=20)
plt.xlabel(r'$R/R_{SF}$', fontsize=20)
plt.show()
ВАУ.
Если изменить масштаб для 4725 (там непонятно), то тоже хорошо, но хуже.
In [59]:
kenn_photom={'n338' : ['mu0d_Ic', 'h_disc_I', 6.23, 'I', 60.],
'n1167' : ['mu0d_Rc', 'h_disc_R', 5.53, 'R', 40.],
'n2985' : ['mudK', 'hK', 1.42, 'K', 70.],
'n3898' : ['mu0d_R', 'h_disc_R', 7.80, 'R', 80.],
'n4258' : ['mu0d_I', 'h_disc_I', 0.82, 'I', 150.],
'n4725' : ['mu0d_H', 'h_disc_H', 0.68, 'H', 100.],
'n5533' : ['MU0_r', 'hi_r', 4.41, 'r', 100.]}
fig = plt.figure(figsize=[16, 6])
for ind, name in enumerate(['n2985', 'n4258', 'n4725']):
ax = plt.gca()
color = cm.rainbow(np.linspace(0, 1, 7))[ind]
phot = kenn_photom[name]
mud = locals()[name+'dict'][phot[0]]
h = locals()[name+'dict'][phot[1]]
# print name
# print mud
# print h
if name in ['n4258', 'n4725']:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], map(lambda l: l[0], zip(locals()[name+'dict']['gas_dens'])))[1:15]
elif name == 'n2985':
total_gas_data=locals()[name+'dict']['total_gas_data_']
else:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], [He_coeff*(locals()[name+'dict']['y_interp_'](l[0], h) + l[1]) for l in
zip(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'])])[1:15]
if total_gas_data[0][0] < 0.1:
total_gas_data = total_gas_data[1:]
# print total_gas_data
plot_kennicutt_half(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plt.plot([-1, -2], [-1, -2], '-', color=color, label=name+' '+phot[3])
plt.axvline(x=1, alpha=0.5)
plot_Q_levels(ax, [1.5, 2., 3.])
plt.legend()
plt.xlim(0, 3)
plt.ylim(0, 1.3)
plt.ylabel(r'$\Sigma_g/\Sigma_{cr}$', fontsize=20)
plt.xlabel(r'$R/R_{SF}$', fontsize=20)
plt.show()
Разброс для молек.
In [60]:
kenn_photom={'n338' : ['mu0d_Ic', 'h_disc_I', 6.23, 'I', 60.],
'n1167' : ['mu0d_Rc', 'h_disc_R', 5.53, 'R', 40.],
'n2985' : ['mudK', 'hK', 1.42, 'K', 70.],
'n3898' : ['mu0d_R', 'h_disc_R', 7.80, 'R', 80.],
'n4258' : ['mu0d_I', 'h_disc_I', 0.82, 'I', 150.],
'n4725' : ['mu0d_H', 'h_disc_H', 0.68, 'H', 55.],
'n5533' : ['MU0_r', 'hi_r', 4.41, 'r', 100.]}
fig = plt.figure(figsize=[16, 6])
for ind, name in enumerate(['n2985', 'n4258', 'n4725']):
ax = plt.gca()
color = cm.rainbow(np.linspace(0, 1, 7))[ind]
phot = kenn_photom[name]
mud = locals()[name+'dict'][phot[0]]
h = locals()[name+'dict'][phot[1]]
# print name
# print mud
# print h
if name in ['n4258', 'n4725']:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], map(lambda l: l[0], zip(locals()[name+'dict']['gas_dens'])))[1:15]
elif name == 'n2985':
total_gas_data=locals()[name+'dict']['total_gas_data_']
else:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], [He_coeff*(locals()[name+'dict']['y_interp_'](l[0], h) + l[1]) for l in
zip(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'])])[1:15]
if total_gas_data[0][0] < 0.1:
total_gas_data = total_gas_data[1:]
# print total_gas_data
plot_kennicutt(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plt.plot([-1, -2], [-1, -2], '-', color=color, label=name+' '+phot[3])
plt.axvline(x=1, alpha=0.5)
plot_Q_levels(ax, [1.5, 2., 3.])
plt.legend()
plt.xlim(0, 3)
plt.ylim(0, 1.3)
plt.ylabel(r'$\Sigma_g/\Sigma_{cr}$', fontsize=20)
plt.xlabel(r'$R/R_{SF}$', fontsize=20)
plt.show()
Одножидкостный
In [64]:
def plot_1f(ax=None, total_gas_data=None, epicycl=None, gas_approx=None, sound_vel=None, scale=None, sigma_max=None, sigma_min=None, star_density_max=None,
star_density_min=None, data_lim=None, color=None, alpha=0.3, disk_scales=[], label=None, sfrange=None):
invQg, invQs, invQeff_min = zip(*get_invQeff_from_data(gas_data=total_gas_data,
epicycl=epicycl,
gas_approx=gas_approx,
sound_vel=sound_vel,
scale=scale,
sigma=sigma_max,
star_density=star_density_min))
rr = zip(*total_gas_data)[0]
ax.plot(np.array(rr)/sfrange, invQg, '--', color=color, alpha=0.8)
In [65]:
kenn_photom={'n338' : ['mu0d_Ic', 'h_disc_I', 6.23, 'I', 60.],
'n1167' : ['mu0d_Rc', 'h_disc_R', 5.53, 'R', 40.],
'n2985' : ['mudK', 'hK', 1.42, 'K', 70.],
'n3898' : ['mu0d_R', 'h_disc_R', 7.80, 'R', 80.],
'n4258' : ['mu0d_I', 'h_disc_I', 0.82, 'I', 150.],
'n4725' : ['mu0d_H', 'h_disc_H', 0.68, 'H', 55.],
'n5533' : ['MU0_r', 'hi_r', 4.41, 'r', 100.]}
fig = plt.figure(figsize=[16, 6])
for ind, name in enumerate(['n338', 'n1167', 'n2985', 'n3898', 'n4258', 'n4725', 'n5533']):
ax = plt.gca()
color = cm.rainbow(np.linspace(0, 1, 7))[ind]
phot = kenn_photom[name]
mud = locals()[name+'dict'][phot[0]]
h = locals()[name+'dict'][phot[1]]
# print name
# print mud
# print h
if name in ['n4258', 'n4725']:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], map(lambda l: l[0], zip(locals()[name+'dict']['gas_dens'])))[1:15]
elif name == 'n2985':
total_gas_data=locals()[name+'dict']['total_gas_data_']
else:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], [He_coeff*(locals()[name+'dict']['y_interp_'](l[0], h) + l[1]) for l in
zip(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'])])[1:15]
if total_gas_data[0][0] < 0.1:
total_gas_data = total_gas_data[1:]
# print total_gas_data
plot_1f(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plt.plot([-1, -2], [-1, -2], '-', color=color, label=name+' '+phot[3])
plt.axvline(x=1, alpha=0.5)
plot_Q_levels(ax, [1.5, 2., 3.])
plt.legend()
plt.xlim(0, 3)
plt.ylim(0, 1.3)
plt.ylabel(r'$\Sigma_g/\Sigma_{cr}$', fontsize=20)
plt.xlabel(r'$R/R_{SF}$', fontsize=20)
plt.show()
Только с молек.:
In [66]:
kenn_photom={'n338' : ['mu0d_Ic', 'h_disc_I', 6.23, 'I', 60.],
'n1167' : ['mu0d_Rc', 'h_disc_R', 5.53, 'R', 40.],
'n2985' : ['mudK', 'hK', 1.42, 'K', 70.],
'n3898' : ['mu0d_R', 'h_disc_R', 7.80, 'R', 80.],
'n4258' : ['mu0d_I', 'h_disc_I', 0.82, 'I', 150.],
'n4725' : ['mu0d_H', 'h_disc_H', 0.68, 'H', 55.],
'n5533' : ['MU0_r', 'hi_r', 4.41, 'r', 100.]}
fig = plt.figure(figsize=[16, 6])
for ind, name in enumerate(['n2985', 'n4258', 'n4725']):
ax = plt.gca()
color = cm.rainbow(np.linspace(0, 1, 7))[ind]
phot = kenn_photom[name]
mud = locals()[name+'dict'][phot[0]]
h = locals()[name+'dict'][phot[1]]
# print name
# print mud
# print h
if name in ['n4258', 'n4725']:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], map(lambda l: l[0], zip(locals()[name+'dict']['gas_dens'])))[1:15]
elif name == 'n2985':
total_gas_data=locals()[name+'dict']['total_gas_data_']
else:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], [He_coeff*(locals()[name+'dict']['y_interp_'](l[0], h) + l[1]) for l in
zip(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'])])[1:15]
if total_gas_data[0][0] < 0.1:
total_gas_data = total_gas_data[1:]
# print total_gas_data
plot_1f(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plt.plot([-1, -2], [-1, -2], '-', color=color, label=name+' '+phot[3])
plt.axvline(x=1, alpha=0.5)
plot_Q_levels(ax, [1.5, 2., 3.])
plt.legend()
plt.xlim(0, 3)
plt.ylim(0, 1.3)
plt.ylabel(r'$\Sigma_g/\Sigma_{cr}$', fontsize=20)
plt.xlabel(r'$R/R_{SF}$', fontsize=20)
plt.show()
Vs 2F:
In [67]:
kenn_photom={'n338' : ['mu0d_Ic', 'h_disc_I', 6.23, 'I', 60.],
'n1167' : ['mu0d_Rc', 'h_disc_R', 5.53, 'R', 40.],
'n2985' : ['mudK', 'hK', 1.42, 'K', 70.],
'n3898' : ['mu0d_R', 'h_disc_R', 7.80, 'R', 80.],
'n4258' : ['mu0d_I', 'h_disc_I', 0.82, 'I', 150.],
'n4725' : ['mu0d_H', 'h_disc_H', 0.68, 'H', 55.],
'n5533' : ['MU0_r', 'hi_r', 4.41, 'r', 100.]}
fig = plt.figure(figsize=[16, 6])
for ind, name in enumerate(['n2985', 'n4258', 'n4725']):
ax = plt.gca()
color = cm.rainbow(np.linspace(0, 1, 7))[ind]
phot = kenn_photom[name]
mud = locals()[name+'dict'][phot[0]]
h = locals()[name+'dict'][phot[1]]
# print name
# print mud
# print h
if name in ['n4258', 'n4725']:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], map(lambda l: l[0], zip(locals()[name+'dict']['gas_dens'])))[1:15]
elif name == 'n2985':
total_gas_data=locals()[name+'dict']['total_gas_data_']
else:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], [He_coeff*(locals()[name+'dict']['y_interp_'](l[0], h) + l[1]) for l in
zip(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'])])[1:15]
if total_gas_data[0][0] < 0.1:
total_gas_data = total_gas_data[1:]
# print total_gas_data
plot_1f(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plot_kennicutt_half(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plt.plot([-1, -2], [-1, -2], '-', color=color, label=name+' '+phot[3])
plt.axvline(x=1, alpha=0.5)
plot_Q_levels(ax, [1.5, 2., 3.])
plt.legend()
plt.xlim(0, 3)
plt.ylim(0, 1.3)
plt.ylabel(r'$\Sigma_g/\Sigma_{cr}$', fontsize=20)
plt.xlabel(r'$R/R_{SF}$', fontsize=20)
plt.show()
1F vs 2F (среднее):
In [68]:
def plot_1f_vs_2f(ax=None, total_gas_data=None, epicycl=None, gas_approx=None, sound_vel=None, scale=None, sigma_max=None, sigma_min=None, star_density_max=None,
star_density_min=None, data_lim=None, color=None, alpha=0.3, disk_scales=[], label=None, sfrange=None):
invQg, invQs, invQeff_min = zip(*get_invQeff_from_data(gas_data=total_gas_data,
epicycl=epicycl,
gas_approx=gas_approx,
sound_vel=sound_vel,
scale=scale,
sigma=sigma_max,
star_density=star_density_min))
invQg, invQs, invQeff_max = zip(*get_invQeff_from_data(gas_data=total_gas_data,
epicycl=epicycl,
gas_approx=gas_approx,
sound_vel=sound_vel,
scale=scale,
sigma=sigma_min,
star_density=star_density_max))
rr = zip(*total_gas_data)[0]
ax.plot(invQg, (np.array(invQeff_min)+np.array(invQeff_max))/2., '.', color=color, alpha=0.8)
In [81]:
kenn_photom={'n338' : ['mu0d_Ic', 'h_disc_I', 6.23, 'I', 60.],
'n1167' : ['mu0d_Rc', 'h_disc_R', 5.53, 'R', 40.],
'n2985' : ['mudK', 'hK', 1.42, 'K', 70.],
'n3898' : ['mu0d_R', 'h_disc_R', 7.80, 'R', 80.],
'n4258' : ['mu0d_I', 'h_disc_I', 0.82, 'I', 150.],
'n4725' : ['mu0d_H', 'h_disc_H', 0.68, 'H', 55.],
'n5533' : ['MU0_r', 'hi_r', 4.41, 'r', 100.]}
fig = plt.figure(figsize=[8, 8])
for ind, name in enumerate(['n338', 'n1167', 'n2985', 'n3898', 'n4258', 'n4725', 'n5533']):
ax = plt.gca()
color = cm.rainbow(np.linspace(0, 1, 7))[ind]
phot = kenn_photom[name]
mud = locals()[name+'dict'][phot[0]]
h = locals()[name+'dict'][phot[1]]
# print name
# print mud
# print h
if name in ['n4258', 'n4725']:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], map(lambda l: l[0], zip(locals()[name+'dict']['gas_dens'])))[1:15]
elif name == 'n2985':
total_gas_data=locals()[name+'dict']['total_gas_data_']
else:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], [He_coeff*(locals()[name+'dict']['y_interp_'](l[0], h) + l[1]) for l in
zip(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'])])[1:15]
if total_gas_data[0][0] < 0.1:
total_gas_data = total_gas_data[1:]
# print total_gas_data
plot_1f_vs_2f(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plt.plot([-1, -2], [-1, -2], '-', color=color, label=name+' '+phot[3])
plt.plot([0., 1.], [0., 1.], '--', alpha=0.1)
plt.legend(loc='lower right')
plt.xlim(0, 1.)
plt.ylim(0, 1.)
plt.ylabel(r'$Q_{eff}^{-1}$', fontsize=20)
plt.xlabel(r'$Q_g^{-1}$', fontsize=20)
plt.show()
Только молек
In [82]:
kenn_photom={'n338' : ['mu0d_Ic', 'h_disc_I', 6.23, 'I', 60.],
'n1167' : ['mu0d_Rc', 'h_disc_R', 5.53, 'R', 40.],
'n2985' : ['mudK', 'hK', 1.42, 'K', 70.],
'n3898' : ['mu0d_R', 'h_disc_R', 7.80, 'R', 80.],
'n4258' : ['mu0d_I', 'h_disc_I', 0.82, 'I', 150.],
'n4725' : ['mu0d_H', 'h_disc_H', 0.68, 'H', 55.],
'n5533' : ['MU0_r', 'hi_r', 4.41, 'r', 100.]}
fig = plt.figure(figsize=[8, 8])
for ind, name in enumerate(['n2985', 'n4258', 'n4725']):
ax = plt.gca()
color = cm.rainbow(np.linspace(0, 1, 7))[ind]
phot = kenn_photom[name]
mud = locals()[name+'dict'][phot[0]]
h = locals()[name+'dict'][phot[1]]
# print name
# print mud
# print h
if name in ['n4258', 'n4725']:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], map(lambda l: l[0], zip(locals()[name+'dict']['gas_dens'])))[1:15]
elif name == 'n2985':
total_gas_data=locals()[name+'dict']['total_gas_data_']
else:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], [He_coeff*(locals()[name+'dict']['y_interp_'](l[0], h) + l[1]) for l in
zip(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'])])[1:15]
if total_gas_data[0][0] < 0.1:
total_gas_data = total_gas_data[1:]
# print total_gas_data
plot_1f_vs_2f(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plt.plot([-1, -2], [-1, -2], '-', color=color, label=name+' '+phot[3])
plt.plot([0., 1.], [0., 1.], '--', alpha=0.1)
plt.legend(loc='lower right')
plt.xlim(0, 1.)
plt.ylim(0, 1.)
plt.ylabel(r'$Q_{eff}^{-1}$', fontsize=20)
plt.xlabel(r'$Q_g^{-1}$', fontsize=20)
plt.show()
Верхнее и нижнее значения:
In [83]:
def plot_1f_vs_2f_full(ax=None, total_gas_data=None, epicycl=None, gas_approx=None, sound_vel=None, scale=None, sigma_max=None, sigma_min=None, star_density_max=None,
star_density_min=None, data_lim=None, color=None, alpha=0.3, disk_scales=[], label=None, sfrange=None):
invQg, invQs, invQeff_min = zip(*get_invQeff_from_data(gas_data=total_gas_data,
epicycl=epicycl,
gas_approx=gas_approx,
sound_vel=sound_vel,
scale=scale,
sigma=sigma_max,
star_density=star_density_min))
invQg, invQs, invQeff_max = zip(*get_invQeff_from_data(gas_data=total_gas_data,
epicycl=epicycl,
gas_approx=gas_approx,
sound_vel=sound_vel,
scale=scale,
sigma=sigma_min,
star_density=star_density_max))
rr = zip(*total_gas_data)[0]
ax.plot(invQg, invQeff_min, 'o', color=color, alpha=0.8)
ax.plot(invQg, invQeff_max, '*', color=color, alpha=0.8)
In [84]:
kenn_photom={'n338' : ['mu0d_Ic', 'h_disc_I', 6.23, 'I', 60.],
'n1167' : ['mu0d_Rc', 'h_disc_R', 5.53, 'R', 40.],
'n2985' : ['mudK', 'hK', 1.42, 'K', 70.],
'n3898' : ['mu0d_R', 'h_disc_R', 7.80, 'R', 80.],
'n4258' : ['mu0d_I', 'h_disc_I', 0.82, 'I', 150.],
'n4725' : ['mu0d_H', 'h_disc_H', 0.68, 'H', 55.],
'n5533' : ['MU0_r', 'hi_r', 4.41, 'r', 100.]}
fig = plt.figure(figsize=[8, 8])
for ind, name in enumerate(['n338', 'n1167', 'n2985', 'n3898', 'n4258', 'n4725', 'n5533']):
ax = plt.gca()
color = cm.rainbow(np.linspace(0, 1, 7))[ind]
phot = kenn_photom[name]
mud = locals()[name+'dict'][phot[0]]
h = locals()[name+'dict'][phot[1]]
# print name
# print mud
# print h
if name in ['n4258', 'n4725']:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], map(lambda l: l[0], zip(locals()[name+'dict']['gas_dens'])))[1:15]
elif name == 'n2985':
total_gas_data=locals()[name+'dict']['total_gas_data_']
else:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], [He_coeff*(locals()[name+'dict']['y_interp_'](l[0], h) + l[1]) for l in
zip(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'])])[1:15]
if total_gas_data[0][0] < 0.1:
total_gas_data = total_gas_data[1:]
# print total_gas_data
plot_1f_vs_2f_full(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plt.plot([-1, -2], [-1, -2], '-', color=color, label=name+' '+phot[3])
plt.plot([0., 1.], [0., 1.], '--', alpha=0.1)
plt.legend(loc='lower right')
plt.xlim(0, 1.)
plt.ylim(0, 1.)
plt.ylabel(r'$Q_{eff}^{-1}$', fontsize=20)
plt.xlabel(r'$Q_g^{-1}$', fontsize=20)
plt.show()
Только молек
In [85]:
kenn_photom={'n338' : ['mu0d_Ic', 'h_disc_I', 6.23, 'I', 60.],
'n1167' : ['mu0d_Rc', 'h_disc_R', 5.53, 'R', 40.],
'n2985' : ['mudK', 'hK', 1.42, 'K', 70.],
'n3898' : ['mu0d_R', 'h_disc_R', 7.80, 'R', 80.],
'n4258' : ['mu0d_I', 'h_disc_I', 0.82, 'I', 150.],
'n4725' : ['mu0d_H', 'h_disc_H', 0.68, 'H', 55.],
'n5533' : ['MU0_r', 'hi_r', 4.41, 'r', 100.]}
fig = plt.figure(figsize=[8, 8])
for ind, name in enumerate(['n2985', 'n4258', 'n4725']):
ax = plt.gca()
color = cm.rainbow(np.linspace(0, 1, 7))[ind]
phot = kenn_photom[name]
mud = locals()[name+'dict'][phot[0]]
h = locals()[name+'dict'][phot[1]]
# print name
# print mud
# print h
if name in ['n4258', 'n4725']:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], map(lambda l: l[0], zip(locals()[name+'dict']['gas_dens'])))[1:15]
elif name == 'n2985':
total_gas_data=locals()[name+'dict']['total_gas_data_']
else:
total_gas_data=zip(locals()[name+'dict']['r_g_dens'], [He_coeff*(locals()[name+'dict']['y_interp_'](l[0], h) + l[1]) for l in
zip(locals()[name+'dict']['r_g_dens'], locals()[name+'dict']['gas_dens'])])[1:15]
if total_gas_data[0][0] < 0.1:
total_gas_data = total_gas_data[1:]
# print total_gas_data
plot_1f_vs_2f_full(ax=ax, total_gas_data=total_gas_data,
epicycl=locals()[name+'dict']['epicyclicFreq_real'],
gas_approx=locals()[name+'dict']['spl_gas'],
sound_vel=locals()[name+'dict']['sound_vel'],
scale=locals()[name+'dict']['scale'],
sigma_max=locals()[name+'dict']['sig_R_maj_max'],
sigma_min=locals()[name+'dict']['sig_R_maj_min'],
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mud, h=h), M_to_L=phot[2], band=phot[3]),
data_lim=locals()[name+'dict']['data_lim'],
color=color, alpha=0.2,
label=name+' '+phot[3],
sfrange=phot[4])
plt.plot([-1, -2], [-1, -2], '-', color=color, label=name+' '+phot[3])
plt.plot([0., 1.], [0., 1.], '--', alpha=0.1)
plt.legend(loc='lower right')
plt.xlim(0, 1.)
plt.ylim(0, 1.)
plt.ylabel(r'$Q_{eff}^{-1}$', fontsize=20)
plt.xlabel(r'$Q_g^{-1}$', fontsize=20)
plt.show()
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [48]:
print locals()[name+'dict']['total_gas_data_']
print locals()[name+'dict']['epicyclicFreq_real']
print locals()[name+'dict']['spl_gas'](15.)
print locals()[name+'dict']['sound_vel']
print locals()[name+'dict']['scale']
print locals()[name+'dict']['sig_R_maj_max'](15.)
print locals()[name+'dict']['sig_R_maj_min'](15.)
print surf_density(mu=mu_disc(15., mu0=locals()[name+'dict']['mudK'], h=locals()[name+'dict']['hK']), M_to_L=1.42, band='K')
print surf_density(mu=mu_disc(15., mu0=locals()[name+'dict']['mudK'], h=locals()[name+'dict']['hK']), M_to_L=1.42, band='K')
print locals()[name+'dict']['data_lim']
print locals()[name+'dict']['disk_scales']
In [ ]:
In [ ]:
In [49]:
# 338
plot_2f_vs_1f(ax=axes[4], total_gas_data=zip(r_g_dens, [He_coeff*(y_interp_(l[0], h_disc_I) + l[1]) for l in zip(r_g_dens, gas_dens)])[1:],
epicycl=epicyclicFreq_real_,
gas_approx=spl_gas,
sound_vel=sound_vel,
scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: surf_density(mu_disc(l, mu0=mu0d_Ic, h=h_disc_I), 6.23, 'I'),
star_density_min=lambda l: surf_density(mu_disc(l, mu0=mu0d_Ic, h=h_disc_I), 6.23, 'I'),
data_lim=data_lim, color='g', alpha=0.3, disk_scales=disk_scales, label='I maxdisc')
plot_2f_vs_1f(ax=axes[4], total_gas_data=zip(r_g_dens, [He_coeff*(y_interp_(l[0], h_disc_B) + l[1]) for l in zip(r_g_dens, gas_dens)])[1:],
epicycl=epicyclicFreq_real_,
gas_approx=spl_gas,
sound_vel=sound_vel,
scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: surf_density(mu_disc(l, mu0=mu0d_Bc, h=h_disc_B), 6.99, 'B'),
star_density_min=lambda l: surf_density(mu_disc(l, mu0=mu0d_Bc, h=h_disc_B), 6.99, 'B'),
data_lim=data_lim, color='y', alpha=0.2, disk_scales=disk_scales, label='B submaxdisc')
# 1167
plot_2f_vs_1f(ax=axes[4], total_gas_data=zip(r_g_dens, [He_coeff*(y_interp_(l[0], h_disc_R) + l[1]) for l in zip(r_g_dens, gas_dens)])[1:],
epicycl=epicyclicFreq_real,
gas_approx=spl_gas,
sound_vel=sound_vel,
scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: surf_density(mu_disc(l, mu0=mu0d_Rc, h=h_disc_R), 5.53, 'R'),
star_density_min=lambda l: surf_density(mu_disc(l, mu0=mu0d_Rc, h=h_disc_R), 5.53, 'R'),
data_lim=data_lim, color='g', alpha=0.3, disk_scales=disk_scales, label='R maxdisc')
# 2985
plot_2f_vs_1f(ax=ax, total_gas_data=total_gas_data_,
epicycl=epicyclicFreq_real,
gas_approx=spl_gas,
sound_vel=sound_vel,
scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mudK, h=hK), M_to_L=1.42, band='K'),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mudK, h=hK), M_to_L=1.42, band='K'),
data_lim=data_lim, color='g', alpha=0.2, disk_scales=disk_scales2, label='K Heidt maxdisc')
plot_2f_vs_1f(ax=ax, total_gas_data=total_gas_data_,
epicycl=epicyclicFreq_real,
gas_approx=spl_gas,
sound_vel=sound_vel,
scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: tot_dens((lambda l1: s4g_surf_density(mu_disc(l1, mu0=mu0d_s4g, h=h_disc_s4g), 1.35),
lambda l2: s4g_surf_density(mu_disc(l2, mu0=mu0d_s4g_2, h=h_disc_s4g_2), 1.35)))(l),
star_density_min=lambda l: tot_dens((lambda l1: s4g_surf_density(mu_disc(l1, mu0=mu0d_s4g, h=h_disc_s4g), 1.35),
lambda l2: s4g_surf_density(mu_disc(l2, mu0=mu0d_s4g_2, h=h_disc_s4g_2), 1.35)))(l),
data_lim=data_lim, color='y', alpha=0.2, disk_scales=disk_scales2, label='S4G 2d maxdisc')
#3898
plot_2f_vs_1f(ax=axes[4], total_gas_data=zip(r_g_dens, [He_coeff*(y_interp_(l[0], h_disc_R) + l[1]) for l in zip(r_g_dens, gas_dens)])[1:7],
epicycl=epicyclicFreq_real,
gas_approx=spl_gas, sound_vel=sound_vel, scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: surf_density(mu_disc(l, mu0=mu0d_R, h=h_disc_R), 7.80, 'R'),
star_density_min=lambda l: surf_density(mu_disc(l, mu0=mu0d_R, h=h_disc_R), 7.80, 'R'),
data_lim=data_lim, color='g', alpha=0.3, disk_scales=disk_scales, label='R Noord maxdisc')
plot_2f_vs_1f(ax=axes[4], total_gas_data=zip(r_g_dens, [He_coeff*(y_interp_(l[0], h_approx) + l[1]) for l in zip(r_g_dens, gas_dens)])[1:7],
epicycl=epicyclicFreq_real,
gas_approx=spl_gas, sound_vel=sound_vel, scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: tot_dens((lambda l1: surf_density(mu=mu_disc(l1, mu0=inner_approx[0], h=h_approx), M_to_L=2.93, band='R'),
lambda l2: surf_density(mu=mu_disc(l2, mu0=mu0_out, h=h_out), M_to_L=2.93, band='R')))(l),
star_density_min=lambda l: tot_dens((lambda l1: surf_density(mu=mu_disc(l1, mu0=inner_approx[0], h=h_approx), M_to_L=2.93, band='R'),
lambda l2: surf_density(mu=mu_disc(l2, mu0=mu0_out, h=h_out), M_to_L=2.93, band='R')))(l),
data_lim=data_lim, color='m', alpha=0.2, disk_scales=disk_scales, label='R Gutierrez 2d maxdisc')
#4258
plot_2f_vs_1f(ax=axes[4], total_gas_data=zip(r_g_dens, map(lambda l: l, gas_dens))[:15], epicycl=epicyclicFreq_real,
gas_approx=spl_gas, sound_vel=sound_vel, scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mu0d_I, h=h_disc_I), M_to_L=0.82, band='I'),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mu0d_I, h=h_disc_I), M_to_L=0.82, band='I'),
data_lim=data_lim, color='g', alpha=0.2, disk_scales=disk_scales, label='I Yoshino maxdisc')
plot_2f_vs_1f(ax=axes[4], total_gas_data=zip(r_g_dens, map(lambda l: l, gas_dens))[:15], epicycl=epicyclicFreq_real,
gas_approx=spl_gas, sound_vel=sound_vel, scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: s4g_surf_density(mu_disc(l, mu0=mu0d_36, h=h_disc_36), M_to_L=0.38),
star_density_min=lambda l: s4g_surf_density(mu_disc(l, mu0=mu0d_36, h=h_disc_36), M_to_L=0.38),
data_lim=data_lim, color='m', alpha=0.2, disk_scales=disk_scales, label='SPITZER 3.6 maxdisc')
# 4725
plot_2f_vs_1f(ax=axes[4], total_gas_data=zip(r_g_dens, map(lambda l: l, gas_dens))[:15], epicycl=epicyclicFreq_real,
gas_approx=spl_gas, sound_vel=sound_vel, scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mu0d_H, h=h_disc_H), M_to_L=0.68, band='H'),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mu0d_H, h=h_disc_H), M_to_L=0.68, band='H'),
data_lim=data_lim, color='y', alpha=0.3, disk_scales=disk_scales, label='H Heidt maxdisc')
plot_2f_vs_1f(ax=axes[4], total_gas_data=zip(r_g_dens, map(lambda l: l, gas_dens))[:15], epicycl=epicyclicFreq_real,
gas_approx=spl_gas, sound_vel=sound_vel, scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: s4g_surf_density(mu_disc(l, mu0=mu0d_s4g, h=h_disc_s4g), 1.61),
star_density_min=lambda l: s4g_surf_density(mu_disc(l, mu0=mu0d_s4g, h=h_disc_s4g), 1.61),
data_lim=data_lim, color='g', alpha=0.2, disk_scales=disk_scales, label='S4G maxdisc')
# SF 55/100/175
# 5533
#change this
total_gas_data_ = zip(r_g_dens, [He_coeff*(y_interp_(l[0], hi_r) + l[1]) for l in zip(r_g_dens, gas_dens)])[1:10]
total_gas_data_2 = zip(r_g_dens, [He_coeff*(y_interp_2(l[0], hi_r) + l[1]) for l in zip(r_g_dens, gas_dens)])[1:10]
plot_2f_vs_1f(ax=axes[4], total_gas_data=total_gas_data_,
epicycl=epicyclicFreq_real,
gas_approx=spl_gas,
sound_vel=sound_vel,
scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=MU0_r, h=hi_r), M_to_L=4.41, band='r'),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=MU0_r, h=hi_r), M_to_L=4.41, band='r'),
data_lim=data_lim, color='g', alpha=0.2, disk_scales=disk_scales, label='r(g-i) maxdisc')
total_gas_data_ = zip(r_g_dens, [He_coeff*(y_interp_(l[0], h_disc_R) + l[1]) for l in zip(r_g_dens, gas_dens)])[1:10]
total_gas_data_2 = zip(r_g_dens, [He_coeff*(y_interp_2(l[0], h_disc_R) + l[1]) for l in zip(r_g_dens, gas_dens)])[1:10]
plot_2f_vs_1f(ax=axes[4], total_gas_data=total_gas_data_2,
epicycl=epicyclicFreq_real,
gas_approx=spl_gas,
sound_vel=sound_vel,
scale=scale,
sigma_max=sig_R_maj_max,
sigma_min=sig_R_maj_min,
star_density_max=lambda l: surf_density(mu=mu_disc(l, mu0=mu0d_Rc, h=h_disc_R), M_to_L=7.15, band='R'),
star_density_min=lambda l: surf_density(mu=mu_disc(l, mu0=mu0d_Rc, h=h_disc_R), M_to_L=7.15, band='R'),
data_lim=data_lim, color='r', alpha=0.2, disk_scales=disk_scales, label='R Noord maxdisc 2')
In [ ]: