mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
moved all of sample_info printing to launchGenerate
This commit is contained in:
parent
573f4437af
commit
fa0d46c55a
4 changed files with 26 additions and 30 deletions
|
@ -77,31 +77,6 @@ for sample in dataSampleList:
|
|||
if not os.access(zobovDir, os.F_OK):
|
||||
os.makedirs(zobovDir)
|
||||
|
||||
# save this sample's information
|
||||
with open(zobovDir+"/sample_info.dat", 'w') as output:
|
||||
pickle.dump(sample, output, pickle.HIGHEST_PROTOCOL)
|
||||
|
||||
fp = open(zobovDir+"/sample_info.txt", 'w')
|
||||
fp.write("Sample name: %s\n" % sample.fullName)
|
||||
fp.write("Sample nickname: %s\n" % sample.nickName)
|
||||
fp.write("Data type: %s\n" % sample.dataType)
|
||||
fp.write("Redshift range: %f - %f\n" %(sample.zBoundary[0],sample.zBoundary[1]))
|
||||
|
||||
#fp.write("Estimated mean particle separation: %g\n" % sample.minVoidRadius)
|
||||
|
||||
if (sample.dataType == "simulation"):
|
||||
fp.write("Particles placed on lightcone: %g\n" % sample.useLightCone)
|
||||
fp.write("Peculiar velocities included: %g\n" % sample.usePecVel)
|
||||
if (len(sample.subsample) == 1):
|
||||
fp.write("Additional subsampling fraction: %s\n" % sample.subsample)
|
||||
else:
|
||||
fp.write("Additional subsampling fraction: %s\n" % sample.subsample[-1])
|
||||
fp.write("Simulation box length (Mpc/h): %g\n" % sample.boxLen)
|
||||
fp.write("Simulation Omega_M: %g\n" % sample.omegaM)
|
||||
fp.write("Number of simulation subvolumes: %s\n" % sample.numSubvolumes)
|
||||
fp.write("My subvolume index: %s\n" % sample.mySubvolume)
|
||||
fp.close()
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
if (startCatalogStage <= 1) and (endCatalogStage >= 1) and not sample.isCombo:
|
||||
print " Extracting tracers from catalog...",
|
||||
|
|
|
@ -121,6 +121,7 @@ haloFileVYCol = 4
|
|||
haloFileVZCol = 5
|
||||
haloFileColSep = ','
|
||||
haloFileNumComLines = 0
|
||||
haloFilePosRescale = 1.0 # rescaling necessary to get Mpc/h
|
||||
|
||||
# adjust these two parameters given the memory contraints on your system:
|
||||
# numZobovDivisions: how many sub-volumes per dimension will zobov process
|
||||
|
|
|
@ -681,9 +681,9 @@ if (args.halos or args.all) and haloFileBase != "":
|
|||
if iHalo < haloFileNumComLines: continue
|
||||
line = line.split(haloFileColSep)
|
||||
if minHaloMass == "none" or float(line[haloFileMCol]) > minHaloMass:
|
||||
x = float(line[haloFileXCol])
|
||||
y = float(line[haloFileYCol])
|
||||
z = float(line[haloFileZCol])
|
||||
x = float(line[haloFileXCol]) * haloFilePosRescale
|
||||
y = float(line[haloFileYCol]) * haloFilePosRescale
|
||||
z = float(line[haloFileZCol]) * haloFilePosRescale
|
||||
vz = float(line[haloFileVZCol])
|
||||
vy = float(line[haloFileVYCol])
|
||||
vx = float(line[haloFileVXCol])
|
||||
|
|
|
@ -261,7 +261,26 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
|||
|
||||
meanSep = (1.*numTracers/boxVol)**(-1/3.)
|
||||
|
||||
fp = open(zobovDir+"/sample_info.txt", 'a')
|
||||
# save this sample's information
|
||||
with open(zobovDir+"/sample_info.dat", 'w') as output:
|
||||
pickle.dump(sample, output, pickle.HIGHEST_PROTOCOL)
|
||||
|
||||
fp = open(zobovDir+"/sample_info.txt", 'w')
|
||||
fp.write("Sample name: %s\n" % sample.fullName)
|
||||
fp.write("Sample nickname: %s\n" % sample.nickName)
|
||||
fp.write("Data type: %s\n" % sample.dataType)
|
||||
fp.write("Redshift range: %f - %f\n" %(sample.zBoundary[0],sample.zBoundary[1]))
|
||||
if (sample.dataType == "simulation"):
|
||||
fp.write("Particles placed on lightcone: %g\n" % sample.useLightCone)
|
||||
fp.write("Peculiar velocities included: %g\n" % sample.usePecVel)
|
||||
if (len(sample.subsample) == 1):
|
||||
fp.write("Additional subsampling fraction: %s\n" % sample.subsample)
|
||||
else:
|
||||
fp.write("Additional subsampling fraction: %s\n" % sample.subsample[-1])
|
||||
fp.write("Simulation box length (Mpc/h): %g\n" % sample.boxLen)
|
||||
fp.write("Simulation Omega_M: %g\n" % sample.omegaM)
|
||||
fp.write("Number of simulation subvolumes: %s\n" % sample.numSubvolumes)
|
||||
fp.write("My subvolume index: %s\n" % sample.mySubvolume)
|
||||
fp.write("Estimated volume (cubic Mpc/h): %g\n" % boxVol)
|
||||
fp.write("Number of real (non-boundary) tracers: %d\n" % numTracers)
|
||||
fp.write("Total number of tracers: %d\n" % numTotal)
|
||||
|
@ -310,8 +329,9 @@ def launchZobov(sample, binPath, zobovDir=None, logDir=None, continueRun=None,
|
|||
|
||||
cmd = "./%s >> %s 2>&1" % (vozScript, logFile)
|
||||
os.system(cmd)
|
||||
#cmd = "%s/../c_tools/zobov2/jozov2/jozov2 %s %s %s %s %s %g %s >> %s 2>&1" % \
|
||||
|
||||
cmd = "%s/../c_tools/zobov2/jozov2/jozov2 %s %s %s %s %s %g %s >> %s 2>&1" % \
|
||||
cmd = "%s/jozov %s %s %s %s %s %g %s >> %s 2>&1" % \
|
||||
(binPath, \
|
||||
zobovDir+"/adj_"+sampleName+".dat", \
|
||||
zobovDir+"/vol_"+sampleName+".dat", \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue