mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 23:31:12 +00:00
changed some things around for getting volume normalization to support reading old catalog files
This commit is contained in:
parent
40d7793e54
commit
f8f960d7dd
4 changed files with 7 additions and 6 deletions
|
@ -608,7 +608,7 @@ def launchPrune(sample, binPath,
|
||||||
else:
|
else:
|
||||||
minRadius = sample.minVoidRadius
|
minRadius = sample.minVoidRadius
|
||||||
|
|
||||||
volNormZobov, volNormObs = getVolNorm(sample)
|
volNormZobov, volNormObs = getVolNorm(outputDir)
|
||||||
|
|
||||||
if not (continueRun and (jobSuccessful(logFile, "NetCDF: Not a valid ID\n") \
|
if not (continueRun and (jobSuccessful(logFile, "NetCDF: Not a valid ID\n") \
|
||||||
or jobSuccessful(logFile, "Done!\n"))):
|
or jobSuccessful(logFile, "Done!\n"))):
|
||||||
|
|
|
@ -26,6 +26,7 @@ import healpy as healpy
|
||||||
import os
|
import os
|
||||||
from backend import *
|
from backend import *
|
||||||
from backend.cosmologyTools import *
|
from backend.cosmologyTools import *
|
||||||
|
import pickle
|
||||||
|
|
||||||
from netCDF4 import Dataset
|
from netCDF4 import Dataset
|
||||||
NetCDFFile = Dataset
|
NetCDFFile = Dataset
|
||||||
|
@ -101,9 +102,10 @@ def getSurveyProps(sample):
|
||||||
# returns the volume normalization factors:
|
# returns the volume normalization factors:
|
||||||
# normalization used by zobov (assumes cubmic volume)
|
# normalization used by zobov (assumes cubmic volume)
|
||||||
# normalization used in galaxy survey volume for observations
|
# normalization used in galaxy survey volume for observations
|
||||||
def getVolNorm(sample):
|
def getVolNorm(sampleDir):
|
||||||
|
|
||||||
sampleDir = sample.outputDir
|
with open(sampleDir+"/sample_info.dat", 'rb') as input:
|
||||||
|
sample = pickle.load(input)
|
||||||
|
|
||||||
infoFile = sampleDir+"/zobov_slice_"+sample.fullName+".par"
|
infoFile = sampleDir+"/zobov_slice_"+sample.fullName+".par"
|
||||||
File = NetCDFFile(infoFile, 'r')
|
File = NetCDFFile(infoFile, 'r')
|
||||||
|
|
|
@ -27,7 +27,6 @@ from backend import *
|
||||||
import voidUtil
|
import voidUtil
|
||||||
import imp
|
import imp
|
||||||
import os
|
import os
|
||||||
import pickle
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -74,7 +73,7 @@ for sample in dataSampleList:
|
||||||
sampleName = sample.fullName
|
sampleName = sample.fullName
|
||||||
|
|
||||||
print(" Working with data set", sampleName, "...")
|
print(" Working with data set", sampleName, "...")
|
||||||
outputDir = workDir+"/sample_"+sampleName+"/"
|
outputDir = os.path.abspath(workDir+"/sample_"+sampleName) + "/"
|
||||||
sample.outputDir = outputDir
|
sample.outputDir = outputDir
|
||||||
|
|
||||||
if not os.access(outputDir, os.F_OK):
|
if not os.access(outputDir, os.F_OK):
|
||||||
|
|
|
@ -304,7 +304,7 @@ def loadVoidCatalog(sampleDir,
|
||||||
catalog.ranges = ranges
|
catalog.ranges = ranges
|
||||||
File.close()
|
File.close()
|
||||||
|
|
||||||
volNormZobov, volNormObs = getVolNorm(sample)
|
volNormZobov, volNormObs = getVolNorm(sampleDir)
|
||||||
catalog.volNormZobov = volNormZobov
|
catalog.volNormZobov = volNormZobov
|
||||||
catalog.volNormObs = volNormObs
|
catalog.volNormObs = volNormObs
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue