From ae22f0c0364bfbcf73e69c2c510210c99a574c42 Mon Sep 17 00:00:00 2001 From: Nico Hamaus Date: Fri, 30 May 2014 15:56:01 +0200 Subject: [PATCH 1/5] fix output formats of correlation function plot --- python_tools/void_python_tools/voidUtil/xcorUtil.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python_tools/void_python_tools/voidUtil/xcorUtil.py b/python_tools/void_python_tools/voidUtil/xcorUtil.py index 0c11cae..d342e53 100644 --- a/python_tools/void_python_tools/voidUtil/xcorUtil.py +++ b/python_tools/void_python_tools/voidUtil/xcorUtil.py @@ -119,7 +119,9 @@ def computeXcor(catalog, plt.xlim(rmin,rmax) plt.ylim(min(10**np.floor(np.log10(abs(Xvm).min())),10**np.floor(np.log10(abs(Xmm).min())))/margin, max(10**np.ceil(np.log10(Xmm.max())),10**np.ceil(np.log10(Xvv.max())))*margin) plt.legend([pa, pb, pc],['tt', 'vt', 'vv'],'best',prop={'size':12}) - plt.savefig(figDir+'/correlation.eps', format='eps', bbox_inches="tight") + plt.savefig(figDir+'/correlation.eps', bbox_inches="tight") + plt.savefig(figDir+'/correlation.pdf', bbox_inches="tight") + plt.savefig(figDir+'/correlation.png', bbox_inches="tight") plt.clf() From fe885ea008fc65efcb350ef737c06d61a6c35343 Mon Sep 17 00:00:00 2001 From: "P.M. Sutter" Date: Fri, 30 May 2014 09:36:01 -0500 Subject: [PATCH 2/5] re-added some dropped fixes; ixed ellipticity distribution plotting --- python_tools/void_python_tools/voidUtil/catalogUtil.py | 3 ++- python_tools/void_python_tools/voidUtil/plotUtil.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python_tools/void_python_tools/voidUtil/catalogUtil.py b/python_tools/void_python_tools/voidUtil/catalogUtil.py index cfe6de7..cd9ee71 100644 --- a/python_tools/void_python_tools/voidUtil/catalogUtil.py +++ b/python_tools/void_python_tools/voidUtil/catalogUtil.py @@ -344,7 +344,8 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True, eigenVecs = np.zeros((3,3)), )) - print "Read %d voids" % len(catalog.voids) + catalog.numVoids = len(catalog.voids) + print "Read %d voids" % catalog.numVoids print "Loading barycenters..." iLine = 0 diff --git a/python_tools/void_python_tools/voidUtil/plotUtil.py b/python_tools/void_python_tools/voidUtil/plotUtil.py index 34752a8..5002209 100644 --- a/python_tools/void_python_tools/voidUtil/plotUtil.py +++ b/python_tools/void_python_tools/voidUtil/plotUtil.py @@ -167,8 +167,9 @@ def plotEllipDist(catalogList, dataWeights = np.ones_like(data)/len(data) dataHist, dataBins = np.histogram(data, bins=10, weights=dataWeights, range=(0.0,0.35)) + binCenters = 0.5*(dataBins[1:] + dataBins[:-1]) - plt.plot(dataBins, dataHist, label=sample.fullName, + plt.plot(binCenters, dataHist, label=sample.fullName, color=colorList[iSample]) ellipDistList.append((dataBins, dataHist,)) From 42ff05eab1761aea67c1d9d53a7be60583e10cb8 Mon Sep 17 00:00:00 2001 From: "P.M. Sutter" Date: Fri, 30 May 2014 11:05:37 -0500 Subject: [PATCH 3/5] harmonized array ordering --- python_tools/void_python_tools/voidUtil/catalogUtil.py | 8 ++++---- python_tools/void_python_tools/voidUtil/plotUtil.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python_tools/void_python_tools/voidUtil/catalogUtil.py b/python_tools/void_python_tools/voidUtil/catalogUtil.py index cd9ee71..6e69102 100644 --- a/python_tools/void_python_tools/voidUtil/catalogUtil.py +++ b/python_tools/void_python_tools/voidUtil/catalogUtil.py @@ -542,10 +542,10 @@ def stackVoids(catalog, stackMode = "ball"): localPart = catalog.partPos[ getBall(partTree, center, rMax) ] else: voidPart = getVoidPart(catalog, void.voidID) - localPart = np.zeros((3,len(voidPart))) - localPart[0,:] = getArray(voidPart, 'x') - localPart[1,:] = getArray(voidPart, 'y') - localPart[2,:] = getArray(voidPart, 'z') + localPart = np.zeros((len(voidPart),3)) + localPart[:,0] = getArray(voidPart, 'x') + localPart[:,1] = getArray(voidPart, 'y') + localPart[:,2] = getArray(voidPart, 'z') shiftedPart = shiftPart(localPart, center, periodicLine, catalog.ranges) diff --git a/python_tools/void_python_tools/voidUtil/plotUtil.py b/python_tools/void_python_tools/voidUtil/plotUtil.py index 5002209..2314470 100644 --- a/python_tools/void_python_tools/voidUtil/plotUtil.py +++ b/python_tools/void_python_tools/voidUtil/plotUtil.py @@ -253,13 +253,13 @@ def plotVoidCells(catalog, voidPart = getVoidPart(catalog, voidID) - newpart = np.zeros((3,len(voidPart))) + newpart = np.zeros((len(voidPart),3)) volume=np.zeros(len(voidPart)) radius=np.zeros(len(voidPart)) - newpart[0,:] = getArray(voidPart, 'x') - newpart[1,:] = getArray(voidPart, 'y') - newpart[2,:] = getArray(voidPart, 'z') + newpart[:,0] = getArray(voidPart, 'x') + newpart[:,1] = getArray(voidPart, 'y') + newpart[:,2] = getArray(voidPart, 'z') volume = getArray(voidPart, 'volume') radius = (3.*volume/(4.*np.pi))**(1./3.) From 12f819f37e8748403320346654da10e2c80f4c5c Mon Sep 17 00:00:00 2001 From: "P.M. Sutter" Date: Fri, 30 May 2014 11:48:13 -0500 Subject: [PATCH 4/5] added check if user passed only a single catalog --- python_tools/void_python_tools/voidUtil/plotUtil.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python_tools/void_python_tools/voidUtil/plotUtil.py b/python_tools/void_python_tools/voidUtil/plotUtil.py index 2314470..0624c60 100644 --- a/python_tools/void_python_tools/voidUtil/plotUtil.py +++ b/python_tools/void_python_tools/voidUtil/plotUtil.py @@ -58,6 +58,8 @@ def plotNumberFunction(catalogList, print "Plotting number function" + catalogList = np.atleast_1d(catalogList) + plt.clf() plt.xlabel("$R_{eff}$ [$h^{-1}Mpc$]", fontsize=14) @@ -160,6 +162,8 @@ def plotEllipDist(catalogList, ellipDistList = [] + catalogList = np.atleast_1d(catalogList) + for (iSample,catalog) in enumerate(catalogList): sample = catalog.sampleInfo data = getArray(catalog.voids, 'ellipticity') From 6e69b0ae648eb4d4d26065ca533fba6a55a714ea Mon Sep 17 00:00:00 2001 From: "P.M. Sutter" Date: Fri, 30 May 2014 11:50:27 -0500 Subject: [PATCH 5/5] removed spurious workdir from overlap --- python_tools/void_python_tools/backend/launchers.py | 2 +- python_tools/void_python_tools/voidUtil/matchUtil.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python_tools/void_python_tools/backend/launchers.py b/python_tools/void_python_tools/backend/launchers.py index 471e495..f0c8dad 100644 --- a/python_tools/void_python_tools/backend/launchers.py +++ b/python_tools/void_python_tools/backend/launchers.py @@ -525,7 +525,7 @@ def launchPrune(sample, binPath, # ----------------------------------------------------------------------------- def launchVoidOverlap(sample1, sample2, sample1Dir, sample2Dir, binPath, thisDataPortion=None, - logFile=None, workDir=None, + logFile=None, continueRun=None, outputFile=None, matchMethod=None, strictMatch=False): diff --git a/python_tools/void_python_tools/voidUtil/matchUtil.py b/python_tools/void_python_tools/voidUtil/matchUtil.py index 6b342ed..867d149 100755 --- a/python_tools/void_python_tools/voidUtil/matchUtil.py +++ b/python_tools/void_python_tools/voidUtil/matchUtil.py @@ -71,7 +71,7 @@ def compareCatalogs(baseCatalogDir, compareCatalogDir, launchVoidOverlap(baseSample, sample, baseCatalogDir, compareCatalogDir, binPath, thisDataPortion=dataPortion, logFile=logFile, - continueRun=False, workDir=workDir, + continueRun=False, outputFile=stepOutputFileName, matchMethod=matchMethod, strictMatch=strictMatch)