fig = plt.figure(1,figsize=(7.0,12.0))
    
    # First map
    ax1 = fig.add_axes([0.10,0.77,0.77,0.22])
    divider = make_axes_locatable(ax1)
    cax = divider.append_axes("right", size="3%", pad=0.08)
    
    fluximage = ImageData()
    fluximage.data = fluxj_adv_stacked.T
    fluximage.pixelx = grid.R.shape[0]
    fluximage.pixely = grid.phi.shape[0]
    
    minval, maxval = -4, 4
    extent = [Rmin,Rmax,0,2*np.pi]
    cmap = cm.get_cmap('jet')
    ax, im = plot_slice(ax1,fluximage,cmap = cmap, 
                        vmin=minval,vmax=maxval,extent=extent,scale='linear')
    cbar = plt.colorbar(im,cax=cax)
    cbar.set_label(r'$F_{J,{\rm adv}}\,/(\dot{M}_0a_{\rm b}\Omega_{\rm b})$',size=20)

    ax1.set_xticklabels([])
    ticks = [0,np.pi/2,np.pi,1.5 * np.pi, 2 * np.pi ]
    ax1.set_yticks(ticks)
    ticklabels = [r'$0$',r'$\frac{1}{2}\pi$',r'$\pi$',r'$\frac{3}{2}\pi$',r'$\pi$']
    ax1.set_yticklabels(ticklabels)
    [tick.label.set_fontsize(16) for tick in ax1.yaxis.get_major_ticks()]
    ax1.set_aspect('auto')

    ax1.text(0.45,0.88,"inward angular momentum flux due to",transform = ax1.transAxes)
    ax1.text(0.45,0.78,"                     advection",transform = ax1.transAxes,size=16)
    
    # Second map
    densityimage = ImageData()
    densityimage.data = density_average.T
    densityimage.pixelx = grid.X.shape[0]
    densityimage.pixely = grid.Y.shape[0]

    # ... and plot it   
    fig = plt.figure()
    fig.subplots_adjust(top=0.97,right=0.88,bottom=0.12,left=0.10)
    ax = fig.add_subplot(111)
    divider = make_axes_locatable(ax)
    cax = divider.append_axes("right", size="5%", pad=0.08)

    
    minval,maxval = 10**(-4.9),10**(0.25)
    extent = [74.0,86.0,74.0,86.0]
    ax, im = plot_slice(ax,densityimage,normalize=6.0e-4,vmin=minval,vmax=maxval,extent=extent,scale='log')
    ax.set_xlabel(r'$x/a_{\rm b}$',size=22)
    ax.set_ylabel(r'$y/a_{\rm b}$',size=22)
    ax.set_aspect('equal')

    
    ticklabels = ["%i" % (t - 0.5 * snap.header.boxsize)  for t in ax.get_xticks()]
    ax.set_xticklabels(ticklabels)
    ticklabels = ["%i" % (t - 0.5 * snap.header.boxsize)  for t in ax.get_yticks()]
    ax.set_yticklabels(ticklabels)

    cbar = plt.colorbar(im,cax=cax)
    cbar.set_label(r'$\Sigma/\Sigma_{\rm out}$',size=20)

    figfilename = './density_field_averaged.png'
    print "Saving figure",figfilename
Ejemplo n.º 3
0
    ax1 = fig.add_axes([0.10, 0.77, 0.77, 0.22])
    divider = make_axes_locatable(ax1)
    cax = divider.append_axes("right", size="3%", pad=0.08)

    fluximage = ImageData()
    fluximage.data = fluxj_adv_stacked.T
    fluximage.pixelx = grid.R.shape[0]
    fluximage.pixely = grid.phi.shape[0]

    minval, maxval = -4, 4
    extent = [Rmin, Rmax, 0, 2 * np.pi]
    cmap = cm.get_cmap('jet')
    ax, im = plot_slice(ax1,
                        fluximage,
                        cmap=cmap,
                        vmin=minval,
                        vmax=maxval,
                        extent=extent,
                        scale='linear')
    cbar = plt.colorbar(im, cax=cax)
    cbar.set_label(r'$F_{J,{\rm adv}}\,/(\dot{M}_0a_{\rm b}\Omega_{\rm b})$',
                   size=20)

    ax1.set_xticklabels([])
    ticks = [0, np.pi / 2, np.pi, 1.5 * np.pi, 2 * np.pi]
    ax1.set_yticks(ticks)
    ticklabels = [
        r'$0$', r'$\frac{1}{2}\pi$', r'$\pi$', r'$\frac{3}{2}\pi$', r'$\pi$'
    ]
    ax1.set_yticklabels(ticklabels)
    [tick.label.set_fontsize(16) for tick in ax1.yaxis.get_major_ticks()]
    fig = plt.figure(2, figsize=(12.0, 5.5))
    fig.subplots_adjust(top=0.98, bottom=0.12, left=0.07, right=0.92)

    image = ImageData()
    image.read('../data/density_field_close_000')
    image.interpolateneg()
    image.replaceneg()

    #ax = fig.add_subplot(121)
    ax = fig.add_axes([-0.17, 0.13, 0.85, 0.85])
    minval, maxval = 10**(-4.12), 10**(1.03)
    extent = [77.5, 82.5, 77.5, 82.5]
    ax, im = plot_slice(ax,
                        image,
                        normalize=Sigma_out,
                        vmin=minval,
                        vmax=maxval,
                        extent=extent,
                        scale='log')
    ax.set_xlabel(r'$x/a_{\rm b}$', size=22)
    ax.set_ylabel(r'$y/a_{\rm b}$', size=22)
    ax.set_aspect('equal')

    ticklabels = [
        "%i" % (t - 0.5 * snap.header.boxsize) for t in ax.get_xticks()
    ]
    ax.set_xticklabels(ticklabels)
    ticklabels = [
        "%i" % (t - 0.5 * snap.header.boxsize) for t in ax.get_yticks()
    ]
    ax.set_yticklabels(ticklabels)
Ejemplo n.º 5
0
    fig = plt.figure(2, figsize=(12.0, 5.5))
    fig.subplots_adjust(top=0.98, bottom=0.12, left=0.07, right=0.92)

    image = ImageData()
    image.read(snap_path + 'density_field_%03i' % snap_num)
    image.interpolateneg()
    image.replaceneg()

    ax = fig.add_subplot(111)
    minval, maxval = 10**(-4.12), 10**(1.03)
    extent = [77.5, 82.5, 77.5, 82.5]
    ax, im = plot_slice(ax,
                        image,
                        normalize=Sigma_out,
                        vmin=minval,
                        vmax=maxval,
                        extent=extent,
                        scale='log')
    ax.set_xlabel(r'$x/a_{\rm b}$', size=22)
    ax.set_ylabel(r'$y/a_{\rm b}$', size=22)
    ax.set_aspect('equal')

    ticklabels = [
        "%i" % (t - 0.5 * snap.header.boxsize) for t in ax.get_xticks()
    ]
    ax.set_xticklabels(ticklabels)
    ticklabels = [
        "%i" % (t - 0.5 * snap.header.boxsize) for t in ax.get_yticks()
    ]
    ax.set_yticklabels(ticklabels)
Ejemplo n.º 6
0
    snap_num = int(sys.argv[4])
    
    snap_path = simset.find_simulation(qb,eb,h0,alpha,eta)

    fig = plt.figure(2,figsize = (12.0,5.5))
    fig.subplots_adjust(top=0.98,bottom=0.12,left=0.07,right=0.92)
    
    image = ImageData()
    image.read(snap_path+'density_field_%03i' % snap_num)
    image.interpolateneg()
    image.replaceneg()

    ax = fig.add_subplot(111)
    minval,maxval = 10**(-4.12),10**(1.03)
    extent = [77.5,82.5,77.5,82.5]
    ax,im = plot_slice(ax,image,normalize=Sigma_out,
                       vmin=minval,vmax=maxval,extent=extent,scale='log')
    ax.set_xlabel(r'$x/a_{\rm b}$',size=22)
    ax.set_ylabel(r'$y/a_{\rm b}$',size=22)
    ax.set_aspect('equal')


    ticklabels = ["%i" % (t - 0.5 * snap.header.boxsize)  for t in ax.get_xticks()]
    ax.set_xticklabels(ticklabels)
    ticklabels = ["%i" % (t - 0.5 * snap.header.boxsize)  for t in ax.get_yticks()]
    ax.set_yticklabels(ticklabels)

    cbar = plt.colorbar(im,cax=cax)
    cbar.set_label(r'$\Sigma/\Sigma_{\rm out}$',size=20)

    
    fig.savefig('./density_field.png')
Ejemplo n.º 7
0
    densityimage.pixelx = grid.X.shape[0]
    densityimage.pixely = grid.Y.shape[0]

    # ... and plot it
    fig = plt.figure()
    fig.subplots_adjust(top=0.97, right=0.88, bottom=0.12, left=0.10)
    ax = fig.add_subplot(111)
    divider = make_axes_locatable(ax)
    cax = divider.append_axes("right", size="5%", pad=0.08)

    minval, maxval = 10**(-4.9), 10**(0.25)
    extent = [74.0, 86.0, 74.0, 86.0]
    ax, im = plot_slice(ax,
                        densityimage,
                        normalize=6.0e-4,
                        vmin=minval,
                        vmax=maxval,
                        extent=extent,
                        scale='log')
    ax.set_xlabel(r'$x/a_{\rm b}$', size=22)
    ax.set_ylabel(r'$y/a_{\rm b}$', size=22)
    ax.set_aspect('equal')

    ticklabels = [
        "%i" % (t - 0.5 * snap.header.boxsize) for t in ax.get_xticks()
    ]
    ax.set_xticklabels(ticklabels)
    ticklabels = [
        "%i" % (t - 0.5 * snap.header.boxsize) for t in ax.get_yticks()
    ]
    ax.set_yticklabels(ticklabels)
    from disk_data_analysis.plotting import plot_slice, ImageData
    import matplotlib.cm as cm
    
    fig = plt.figure(2,figsize = (12.0,5.5))
    fig.subplots_adjust(top=0.98,bottom=0.12,left=0.07,right=0.92)
    
    image = ImageData()
    image.read('../data/density_field_close_000')
    image.interpolateneg()
    image.replaceneg()
    
    #ax = fig.add_subplot(121)
    ax = fig.add_axes([-0.17,0.13,0.85,0.85])
    minval,maxval = 10**(-4.12),10**(1.03)
    extent = [77.5,82.5,77.5,82.5]
    ax,im = plot_slice(ax,image,normalize=Sigma_out,
                       vmin=minval,vmax=maxval,extent=extent,scale='log')
    ax.set_xlabel(r'$x/a_{\rm b}$',size=22)
    ax.set_ylabel(r'$y/a_{\rm b}$',size=22)
    ax.set_aspect('equal')


    ticklabels = ["%i" % (t - 0.5 * snap.header.boxsize)  for t in ax.get_xticks()]
    ax.set_xticklabels(ticklabels)
    ticklabels = ["%i" % (t - 0.5 * snap.header.boxsize)  for t in ax.get_yticks()]
    ax.set_yticklabels(ticklabels)
    

    image = ImageData()
    image.read('../data/density_field_000')
    image.interpolateneg()
    image.replaceneg()