Beispiel #1
0
def plotGraph():
    fig = plt.figure()
    ### Plotting arrangements ###
    xlabel(r'$r\quad[\mathrm{pc}]$')
    #ylabel(r'$M\quad[\mathrm{M}_{\odot}]$') #[10^5 M_{\odot}]')
    #ylabel(r'$\rho\quad[\mathrm{M}_{\odot}/\mathrm{pc}^3]$') #[10^5 M_{\odot}]')
    ylabel(r'$\beta$')
    fill_between(radsc, M95lo[sel]*Msc, M95hi[sel]*Msc,\
                 color='black',alpha=0.2,lw=1)
    fill_between(radsc, M68lo[sel]*Msc, M68hi[sel]*Msc,\
                 color='black',alpha=0.4,lw=1)
    plot(radsc,Mmedi[sel]*Msc,'r',lw=2)
    # theoretical model
    #plot(rsc*radii[sel],Msc*Mwalkertot(radii)[sel],'--',color='black',lw=2)
    #plot(rsc*radii[sel],Msc*rhowalktot_3D(radii)[sel],'--',color='black',lw=2)
    #plot(rsc*radii[sel],Msc*rhotriax(radii)[sel],'--',color='black',lw=2)
    plot(rsc*radii[sel],Msc*betatriax(radii)[sel],'--',color='black',lw=2)

    axvline(x=1500., color='green', visible=True)
    axvline(x=1500.*0.8, color='green', visible=True)
    axvline(x=1500.*0.6, color='green', visible=True)
    axvline(x=810., color='blue', visible=True)

    # xscale('log'); yscale('log'); ylim([0.005,1.5])
    xlim([100.,1200.])
    ylim([-0.15,0.9])
    return fig
Beispiel #2
0
ion()
plot1 = plotGraph()
# pp = PdfPages(basename + '.profdens.pdf')
pp = PdfPages(basename + '.profdelta1.pdf')
pp.savefig(plot1)

# We can also set the file's metadata via the PdfPages object:
d = pp.infodict()
d['Title'] = 'Multipage PDF'
d['Author'] = u'Pascal Steger'
d['Subject'] = 'dwarf spheroidal dark matter density profile'
d['Keywords'] = 'PdfPages multipage keywords author title subject'
d['CreationDate'] = datetime.datetime(2013,05,06)
d['ModDate'] = datetime.datetime.today()
pp.close()
ioff()

save_profile(basename,'delta1',M95lo,M68lo,Mmedi,M68hi,M95hi)

#analyt = M_anf(radii)
analyt = betatriax(radii)

print('# radii  lower 95%    lower 68%   median      upper 68%   upper 95%   analytic')
for i in range(len(radii)):
    print(radii[i],M95lo[i],M68lo[i],Mmedi[i],M68hi[i],M95hi[i],analyt[i])


show_plots()