central density calculation now uses correct normalization from survey volume

This commit is contained in:
Paul M. Sutter 2025-04-23 15:25:26 -04:00
parent 5bff8c0da3
commit 40d7793e54
2 changed files with 10 additions and 9 deletions

View file

@ -200,7 +200,7 @@ int main(int argc, char **argv) {
char line[500], junkStr[10];
string outputDir, sampleName, dataPortion, prefix;
double ranges[3][2], boxLen[3], mul;
double volNorm, radius;
double volNormZobov, volNormObs, radius;
int clock1, clock2, clock3, clock4;
double interval;
int periodicX=0, periodicY=0, periodicZ=0;
@ -263,10 +263,8 @@ int main(int argc, char **argv) {
part = (PART *) malloc(numPartTot * sizeof(PART));
temp = (float *) malloc(numPartTot * sizeof(float));
// this is the volume normalization understood by zobov,
// which is all particles (including mock boundary galaxies used in old
// versions of VIDE) divided by the total volume of the bounding box
volNorm = numPartTot/(boxLen[0]*boxLen[1]*boxLen[2]);
volNormZobov = args.volNormZobov_arg;
volNormObs = args.volNormObs_arg;
fread(&dummy, 1, 4, fp);
fread(temp, numPartTot, 4, fp);
@ -326,7 +324,7 @@ int main(int argc, char **argv) {
voids[i-1].densCon = densCon;
voids[i-1].voidProb = voidProb;
voids[i-1].radius = pow(voidVol/volNorm*3./4./M_PI, 1./3.);
voids[i-1].radius = pow(voidVol/volNormZobov*3./4./M_PI, 1./3.);
voids[i-1].accepted = 1;
voids[i-1].isLeaf = true;
@ -692,7 +690,7 @@ int main(int argc, char **argv) {
dist2 = pow(dist[0],2) + pow(dist[1],2) + pow(dist[2],2);
if (sqrt(dist2) < centralRad) numCentral += 1;
}
voids[iVoid].centralDen = numCentral / (volNorm*4./3. * M_PI *
voids[iVoid].centralDen = numCentral / (volNormObs*4./3. * M_PI *
pow(centralRad, 3.));
clock4 = clock();
@ -926,9 +924,8 @@ int main(int argc, char **argv) {
printf(" Number kept: %d (out of %d)\n", (int) voids.size(), numVoids);
printf(" We have %d edge voids\n", numEdge);
printf(" We have %d central voids\n", numCentral);
printf(" We have %d too high central density\n", numHighDen);
printf(" We have %d high central density\n", numHighDen);
printf(" We have %d that are not leaf nodes\n", numAreParents);
outputDir = string(args.outputDir_arg);
sampleName = (string(args.sampleName_arg)+".out");

View file

@ -28,6 +28,10 @@ option "useComoving" - "Void positions are in comoving coordinates" flag off
option "omegaM" - "Omega_M for redshift convertion" double optional default="0.27"
option "volNormZobov" - "Volume normalization as understood by zobox" double optional default="1.0"
option "volNormObs" - "Volume normalization within the survey volume" double optional default="1.0"
option "rMin" - "Minimum allowable void radius" double optional default="0.0"
option "outputDir" - "Directory to place outputs" string required