mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
added a-p analysis script to repo; some minor bug fixes to adjust tools to work with simulation data
This commit is contained in:
parent
de6dbd3051
commit
21431f9a31
6 changed files with 41 additions and 1500 deletions
File diff suppressed because it is too large
Load diff
|
@ -150,6 +150,9 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
|||
else:
|
||||
print "already done!"
|
||||
|
||||
if os.access("comoving_distance.txt", os.F_OK):
|
||||
os.system("mv %s %s" % ("comoving_distance.txt", zobovDir))
|
||||
|
||||
if os.access(parmFile, os.F_OK):
|
||||
os.unlink(parmFile)
|
||||
|
||||
|
@ -460,34 +463,37 @@ def launchStack(sample, stack, binPath, thisDataPortion=None, logDir=None,
|
|||
return
|
||||
|
||||
# figure out box volume and average density
|
||||
maskFile = sample.maskFile
|
||||
sulFunFile = sample.selFunFile
|
||||
if sample.dataType == "observation":
|
||||
maskFile = sample.maskFile
|
||||
sulFunFile = sample.selFunFile
|
||||
|
||||
if not os.access(sample.selFunFile, os.F_OK) and not volumeLimited:
|
||||
print " Cannot find", selFunFile, "!"
|
||||
exit(-1)
|
||||
if not os.access(sample.selFunFile, os.F_OK) and not sample.volumeLimited:
|
||||
print " Cannot find", selFunFile, "!"
|
||||
exit(-1)
|
||||
|
||||
sys.stdout = open(logFile, 'a')
|
||||
sys.stderr = open(logFile, 'a')
|
||||
zMin = sample.zRange[0]
|
||||
zMax = sample.zRange[1]
|
||||
if not sample.volumeLimited:
|
||||
props = vp.getSurveyProps(maskFile, stack.zMin,
|
||||
stack.zMax, zMin, zMax, "all",
|
||||
selectionFuncFile=sample.selFunFile)
|
||||
sys.stdout = open(logFile, 'a')
|
||||
sys.stderr = open(logFile, 'a')
|
||||
zMin = sample.zRange[0]
|
||||
zMax = sample.zRange[1]
|
||||
if not sample.volumeLimited:
|
||||
props = vp.getSurveyProps(maskFile, stack.zMin,
|
||||
stack.zMax, zMin, zMax, "all",
|
||||
selectionFuncFile=sample.selFunFile)
|
||||
else:
|
||||
zMinForVol = sample.zBoundary[0]
|
||||
zMaxForVol = sample.zBoundary[1]
|
||||
props = vp.getSurveyProps(maskFile, zMinForVol,
|
||||
zMaxForVol, zMin, zMax, "all")
|
||||
sys.stdout = sys.__stdout__
|
||||
sys.stderr = sys.__stderr__
|
||||
|
||||
boxVol = props[0]
|
||||
nbar = props[1]
|
||||
if sample.volumeLimited:
|
||||
nbar = 1.0
|
||||
else:
|
||||
zMinForVol = sample.zBoundary[0]
|
||||
zMaxForVol = sample.zBoundary[1]
|
||||
props = vp.getSurveyProps(maskFile, zMinForVol,
|
||||
zMaxForVol, zMin, zMax, "all")
|
||||
sys.stdout = sys.__stdout__
|
||||
sys.stderr = sys.__stderr__
|
||||
|
||||
boxVol = props[0]
|
||||
nbar = props[1]
|
||||
|
||||
if sample.volumeLimited:
|
||||
nbar = 1.0
|
||||
boxVol = sample.boxLen**3
|
||||
|
||||
summaryLine = runSuffix + " " + \
|
||||
thisDataPortion + " " + \
|
||||
|
@ -1173,7 +1179,11 @@ def launchHubble(dataPortions=None, dataSampleList=None, logDir=None,
|
|||
voidDir = sample.zobovDir+"/stacks_" + runSuffix
|
||||
centersFile = voidDir+"/centers.txt"
|
||||
if os.access(centersFile, os.F_OK):
|
||||
voidRedshifts = np.loadtxt(centersFile)[:,5]
|
||||
voidRedshifts = np.loadtxt(centersFile)
|
||||
if voidRedshifts.ndim > 1:
|
||||
voidRedshifts = voidRedshifts[:,5]
|
||||
else:
|
||||
voidRedshifts = voidRedshifts[5]
|
||||
#fp.write(str(len(voidRedshifts))+" ")
|
||||
np.savetxt(fp, voidRedshifts[None])
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue