mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-05 07:41:11 +00:00
changed from parent ID to parent index for faster searching; NOTE that output in void catalog changed to reflect this
This commit is contained in:
parent
b9042c5ce7
commit
a670b86295
1 changed files with 9 additions and 16 deletions
|
@ -81,7 +81,7 @@ typedef struct voidStruct {
|
||||||
float center[3], macrocenter[3];
|
float center[3], macrocenter[3];
|
||||||
int accepted;
|
int accepted;
|
||||||
int voidType;
|
int voidType;
|
||||||
int parentID, numChildren, level;
|
int parentIndx, numChildren, level;
|
||||||
bool isLeaf, hasHighCentralDen;
|
bool isLeaf, hasHighCentralDen;
|
||||||
gsl_vector *eval;
|
gsl_vector *eval;
|
||||||
gsl_matrix *evec;
|
gsl_matrix *evec;
|
||||||
|
@ -339,8 +339,8 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
voids[i-1].isLeaf = true;
|
voids[i-1].isLeaf = true;
|
||||||
voids[i-1].hasHighCentralDen = false;
|
voids[i-1].hasHighCentralDen = false;
|
||||||
|
voids[i-1].parentIndx = -1;
|
||||||
voids[i-1].numChildren = 0;
|
voids[i-1].numChildren = 0;
|
||||||
voids[i-1].parentID = -1;
|
|
||||||
voids[i-1].level = 0;
|
voids[i-1].level = 0;
|
||||||
|
|
||||||
voids[i-1].eval = gsl_vector_alloc(3);
|
voids[i-1].eval = gsl_vector_alloc(3);
|
||||||
|
@ -515,7 +515,7 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allZonesMatch) {
|
if (allZonesMatch) {
|
||||||
voids[iVoid].parentID = checkID;
|
voids[iVoid].parentIndx = iCheck;
|
||||||
voids[iCheck].numChildren++;
|
voids[iCheck].numChildren++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -525,17 +525,10 @@ int main(int argc, char **argv) {
|
||||||
// compute level in tree
|
// compute level in tree
|
||||||
for (iVoid = 0; iVoid < numVoids; iVoid++) {
|
for (iVoid = 0; iVoid < numVoids; iVoid++) {
|
||||||
int level = 0;
|
int level = 0;
|
||||||
int parentID = voids[iVoid].parentID;
|
int parentIndx = voids[iVoid].parentIndx;
|
||||||
while (parentID != -1) {
|
while (parentIndx != -1) {
|
||||||
level++;
|
level++;
|
||||||
|
parentIndx = voids[parentIndx].parentIndx;
|
||||||
// find the index of the parent
|
|
||||||
for (i = 0; i < numVoids; i++) {
|
|
||||||
if (voids[i].voidID == parentID) {
|
|
||||||
parentID = voids[i].voidID;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
voids[iVoid].level = level;
|
voids[iVoid].level = level;
|
||||||
}
|
}
|
||||||
|
@ -951,7 +944,7 @@ int main(int argc, char **argv) {
|
||||||
numAreParents = 0;
|
numAreParents = 0;
|
||||||
iGood = 0;
|
iGood = 0;
|
||||||
for (iVoid = 0; iVoid < voids.size(); iVoid++) {
|
for (iVoid = 0; iVoid < voids.size(); iVoid++) {
|
||||||
if (voids[iVoid].parentID != -1) {
|
if (voids[iVoid].parentIndx != -1) {
|
||||||
numAreParents++;
|
numAreParents++;
|
||||||
voids[iVoid].isLeaf = true;
|
voids[iVoid].isLeaf = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1039,7 +1032,7 @@ void openFiles(string outputDir, string sampleName,
|
||||||
*fpBarycenter = fopen((outputDir+"/"+prefix+"macrocenters_"+dataPortion+"_"+sampleName).c_str(), "w");
|
*fpBarycenter = fopen((outputDir+"/"+prefix+"macrocenters_"+dataPortion+"_"+sampleName).c_str(), "w");
|
||||||
|
|
||||||
*fpCenters = fopen((outputDir+"/"+prefix+"centers_"+dataPortion+"_"+sampleName).c_str(), "w");
|
*fpCenters = fopen((outputDir+"/"+prefix+"centers_"+dataPortion+"_"+sampleName).c_str(), "w");
|
||||||
fprintf(*fpCenters, "# center x,y,z (Mpc/h), volume (normalized), radius (Mpc/h), redshift, volume (Mpc/h^3), void ID, density contrast, num part, parent ID, tree level, number of children, central density\n");
|
fprintf(*fpCenters, "# center x,y,z (Mpc/h), volume (normalized), radius (Mpc/h), redshift, volume (Mpc/h^3), void ID, density contrast, num part, parent index, tree level, number of children, central density\n");
|
||||||
|
|
||||||
*fpSkyPositions = fopen((outputDir+"/"+prefix+"sky_positions_"+dataPortion+"_"+sampleName).c_str(), "w");
|
*fpSkyPositions = fopen((outputDir+"/"+prefix+"sky_positions_"+dataPortion+"_"+sampleName).c_str(), "w");
|
||||||
fprintf(*fpSkyPositions, "# RA, dec, redshift, radius (Mpc/h), void ID\n");
|
fprintf(*fpSkyPositions, "# RA, dec, redshift, radius (Mpc/h), void ID\n");
|
||||||
|
@ -1145,7 +1138,7 @@ void outputVoids(string outputDir, string sampleName, string prefix,
|
||||||
outVoid.voidID,
|
outVoid.voidID,
|
||||||
outVoid.densCon,
|
outVoid.densCon,
|
||||||
outVoid.numPart,
|
outVoid.numPart,
|
||||||
outVoid.parentID,
|
outVoid.parentIndx,
|
||||||
outVoid.level,
|
outVoid.level,
|
||||||
outVoid.numChildren,
|
outVoid.numChildren,
|
||||||
outVoid.centralDen);
|
outVoid.centralDen);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue