mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 23:31:12 +00:00
plot fixes in xcor
This commit is contained in:
parent
37462dd37e
commit
3fa193958b
2 changed files with 11 additions and 7 deletions
|
@ -344,8 +344,7 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True,
|
||||||
eigenVecs = np.zeros((3,3)),
|
eigenVecs = np.zeros((3,3)),
|
||||||
))
|
))
|
||||||
|
|
||||||
catalog.numVoids = len(catalog.voids)
|
print "Read %d voids" % len(catalog.voids)
|
||||||
print "Read %d voids" % catalog.numVoids
|
|
||||||
|
|
||||||
print "Loading barycenters..."
|
print "Loading barycenters..."
|
||||||
iLine = 0
|
iLine = 0
|
||||||
|
@ -462,7 +461,7 @@ def getArray(objectList, attr):
|
||||||
attrArr[:,idim] = np.fromiter((np.atleast_1d(getattr(v, attr))[idim] \
|
attrArr[:,idim] = np.fromiter((np.atleast_1d(getattr(v, attr))[idim] \
|
||||||
for v in objectList), float )
|
for v in objectList), float )
|
||||||
|
|
||||||
if ndim == 1: attrArr = attrArr[:,0]
|
if ndim == 1: attrArr = attArr[:,0]
|
||||||
|
|
||||||
return attrArr
|
return attrArr
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import matplotlib as mpl
|
import matplotlib as mpl
|
||||||
mpl.use('Agg')
|
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import matplotlib.cm as cm
|
import matplotlib.cm as cm
|
||||||
from matplotlib import rc
|
from matplotlib import rc
|
||||||
|
@ -66,14 +65,18 @@ def computeXcor(catalog,
|
||||||
plt.xlabel(r'$x \;[h^{-1}\mathrm{Mpc}]$')
|
plt.xlabel(r'$x \;[h^{-1}\mathrm{Mpc}]$')
|
||||||
plt.ylabel(r'$y \;[h^{-1}\mathrm{Mpc}]$')
|
plt.ylabel(r'$y \;[h^{-1}\mathrm{Mpc}]$')
|
||||||
plt.title(r'Dark matter')
|
plt.title(r'Dark matter')
|
||||||
plt.savefig(figDir+'/dm.eps', format='eps', bbox_inches="tight")
|
plt.savefig(figDir+'/dm.eps', bbox_inches="tight")
|
||||||
|
plt.savefig(figDir+'/dm.pdf', bbox_inches="tight")
|
||||||
|
plt.savefig(figDir+'/dm.png', bbox_inches="tight")
|
||||||
plt.clf()
|
plt.clf()
|
||||||
|
|
||||||
plt.imshow(np.sum(dv[:,:,:]+1,2)/Nmesh,extent=[0,Lbox,0,Lbox],aspect='equal',cmap='YlGnBu_r',interpolation='gaussian')
|
plt.imshow(np.sum(dv[:,:,:]+1,2)/Nmesh,extent=[0,Lbox,0,Lbox],aspect='equal',cmap='YlGnBu_r',interpolation='gaussian')
|
||||||
plt.xlabel(r'$x \;[h^{-1}\mathrm{Mpc}]$')
|
plt.xlabel(r'$x \;[h^{-1}\mathrm{Mpc}]$')
|
||||||
plt.ylabel(r'$y \;[h^{-1}\mathrm{Mpc}]$')
|
plt.ylabel(r'$y \;[h^{-1}\mathrm{Mpc}]$')
|
||||||
plt.title(r'Voids')
|
plt.title(r'Voids')
|
||||||
plt.savefig(figDir+'/dv.eps', format='eps', bbox_inches="tight") #, dpi=300
|
plt.savefig(figDir+'/dv.eps', bbox_inches="tight") #, dpi=300
|
||||||
|
plt.savefig(figDir+'/dv.pdf', bbox_inches="tight") #, dpi=300
|
||||||
|
plt.savefig(figDir+'/dv.png', bbox_inches="tight") #, dpi=300
|
||||||
plt.clf()
|
plt.clf()
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,7 +98,9 @@ def computeXcor(catalog,
|
||||||
plt.xlim(kmin,kmax)
|
plt.xlim(kmin,kmax)
|
||||||
plt.ylim(10**np.floor(np.log10(abs(Pvm[1:]).min()))/margin, max(10**np.ceil(np.log10(Pmm.max())),10**np.ceil(np.log10(Pvv.max())))*margin)
|
plt.ylim(10**np.floor(np.log10(abs(Pvm[1:]).min()))/margin, max(10**np.ceil(np.log10(Pmm.max())),10**np.ceil(np.log10(Pvv.max())))*margin)
|
||||||
plt.legend([pa, pb, pc],['tt', 'vt', 'vv'],'best',prop={'size':12})
|
plt.legend([pa, pb, pc],['tt', 'vt', 'vv'],'best',prop={'size':12})
|
||||||
plt.savefig(figDir+'/power.eps', format='eps', bbox_inches="tight")
|
plt.savefig(figDir+'/power.eps', bbox_inches="tight")
|
||||||
|
plt.savefig(figDir+'/power.pdf', bbox_inches="tight")
|
||||||
|
plt.savefig(figDir+'/power.png', bbox_inches="tight")
|
||||||
plt.clf()
|
plt.clf()
|
||||||
|
|
||||||
pa ,= plt.plot(rm, Xmm, 'k-o', ms=0.8*ms, mew=mew)
|
pa ,= plt.plot(rm, Xmm, 'k-o', ms=0.8*ms, mew=mew)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue