From 5aba171bed85e3258ed20895004ec1ee1fd2b1f7 Mon Sep 17 00:00:00 2001 From: "P.M. Sutter" Date: Sat, 8 Feb 2014 07:11:00 -0600 Subject: [PATCH] correct handling of comoving-space coordinates in stacking --- .../void_python_tools/backend/launchers.py | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/python_tools/void_python_tools/backend/launchers.py b/python_tools/void_python_tools/backend/launchers.py index 413f9da..2fa66fc 100644 --- a/python_tools/void_python_tools/backend/launchers.py +++ b/python_tools/void_python_tools/backend/launchers.py @@ -560,7 +560,7 @@ def launchVoidOverlap(sample1, sample2, sample1Dir, sample2Dir, # ----------------------------------------------------------------------------- def launchStack(sample, stack, binPath, thisDataPortion=None, logDir=None, voidDir=None, freshStack=True, runSuffix=None, - zobovDir=None, + zobovDir=None, useLightCone=None, useComoving=None, INCOHERENT=False, ranSeed=None, summaryFile=None, continueRun=None, dataType=None, prefixRun="", idList=None, rescaleOverride=None): @@ -586,8 +586,15 @@ def launchStack(sample, stack, binPath, thisDataPortion=None, logDir=None, centralRadius = stack.rMin * 0.25 # restrict to relevant ranges of sample - zMin = max(sample.zRange[0],stack.zMin) * 3000 - zMax = min(sample.zRange[1],stack.zMax) * 3000 + zMin = max(sample.zRange[0], stack.zMin) + zMax = min(sample.zRange[1], stack.zMax) + if useComoving or not useLightCone: + zMin = 3000.*vp.angularDiameter(zMin, Om=0.27) + zMax = 3000.*vp.angularDiameter(zMax, Om=0.27) + print min(sample.zRange[1],stack.zMax)*3000, zMax + else: + zMin *= 3000 + zMax *= 3000 if dataType == "observation": obsFlag = "observation" @@ -1230,23 +1237,23 @@ def launchFit(sample, stack, logFile=None, voidDir=None, figDir=None, while badChain: ntries += 1 - Rexpect = (stack.rMin+stack.rMax)/2 - Rtruncate = stack.rMin*3. + 1 # TEST - if sample.dataType == "observation": - ret,fits,args = vp.fit_ellipticity(voidDir,Rbase=Rexpect, - Niter=300000, - Nburn=100000, - Rextracut=Rtruncate) - else: - ret,fits,args = vp.fit_ellipticity(voidDir,Rbase=Rexpect, - Niter=300000, - Nburn=100000, - Rextracut=Rtruncate) - badChain = (args[0][0] > 0.5 or args[0][1] > 2.*stack.rMax or \ - args[0][2] > 2.*stack.rMax) and \ - (ntries < maxtries) - #ret,fits,args = vp.compute_inertia(voidDir, stack.rMax, mode="2d", nBootstraps=500, rMaxInertia=0.7) - #badChain = False + #Rexpect = (stack.rMin+stack.rMax)/2 + #Rtruncate = stack.rMin*3. + 1 # TEST + #if sample.dataType == "observation": + # ret,fits,args = vp.fit_ellipticity(voidDir,Rbase=Rexpect, + # Niter=300000, + # Nburn=100000, + # Rextracut=Rtruncate) + #else: + # ret,fits,args = vp.fit_ellipticity(voidDir,Rbase=Rexpect, + # Niter=300000, + # Nburn=100000, + # Rextracut=Rtruncate) + #badChain = (args[0][0] > 0.5 or args[0][1] > 2.*stack.rMax or \ + # args[0][2] > 2.*stack.rMax) and \ + # (ntries < maxtries) + ret,fits,args = vp.compute_inertia(voidDir, stack.rMax, mode="2d", nBootstraps=500, rMaxInertia=0.7) + badChain = False #np.save(voidDir+"/chain.npy", ret) np.savetxt(voidDir+"/fits.out", fits)