In [1]:
%matplotlib inline
from pylab import polyfit
%run /home/ccadiou/rc_loader.py
from matplotlib.colors import LogNorm
FGM = dict()
kR = dict()
kZ = dict()


ERROR: File `u'/home/ccadiou/rc_loader.py'` not found.

In [4]:
for B in ["0", "4", "10", "100"]:

    f = open("results/MRI_B"+B+"FGM")
    FGM[B] = np.array([ [ float(e) for e in line.split() ] for line in f.readlines() ])
    #FGM_masked[B] = np.ma.masked_less_equal(FGM/2.7e-6, 0)
    f = open("results/MRI_B"+B+"kR")
    kR[B] = np.array([ [ float(e) for e in line.split() ] for line in f.readlines() ])
    f = open("results/MRI_B"+B+"kZ")
    kZ[B] = np.array([ [ float(e) for e in line.split() ] for line in f.readlines() ])

n = 100
omega = np.fromfunction(lambda _, x : 30*(x+1)/n, (n, n))
dlogomegadlogr = np.fromfunction(lambda x, _ : -20*(x+1)/n, (n, n))

In [6]:
for B in ["0", "4", "10", "100"]:
    plt.rcParams.update(get_param("column", "normal"))
    plt.figure()

    plt.imshow(FGM[B]/omega, extent=(0, 30, -20, 0), interpolation='none', aspect='auto')
    plt.colorbar()
    plt.xlabel("$\Omega/\Omega_\star$")
    plt.ylabel("$\partial\log\Omega/\partial\log r$")
    plt.title("FGM [$\Omega_\odot$]")

    plt.savefig("/home/ccadiou/pfs/simulations/current/figs/MRI_FGM_B"+B+".eps")


[3.352013283520133, 2.0716581399565803]
[3.352013283520133, 2.0716581399565803]
[3.352013283520133, 2.0716581399565803]
[3.352013283520133, 2.0716581399565803]

In [8]:
for B in ["0", "4", "10", "100"]:
    plt.rcParams.update(get_param("column", "normal"))
    plt.figure()

    Rsun = 6.96e10
    OmegaSun = 2.7e-6
    plt.imshow(FGM[B]/(kR[B]*kR[B])*(OmegaSun*Rsun**2), extent=(0, 30, -20, 0), interpolation='none', aspect='auto',
                norm=LogNorm(vmax=1e16))
    cb = plt.colorbar()
    plt.xlabel("$\Omega$ [$\Omega_\odot$]")
    plt.ylabel("$\partial\log\Omega/\partial\log r$")
    cb.set_label("$\sigma/k_R^2$ [$\mathrm{cm}^2.\mathrm{s}^{-1}$]")

    plt.savefig("/home/ccadiou/pfs/simulations/current/figs/MRI_diff_coeff_B"+B+".eps")


[3.352013283520133, 2.0716581399565803]
[3.352013283520133, 2.0716581399565803]
[3.352013283520133, 2.0716581399565803]
[3.352013283520133, 2.0716581399565803]

In [41]:
plt.rcParams.update(get_param("text", 0.3))

fig, axes = plt.subplots(nrows=2, ncols=2)
(ax11, ax12, ax21, ax22) = axes.flat
B = "0"
ax11 = plt.subplot(221)
ax11.imshow(FGM[B]/(kR[B]*kR[B])*(OmegaSun*Rsun**2), extent=(0, 30, -20, 0), interpolation='none', aspect='auto',
            norm=LogNorm(vmin=1e10, vmax=1e16))
ax11.tick_params(
    axis='x',          # changes apply to the x-axis
    which='both',      # both major and minor ticks are affected
    bottom='off',      # ticks along the bottom edge are off
    top='off',         # ticks along the top edge are off
    labelbottom='off') # labels along the bottom edge are offax12.tick_params(bottom='off')
ax11.set_ylabel("$\partial\log\Omega/\partial\log r$")

B = "4"
ax12 = plt.subplot(222)
ax12.imshow(FGM[B]/(kR[B]*kR[B])*(OmegaSun*Rsun**2), extent=(0, 30, -20, 0), interpolation='none', aspect='auto',
            norm=LogNorm(vmin=1e10, vmax=1e16))
ax12.tick_params(
    axis='x',          # changes apply to the x-axis
    which='both',      # both major and minor ticks are affected
    bottom='off',      # ticks along the bottom edge are off
    top='off',         # ticks along the top edge are off
    labelbottom='off') # labels along the bottom edge are offax12.tick_params(bottom='off')
ax12.tick_params(
    axis='y',          # changes apply to the x-axis
    which='both',      # both major and minor ticks are affected
    right='off',      # ticks along the bottom edge are off
    left='off',         # ticks along the top edge are off
    labelleft='off') # labels along the bottom edge are offax12.tick_params(bottom='off')

B = "10"
ax21 = plt.subplot(223)
ax21.imshow(FGM[B]/(kR[B]*kR[B])*(OmegaSun*Rsun**2), extent=(0, 30, -20, 0), interpolation='none', aspect='auto',
            norm=LogNorm(vmin=1e10, vmax=1e16))
ax21.tick_params(bottom='off', right='off')
ax21.set_xlabel("$\Omega$ [$\Omega_\odot$]")
ax21.set_ylabel("$\partial\log\Omega/\partial\log r$")

B = "100"
ax22 = plt.subplot(224)
im = ax22.imshow(FGM[B]/(kR[B]*kR[B])*(OmegaSun*Rsun**2), extent=(0, 30, -20, 0), interpolation='none', aspect='auto',
            norm=LogNorm(vmin=1e8, vmax=1e16))
ax22.tick_params(
    axis='y',          # changes apply to the x-axis
    which='both',      # both major and minor ticks are affected
    right='off',      # ticks along the bottom edge are off
    left='off',         # ticks along the top edge are off
    labelleft='off') # labels along the bottom edge are offax12.tick_params(bottom='off')
ax22.set_xlabel("$\Omega$ [$\Omega_\odot$]")

fig.subplots_adjust(wspace=0, hspace=0, right=0.85, bottom=0.2, left=0.1)
cbar_ax = fig.add_axes([0.87, 0.2, 0.02, 0.7])
cb = fig.colorbar(im, cax=cbar_ax)
cb.set_label("$\sigma/k_R^2$ [$cm^2/s$]")

#plt.tight_layout()

plt.savefig("/home/ccadiou/pfs/simulations/current/figs/MRI_multiple_B_diff_coeff.eps")


[6.8749135187491355, 2.0624740556247407]

In [31]:


In [ ]: