mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +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:
|
||||
minRadius = sample.minVoidRadius
|
||||
|
||||
volNormZobov, volNormObs = getVolNorm(sample)
|
||||
volNormZobov, volNormObs = getVolNorm(outputDir)
|
||||
|
||||
if not (continueRun and (jobSuccessful(logFile, "NetCDF: Not a valid ID\n") \
|
||||
or jobSuccessful(logFile, "Done!\n"))):
|
||||
|
|
|
@ -26,6 +26,7 @@ import healpy as healpy
|
|||
import os
|
||||
from backend import *
|
||||
from backend.cosmologyTools import *
|
||||
import pickle
|
||||
|
||||
from netCDF4 import Dataset
|
||||
NetCDFFile = Dataset
|
||||
|
@ -101,9 +102,10 @@ def getSurveyProps(sample):
|
|||
# returns the volume normalization factors:
|
||||
# normalization used by zobov (assumes cubmic volume)
|
||||
# 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"
|
||||
File = NetCDFFile(infoFile, 'r')
|
||||
|
|
|
@ -27,7 +27,6 @@ from backend import *
|
|||
import voidUtil
|
||||
import imp
|
||||
import os
|
||||
import pickle
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
@ -74,7 +73,7 @@ for sample in dataSampleList:
|
|||
sampleName = sample.fullName
|
||||
|
||||
print(" Working with data set", sampleName, "...")
|
||||
outputDir = workDir+"/sample_"+sampleName+"/"
|
||||
outputDir = os.path.abspath(workDir+"/sample_"+sampleName) + "/"
|
||||
sample.outputDir = outputDir
|
||||
|
||||
if not os.access(outputDir, os.F_OK):
|
||||
|
|
|
@ -304,7 +304,7 @@ def loadVoidCatalog(sampleDir,
|
|||
catalog.ranges = ranges
|
||||
File.close()
|
||||
|
||||
volNormZobov, volNormObs = getVolNorm(sample)
|
||||
volNormZobov, volNormObs = getVolNorm(sampleDir)
|
||||
catalog.volNormZobov = volNormZobov
|
||||
catalog.volNormObs = volNormObs
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue