switched variable name useLCDM to less confusing useComoving; make it sample-level rather than dataset-level

This commit is contained in:
P.M. Sutter 2013-12-19 12:38:05 -06:00
parent 34a32bfd2c
commit f268820a2e
8 changed files with 25 additions and 26 deletions

View file

@ -115,7 +115,7 @@ void loadData(const string& fname, NYU_VData & data)
}
void generateGalaxiesInCube(NYU_VData& data, ParticleData& output_data,
bool useLCDM)
bool useComoving)
{
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;
Position& p = output_data.pos[i];
if (useLCDM) {
if (useComoving) {
//double pos = gsl_interp_eval(interp, redshifts, dL, data[i].cz, acc);
gsl_integration_qng(&expanF, 1.e-6, data[i].cz/LIGHT_SPEED,
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
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,
data, output_data);

View file

@ -14,4 +14,4 @@ option "zMax" - "Maximum redshift of data" double required
option "output" - "Filename of particle datafile" 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

View file

@ -724,7 +724,7 @@ int main(int argc, char **argv) {
voids[iVoid].redshiftInMpc = voids[iVoid].redshiftInMpc;
if (args.useLCDM_flag) {
if (args.useComoving_flag) {
redshift = gsl_interp_eval(interp, dL, redshifts,
voids[iVoid].redshiftInMpc, acc);
//printf("HELLO %e %e\n", redshift, args.zMax_arg);

View file

@ -23,7 +23,7 @@ option "numVoids" - "Number of voids" int required
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 "zMax" - "Maximum redshift of sample" double optional default="10.0"

View file

@ -1,6 +1,6 @@
#!/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) 2011-2013 P. M. Sutter
#
@ -91,7 +91,7 @@ for sample in dataSampleList:
launchGenerate(sample, GENERATE_PATH, workDir=workDir,
inputDataDir=inputDataDir, zobovDir=zobovDir,
figDir=figDir, logFile=logFile, useLCDM=useLCDM,
figDir=figDir, logFile=logFile, useComoving=sample.useComoving,
continueRun=continueRun, regenerate=regenerateFlag)
# --------------------------------------------------------------------------
@ -115,7 +115,7 @@ for sample in dataSampleList:
launchPrune(sample, PRUNE_PATH,
logFile=logFile, zobovDir=zobovDir,
useLCDM=useLCDM, continueRun=continueRun)
useComoving=sample.useComoving, continueRun=continueRun)
# -------------------------------------------------------------------------
if (startCatalogStage <= 4) and (endCatalogStage >= 4):

View file

@ -150,7 +150,7 @@ freshStack = True
errorBars = "CALCULATED"
numIncoherentRuns = 100
ranSeed = 101010
useLCDM = False
useComoving = False
bias = 1.16
dataPortions = {dataPortions}

View file

@ -77,7 +77,7 @@ class Sample:
includeInHubble = True
partOfCombo = False
isCombo = False
useLCDM = False # if True, convert population to comoving coordinates
useComoving = False # if True, convert population to comoving coordinates
comboList = []
@ -99,7 +99,7 @@ class Sample:
comboList=(), profileBinSize=2.0, skyFraction=0.19,
boxLen=1024, usePecVel=False, omegaM=0.27,
numSubvolumes=1, mySubvolume=1, dataFormat="sdss",
useLCDM=False,
useComoving=False,
dataType="observation",
subsample=1.0, useLightCone=True, autoNumInStack=-1):
self.dataFile = dataFile
@ -130,7 +130,7 @@ class Sample:
self.subsample = subsample
self.useLightCone = useLightCone
self.dataUnit = dataUnit
self.useLCDM = useLCDM
self.useComoving = useComoving
self.autoNumInStack = autoNumInStack
self.stacks = []

View file

@ -43,7 +43,7 @@ ncFloat = 'f8' # Double precision
# -----------------------------------------------------------------------------
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):
if sample.dataType == "observation":
@ -63,10 +63,10 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
maskFile = sample.maskFile
if useLCDM:
useLCDMFlag = "useLCDM"
if useComoving:
useComovingFlag = "useComoving"
else:
useLCDMFlag = ""
useComovingFlag = ""
conf="""
catalog %s
@ -81,7 +81,7 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
""" % (datafile, maskFile, outputFile,
zobovDir+"/zobov_slice_"+sampleName+".par",
sample.zBoundary[0], sample.zBoundary[1], sample.fakeDensity,
useLCDMFlag, inputParameterFlag)
useComovingFlag, inputParameterFlag)
parmFile = os.getcwd()+"/generate_"+sample.fullName+".par"
@ -244,7 +244,7 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
if sample.dataType == "observation":
(boxVol, nbar) = vp.getSurveyProps(sample.maskFile, sample.zRange[0],
sample.zRange[1], sample.zRange[0], sample.zRange[1], "all",
useLCDM=useLCDM)
useComoving=useComoving)
else:
iX = float(sample.mySubvolume[0])
iY = float(sample.mySubvolume[1])
@ -357,7 +357,7 @@ def launchZobov(sample, binPath, zobovDir=None, logDir=None, continueRun=None,
# -----------------------------------------------------------------------------
def launchPrune(sample, binPath,
summaryFile=None, logFile=None, zobovDir=None,
continueRun=None, useLCDM=False):
continueRun=None, useComoving=False):
sampleName = sample.fullName
@ -385,10 +385,10 @@ def launchPrune(sample, binPath,
periodicLine = " --periodic='" + getPeriodic(sample) + "'"
if useLCDM:
useLCDMFlag = " --useLCDM"
if useComoving:
useComovingFlag = " --useComoving"
else:
useLCDMFlag = ""
useComovingFlag = ""
if not (continueRun and (jobSuccessful(logFile, "NetCDF: Not a valid ID\n") \
or jobSuccessful(logFile, "Done!\n"))):
@ -410,7 +410,7 @@ def launchPrune(sample, binPath,
cmd += " --numVoids=" + str(numVoids)
cmd += observationLine
cmd += periodicLine
cmd += useLCDMFlag
cmd += useComovingFlag
cmd += " --outputDir=" + zobovDir
cmd += " --sampleName=" + str(sampleName)
cmd += " &> " + logFile
@ -1460,7 +1460,6 @@ def launchHubble(dataPortions=None, dataSampleList=None, logDir=None,
sys.stdout = open(logFile, 'w')
sys.stderr = open(logFile, 'a')
if doPlot:
print "DOING PLOT"
if INCOHERENT:
#plotTitle = "all samples, incoherent "+\
# thisDataPortion+" voids"
@ -1486,7 +1485,7 @@ def launchHubble(dataPortions=None, dataSampleList=None, logDir=None,
else:
#plotTitle = "all samples, "+thisDataPortion+\
# " voids (systematics corrected)"
plotTitle = setName + "(sysematics corrected)"
plotTitle = setName + "(systematics corrected)"
vp.do_all_obs(zbase, allExpList, aveDistList,
rlist, plotTitle=plotTitle, sampleNames=shortSampleNames,
plotAve=True, mulfac = 1.16,