mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
switched variable name useLCDM to less confusing useComoving; make it sample-level rather than dataset-level
This commit is contained in:
parent
34a32bfd2c
commit
f268820a2e
8 changed files with 25 additions and 26 deletions
|
@ -115,7 +115,7 @@ void loadData(const string& fname, NYU_VData & data)
|
||||||
}
|
}
|
||||||
|
|
||||||
void generateGalaxiesInCube(NYU_VData& data, ParticleData& output_data,
|
void generateGalaxiesInCube(NYU_VData& data, ParticleData& output_data,
|
||||||
bool useLCDM)
|
bool useComoving)
|
||||||
{
|
{
|
||||||
double d2r = M_PI/180;
|
double d2r = M_PI/180;
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ void generateGalaxiesInCube(NYU_VData& data, ParticleData& output_data,
|
||||||
double ra = data[i].ra*d2r, dec = data[i].dec*d2r;
|
double ra = data[i].ra*d2r, dec = data[i].dec*d2r;
|
||||||
Position& p = output_data.pos[i];
|
Position& p = output_data.pos[i];
|
||||||
|
|
||||||
if (useLCDM) {
|
if (useComoving) {
|
||||||
//double pos = gsl_interp_eval(interp, redshifts, dL, data[i].cz, acc);
|
//double pos = gsl_interp_eval(interp, redshifts, dL, data[i].cz, acc);
|
||||||
gsl_integration_qng(&expanF, 1.e-6, data[i].cz/LIGHT_SPEED,
|
gsl_integration_qng(&expanF, 1.e-6, data[i].cz/LIGHT_SPEED,
|
||||||
1.e-6,
|
1.e-6,
|
||||||
|
@ -587,7 +587,7 @@ int main(int argc, char **argv)
|
||||||
// We compute a cube holding all the galaxies + the survey surface mask
|
// We compute a cube holding all the galaxies + the survey surface mask
|
||||||
|
|
||||||
cout << "Placing galaxies..." << endl;
|
cout << "Placing galaxies..." << endl;
|
||||||
generateGalaxiesInCube(data, output_data, args_info.useLCDM_flag);
|
generateGalaxiesInCube(data, output_data, args_info.useComoving_flag);
|
||||||
generateSurfaceMask(args_info, mask, pixel_list, full_mask_list,
|
generateSurfaceMask(args_info, mask, pixel_list, full_mask_list,
|
||||||
data, output_data);
|
data, output_data);
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,4 @@ option "zMax" - "Maximum redshift of data" double required
|
||||||
option "output" - "Filename of particle datafile" string required
|
option "output" - "Filename of particle datafile" string required
|
||||||
option "params" - "Output parameters of the datacube" string required
|
option "params" - "Output parameters of the datacube" string required
|
||||||
|
|
||||||
option "useLCDM" - "Convert to real space using LCDM cosmology" flag off
|
option "useComoving" - "Convert to real space using LCDM cosmology" flag off
|
||||||
|
|
|
@ -724,7 +724,7 @@ int main(int argc, char **argv) {
|
||||||
voids[iVoid].redshiftInMpc = voids[iVoid].redshiftInMpc;
|
voids[iVoid].redshiftInMpc = voids[iVoid].redshiftInMpc;
|
||||||
|
|
||||||
|
|
||||||
if (args.useLCDM_flag) {
|
if (args.useComoving_flag) {
|
||||||
redshift = gsl_interp_eval(interp, dL, redshifts,
|
redshift = gsl_interp_eval(interp, dL, redshifts,
|
||||||
voids[iVoid].redshiftInMpc, acc);
|
voids[iVoid].redshiftInMpc, acc);
|
||||||
//printf("HELLO %e %e\n", redshift, args.zMax_arg);
|
//printf("HELLO %e %e\n", redshift, args.zMax_arg);
|
||||||
|
|
|
@ -23,7 +23,7 @@ option "numVoids" - "Number of voids" int required
|
||||||
|
|
||||||
option "isObservation" - "We are working with observational data" flag off
|
option "isObservation" - "We are working with observational data" flag off
|
||||||
|
|
||||||
option "useLCDM" - "Void positions are in comoving coordinates" flag off
|
option "useComoving" - "Void positions are in comoving coordinates" flag off
|
||||||
|
|
||||||
option "zMin" - "Minimum redshift of sample" double optional default="0.0"
|
option "zMin" - "Minimum redshift of sample" double optional default="0.0"
|
||||||
option "zMax" - "Maximum redshift of sample" double optional default="10.0"
|
option "zMax" - "Maximum redshift of sample" double optional default="10.0"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
#+
|
#+
|
||||||
# VIDE -- Void IDEntification pipeline -- ./pipeline/generateCatalog.py
|
# VIDE -- Void IDentification and Examination -- ./pipeline/generateCatalog.py
|
||||||
# Copyright (C) 2010-2013 Guilhem Lavaux
|
# Copyright (C) 2010-2013 Guilhem Lavaux
|
||||||
# Copyright (C) 2011-2013 P. M. Sutter
|
# Copyright (C) 2011-2013 P. M. Sutter
|
||||||
#
|
#
|
||||||
|
@ -91,7 +91,7 @@ for sample in dataSampleList:
|
||||||
|
|
||||||
launchGenerate(sample, GENERATE_PATH, workDir=workDir,
|
launchGenerate(sample, GENERATE_PATH, workDir=workDir,
|
||||||
inputDataDir=inputDataDir, zobovDir=zobovDir,
|
inputDataDir=inputDataDir, zobovDir=zobovDir,
|
||||||
figDir=figDir, logFile=logFile, useLCDM=useLCDM,
|
figDir=figDir, logFile=logFile, useComoving=sample.useComoving,
|
||||||
continueRun=continueRun, regenerate=regenerateFlag)
|
continueRun=continueRun, regenerate=regenerateFlag)
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
@ -115,7 +115,7 @@ for sample in dataSampleList:
|
||||||
|
|
||||||
launchPrune(sample, PRUNE_PATH,
|
launchPrune(sample, PRUNE_PATH,
|
||||||
logFile=logFile, zobovDir=zobovDir,
|
logFile=logFile, zobovDir=zobovDir,
|
||||||
useLCDM=useLCDM, continueRun=continueRun)
|
useComoving=sample.useComoving, continueRun=continueRun)
|
||||||
|
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
if (startCatalogStage <= 4) and (endCatalogStage >= 4):
|
if (startCatalogStage <= 4) and (endCatalogStage >= 4):
|
||||||
|
|
|
@ -150,7 +150,7 @@ freshStack = True
|
||||||
errorBars = "CALCULATED"
|
errorBars = "CALCULATED"
|
||||||
numIncoherentRuns = 100
|
numIncoherentRuns = 100
|
||||||
ranSeed = 101010
|
ranSeed = 101010
|
||||||
useLCDM = False
|
useComoving = False
|
||||||
bias = 1.16
|
bias = 1.16
|
||||||
|
|
||||||
dataPortions = {dataPortions}
|
dataPortions = {dataPortions}
|
||||||
|
|
|
@ -77,7 +77,7 @@ class Sample:
|
||||||
includeInHubble = True
|
includeInHubble = True
|
||||||
partOfCombo = False
|
partOfCombo = False
|
||||||
isCombo = False
|
isCombo = False
|
||||||
useLCDM = False # if True, convert population to comoving coordinates
|
useComoving = False # if True, convert population to comoving coordinates
|
||||||
|
|
||||||
comboList = []
|
comboList = []
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ class Sample:
|
||||||
comboList=(), profileBinSize=2.0, skyFraction=0.19,
|
comboList=(), profileBinSize=2.0, skyFraction=0.19,
|
||||||
boxLen=1024, usePecVel=False, omegaM=0.27,
|
boxLen=1024, usePecVel=False, omegaM=0.27,
|
||||||
numSubvolumes=1, mySubvolume=1, dataFormat="sdss",
|
numSubvolumes=1, mySubvolume=1, dataFormat="sdss",
|
||||||
useLCDM=False,
|
useComoving=False,
|
||||||
dataType="observation",
|
dataType="observation",
|
||||||
subsample=1.0, useLightCone=True, autoNumInStack=-1):
|
subsample=1.0, useLightCone=True, autoNumInStack=-1):
|
||||||
self.dataFile = dataFile
|
self.dataFile = dataFile
|
||||||
|
@ -130,7 +130,7 @@ class Sample:
|
||||||
self.subsample = subsample
|
self.subsample = subsample
|
||||||
self.useLightCone = useLightCone
|
self.useLightCone = useLightCone
|
||||||
self.dataUnit = dataUnit
|
self.dataUnit = dataUnit
|
||||||
self.useLCDM = useLCDM
|
self.useComoving = useComoving
|
||||||
self.autoNumInStack = autoNumInStack
|
self.autoNumInStack = autoNumInStack
|
||||||
|
|
||||||
self.stacks = []
|
self.stacks = []
|
||||||
|
|
|
@ -43,7 +43,7 @@ ncFloat = 'f8' # Double precision
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
||||||
zobovDir=None, figDir=None, logFile=None, useLCDM=False,
|
zobovDir=None, figDir=None, logFile=None, useComoving=False,
|
||||||
continueRun=None,regenerate=False):
|
continueRun=None,regenerate=False):
|
||||||
|
|
||||||
if sample.dataType == "observation":
|
if sample.dataType == "observation":
|
||||||
|
@ -63,10 +63,10 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
||||||
|
|
||||||
maskFile = sample.maskFile
|
maskFile = sample.maskFile
|
||||||
|
|
||||||
if useLCDM:
|
if useComoving:
|
||||||
useLCDMFlag = "useLCDM"
|
useComovingFlag = "useComoving"
|
||||||
else:
|
else:
|
||||||
useLCDMFlag = ""
|
useComovingFlag = ""
|
||||||
|
|
||||||
conf="""
|
conf="""
|
||||||
catalog %s
|
catalog %s
|
||||||
|
@ -81,7 +81,7 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
||||||
""" % (datafile, maskFile, outputFile,
|
""" % (datafile, maskFile, outputFile,
|
||||||
zobovDir+"/zobov_slice_"+sampleName+".par",
|
zobovDir+"/zobov_slice_"+sampleName+".par",
|
||||||
sample.zBoundary[0], sample.zBoundary[1], sample.fakeDensity,
|
sample.zBoundary[0], sample.zBoundary[1], sample.fakeDensity,
|
||||||
useLCDMFlag, inputParameterFlag)
|
useComovingFlag, inputParameterFlag)
|
||||||
|
|
||||||
parmFile = os.getcwd()+"/generate_"+sample.fullName+".par"
|
parmFile = os.getcwd()+"/generate_"+sample.fullName+".par"
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
||||||
if sample.dataType == "observation":
|
if sample.dataType == "observation":
|
||||||
(boxVol, nbar) = vp.getSurveyProps(sample.maskFile, sample.zRange[0],
|
(boxVol, nbar) = vp.getSurveyProps(sample.maskFile, sample.zRange[0],
|
||||||
sample.zRange[1], sample.zRange[0], sample.zRange[1], "all",
|
sample.zRange[1], sample.zRange[0], sample.zRange[1], "all",
|
||||||
useLCDM=useLCDM)
|
useComoving=useComoving)
|
||||||
else:
|
else:
|
||||||
iX = float(sample.mySubvolume[0])
|
iX = float(sample.mySubvolume[0])
|
||||||
iY = float(sample.mySubvolume[1])
|
iY = float(sample.mySubvolume[1])
|
||||||
|
@ -357,7 +357,7 @@ def launchZobov(sample, binPath, zobovDir=None, logDir=None, continueRun=None,
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
def launchPrune(sample, binPath,
|
def launchPrune(sample, binPath,
|
||||||
summaryFile=None, logFile=None, zobovDir=None,
|
summaryFile=None, logFile=None, zobovDir=None,
|
||||||
continueRun=None, useLCDM=False):
|
continueRun=None, useComoving=False):
|
||||||
|
|
||||||
sampleName = sample.fullName
|
sampleName = sample.fullName
|
||||||
|
|
||||||
|
@ -385,10 +385,10 @@ def launchPrune(sample, binPath,
|
||||||
|
|
||||||
periodicLine = " --periodic='" + getPeriodic(sample) + "'"
|
periodicLine = " --periodic='" + getPeriodic(sample) + "'"
|
||||||
|
|
||||||
if useLCDM:
|
if useComoving:
|
||||||
useLCDMFlag = " --useLCDM"
|
useComovingFlag = " --useComoving"
|
||||||
else:
|
else:
|
||||||
useLCDMFlag = ""
|
useComovingFlag = ""
|
||||||
|
|
||||||
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"))):
|
||||||
|
@ -410,7 +410,7 @@ def launchPrune(sample, binPath,
|
||||||
cmd += " --numVoids=" + str(numVoids)
|
cmd += " --numVoids=" + str(numVoids)
|
||||||
cmd += observationLine
|
cmd += observationLine
|
||||||
cmd += periodicLine
|
cmd += periodicLine
|
||||||
cmd += useLCDMFlag
|
cmd += useComovingFlag
|
||||||
cmd += " --outputDir=" + zobovDir
|
cmd += " --outputDir=" + zobovDir
|
||||||
cmd += " --sampleName=" + str(sampleName)
|
cmd += " --sampleName=" + str(sampleName)
|
||||||
cmd += " &> " + logFile
|
cmd += " &> " + logFile
|
||||||
|
@ -1460,7 +1460,6 @@ def launchHubble(dataPortions=None, dataSampleList=None, logDir=None,
|
||||||
sys.stdout = open(logFile, 'w')
|
sys.stdout = open(logFile, 'w')
|
||||||
sys.stderr = open(logFile, 'a')
|
sys.stderr = open(logFile, 'a')
|
||||||
if doPlot:
|
if doPlot:
|
||||||
print "DOING PLOT"
|
|
||||||
if INCOHERENT:
|
if INCOHERENT:
|
||||||
#plotTitle = "all samples, incoherent "+\
|
#plotTitle = "all samples, incoherent "+\
|
||||||
# thisDataPortion+" voids"
|
# thisDataPortion+" voids"
|
||||||
|
@ -1486,7 +1485,7 @@ def launchHubble(dataPortions=None, dataSampleList=None, logDir=None,
|
||||||
else:
|
else:
|
||||||
#plotTitle = "all samples, "+thisDataPortion+\
|
#plotTitle = "all samples, "+thisDataPortion+\
|
||||||
# " voids (systematics corrected)"
|
# " voids (systematics corrected)"
|
||||||
plotTitle = setName + "(sysematics corrected)"
|
plotTitle = setName + "(systematics corrected)"
|
||||||
vp.do_all_obs(zbase, allExpList, aveDistList,
|
vp.do_all_obs(zbase, allExpList, aveDistList,
|
||||||
rlist, plotTitle=plotTitle, sampleNames=shortSampleNames,
|
rlist, plotTitle=plotTitle, sampleNames=shortSampleNames,
|
||||||
plotAve=True, mulfac = 1.16,
|
plotAve=True, mulfac = 1.16,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue