mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-05 07:41:11 +00:00
bug fixes
This commit is contained in:
parent
4cf0ec1173
commit
39e16d41ff
6 changed files with 103 additions and 102 deletions
|
@ -31,7 +31,7 @@ setup(
|
||||||
cmdclass = {'build_ext': build_ext},
|
cmdclass = {'build_ext': build_ext},
|
||||||
include_dirs = [np.get_include()],
|
include_dirs = [np.get_include()],
|
||||||
packages=
|
packages=
|
||||||
['void_python_tools','void_python_tools.backend','void_python_tools.apTools', 'void_python_tools.xcor', 'void_python_tools.voidUtil',
|
['void_python_tools','void_python_tools.backend','void_python_tools.apTools', 'void_python_tools.voidUtil',
|
||||||
'void_python_tools.apTools.profiles','void_python_tools.apTools.chi2',],
|
'void_python_tools.apTools.profiles','void_python_tools.apTools.chi2',],
|
||||||
#ext_modules = [Extension("void_python_tools.chi2.velocityProfileFitNative", ["void_python_tools/chi2/velocityProfileFitNative.pyx"], libraries=["gsl", "gslcblas"]), Extension("void_python_tools.chi2.likelihoo", ["void_python_tools/chi2/likelihood.pyx"], libraries=["gsl", "gslcblas"])]
|
#ext_modules = [Extension("void_python_tools.chi2.velocityProfileFitNative", ["void_python_tools/chi2/velocityProfileFitNative.pyx"], libraries=["gsl", "gslcblas"]), Extension("void_python_tools.chi2.likelihoo", ["void_python_tools/chi2/likelihood.pyx"], libraries=["gsl", "gslcblas"])]
|
||||||
#ext_modules = [
|
#ext_modules = [
|
||||||
|
|
|
@ -269,7 +269,7 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadPart=True):
|
||||||
densCon = line[9],
|
densCon = line[9],
|
||||||
voidProb = line[10],
|
voidProb = line[10],
|
||||||
radius = pow(line[7]/volNorm*3./4./np.pi, 1./3.),
|
radius = pow(line[7]/volNorm*3./4./np.pi, 1./3.),
|
||||||
barycenter = np.zeros((3))
|
barycenter = np.zeros((3)),
|
||||||
parentID = 0,
|
parentID = 0,
|
||||||
treeLevel = 0,
|
treeLevel = 0,
|
||||||
numChildren = 0,
|
numChildren = 0,
|
||||||
|
|
|
@ -32,7 +32,7 @@ def compareCatalogs(baseCatalogDir, compareCatalogDir,
|
||||||
outputDir="./", logDir="./",
|
outputDir="./", logDir="./",
|
||||||
matchMethod="useID", dataPortion="central",
|
matchMethod="useID", dataPortion="central",
|
||||||
strictMatch=True,
|
strictMatch=True,
|
||||||
pathToCTools="../../../c_tools")
|
pathToCTools="../../../c_tools"):
|
||||||
|
|
||||||
# reports the overlap between two void catalogs
|
# reports the overlap between two void catalogs
|
||||||
# baseCatalogDir: directory of catalog 1
|
# baseCatalogDir: directory of catalog 1
|
||||||
|
@ -44,31 +44,31 @@ def compareCatalogs(baseCatalogDir, compareCatalogDir,
|
||||||
# strictMatch: if True, only attempt to match to trimmed catalog
|
# strictMatch: if True, only attempt to match to trimmed catalog
|
||||||
# pathToCTools: path to location of VIDE c_tools directory
|
# pathToCTools: path to location of VIDE c_tools directory
|
||||||
|
|
||||||
if not os.access(outputDir, os.F_OK):
|
if not os.access(outputDir, os.F_OK):
|
||||||
os.makedirs(outputDir)
|
os.makedirs(outputDir)
|
||||||
|
|
||||||
if not os.access(logDir, os.F_OK):
|
if not os.access(logDir, os.F_OK):
|
||||||
os.makedirs(logDir)
|
os.makedirs(logDir)
|
||||||
|
|
||||||
outFileName = outputDir + "/" + "voidOverlap" #+ ".dat"
|
outFileName = outputDir + "/" + "voidOverlap" #+ ".dat"
|
||||||
|
|
||||||
with open(baseCatalogDir+"/sample_info.dat", 'rb') as input:
|
with open(baseCatalogDir+"/sample_info.dat", 'rb') as input:
|
||||||
baseSample = pickle.load(input)
|
baseSample = pickle.load(input)
|
||||||
|
|
||||||
with open(compareCatalogDir+"/sample_info.dat", 'rb') as input:
|
with open(compareCatalogDir+"/sample_info.dat", 'rb') as input:
|
||||||
sample = pickle.load(input)
|
sample = pickle.load(input)
|
||||||
|
|
||||||
print " Comparing", baseSample.fullName, "to", sample.fullName, "...",
|
print " Comparing", baseSample.fullName, "to", sample.fullName, "...",
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
sampleName = sample.fullName
|
sampleName = sample.fullName
|
||||||
|
|
||||||
binPath = pathToCTools+"/analysis/voidOverlap"
|
binPath = pathToCTools+"/analysis/voidOverlap"
|
||||||
logFile = logDir+"/compare_"+baseSample.fullName+"_"+sampleName+".out"
|
logFile = logDir+"/compare_"+baseSample.fullName+"_"+sampleName+".out"
|
||||||
stepOutputFileName = outFileName + "_" + baseSample.fullName + "_" + \
|
stepOutputFileName = outFileName + "_" + baseSample.fullName + "_" + \
|
||||||
sampleName + "_"
|
sampleName + "_"
|
||||||
|
|
||||||
launchVoidOverlap(baseSample, sample, baseCatalogDir,
|
launchVoidOverlap(baseSample, sample, baseCatalogDir,
|
||||||
compareCatalogDir, binPath,
|
compareCatalogDir, binPath,
|
||||||
thisDataPortion=dataPortion, logFile=logFile,
|
thisDataPortion=dataPortion, logFile=logFile,
|
||||||
continueRun=False, workDir=workDir,
|
continueRun=False, workDir=workDir,
|
||||||
|
@ -76,4 +76,5 @@ launchVoidOverlap(baseSample, sample, baseCatalogDir,
|
||||||
matchMethod=matchMethod,
|
matchMethod=matchMethod,
|
||||||
strictMatch=strictMatch)
|
strictMatch=strictMatch)
|
||||||
|
|
||||||
print " Done!"
|
print " Done!"
|
||||||
|
return
|
||||||
|
|
|
@ -43,13 +43,13 @@ def plotNumberFunction(catalogList, figDir="./",
|
||||||
plotName="numberfunc",
|
plotName="numberfunc",
|
||||||
dataPortion="central"):
|
dataPortion="central"):
|
||||||
|
|
||||||
print "Plotting number function"
|
print "Plotting number function"
|
||||||
|
|
||||||
plt.clf()
|
plt.clf()
|
||||||
plt.xlabel("$R_{eff}$ [$h^{-1}Mpc$]", fontsize=14)
|
plt.xlabel("$R_{eff}$ [$h^{-1}Mpc$]", fontsize=14)
|
||||||
plt.ylabel(r"log ($n$ (> R) [$h^3$ Gpc$^{-3}$])", fontsize=14)
|
plt.ylabel(r"log ($n$ (> R) [$h^3$ Gpc$^{-3}$])", fontsize=14)
|
||||||
|
|
||||||
for (iSample,catalog) in enumerate(catalogList):
|
for (iSample,catalog) in enumerate(catalogList):
|
||||||
sample = catalog.sampleInfo
|
sample = catalog.sampleInfo
|
||||||
data = catalog.voids[:].radius
|
data = catalog.voids[:].radius
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ def fitHSWProfile(radii, densities, sigmas):
|
||||||
# pcov: covariance matrix
|
# pcov: covariance matrix
|
||||||
|
|
||||||
popt, pcov = curve_fit(HamausProfile, radii, densities,
|
popt, pcov = curve_fit(HamausProfile, radii, densities,
|
||||||
sigma=sigmas)
|
sigma=sigmas,
|
||||||
maxfev=10000, xtol=5.e-3,
|
maxfev=10000, xtol=5.e-3,
|
||||||
p0=[1.0,-1.0])
|
p0=[1.0,-1.0])
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ def computeCrossCor(catalogDir,
|
||||||
outputDir="./", logDir="./",
|
outputDir="./", logDir="./",
|
||||||
matchMethod="useID", dataPortion="central",
|
matchMethod="useID", dataPortion="central",
|
||||||
strictMatch=True,
|
strictMatch=True,
|
||||||
pathToCTools="../../../c_tools")
|
pathToCTools="../../../c_tools"):
|
||||||
|
|
||||||
# Computes void-void and void-matter(galaxy) correlations
|
# Computes void-void and void-matter(galaxy) correlations
|
||||||
# baseCatalogDir: directory of catalog
|
# baseCatalogDir: directory of catalog
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue