mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
removed extranneous tree-building routines
This commit is contained in:
parent
49fcdedc92
commit
c924577a0d
2 changed files with 19 additions and 13 deletions
|
@ -41,8 +41,6 @@
|
|||
#include "pruneVoids_conf.h"
|
||||
#include <vector>
|
||||
#include "assert.h"
|
||||
#include "voidTree.hpp"
|
||||
#include "loadZobov.hpp"
|
||||
#include <gsl/gsl_integration.h>
|
||||
#include <gsl/gsl_interp.h>
|
||||
|
||||
|
@ -81,7 +79,7 @@ typedef struct voidStruct {
|
|||
float center[3], macrocenter[3];
|
||||
int accepted;
|
||||
int voidType;
|
||||
int parentIndx, numChildren, level;
|
||||
int parentID, numChildren, level;
|
||||
bool isLeaf, hasHighCentralDen;
|
||||
gsl_vector *eval;
|
||||
gsl_matrix *evec;
|
||||
|
@ -333,7 +331,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
voids[i-1].isLeaf = true;
|
||||
voids[i-1].hasHighCentralDen = false;
|
||||
voids[i-1].parentIndx = -1;
|
||||
voids[i-1].parentID = -1;
|
||||
voids[i-1].numChildren = 0;
|
||||
voids[i-1].level = 0;
|
||||
|
||||
|
@ -509,20 +507,28 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
if (allZonesMatch) {
|
||||
voids[iVoid].parentIndx = iCheck;
|
||||
voids[iVoid].parentID = checkID;
|
||||
voids[iCheck].numChildren++;
|
||||
}
|
||||
}
|
||||
|
||||
} // end building tree
|
||||
|
||||
// compute level in tree
|
||||
// find level in tree
|
||||
for (iVoid = 0; iVoid < numVoids; iVoid++) {
|
||||
int level = 0;
|
||||
int parentIndx = voids[iVoid].parentIndx;
|
||||
while (parentIndx != -1) {
|
||||
int parentIndx = iVoid;
|
||||
int parentID = voids[iVoid].parentID;
|
||||
while (parentID != -1) {
|
||||
level++;
|
||||
parentIndx = voids[parentIndx].parentIndx;
|
||||
parentID = voids[parentIndx].parentID;
|
||||
// get the index of parent void
|
||||
for (int iCheck = 0; iCheck < numVoids; iCheck++){
|
||||
if (voids[iCheck].voidID == parentID) {
|
||||
parentIndx = iCheck;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
voids[iVoid].level = level;
|
||||
}
|
||||
|
@ -888,7 +894,7 @@ int main(int argc, char **argv) {
|
|||
numAreParents = 0;
|
||||
iGood = 0;
|
||||
for (iVoid = 0; iVoid < voids.size(); iVoid++) {
|
||||
if (voids[iVoid].parentIndx != -1) {
|
||||
if (voids[iVoid].parentID != -1) {
|
||||
numAreParents++;
|
||||
voids[iVoid].isLeaf = true;
|
||||
} else {
|
||||
|
@ -976,7 +982,7 @@ void openFiles(string outputDir, string sampleName,
|
|||
*fpBarycenter = fopen((outputDir+"/"+prefix+"macrocenters_"+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 index, 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 ID, tree level, number of children, central density\n");
|
||||
|
||||
*fpSkyPositions = fopen((outputDir+"/"+prefix+"sky_positions_"+dataPortion+"_"+sampleName).c_str(), "w");
|
||||
fprintf(*fpSkyPositions, "# RA, dec, redshift, radius (Mpc/h), void ID\n");
|
||||
|
@ -1082,7 +1088,7 @@ void outputVoids(string outputDir, string sampleName, string prefix,
|
|||
outVoid.voidID,
|
||||
outVoid.densCon,
|
||||
outVoid.numPart,
|
||||
outVoid.parentIndx,
|
||||
outVoid.parentID,
|
||||
outVoid.level,
|
||||
outVoid.numChildren,
|
||||
outVoid.centralDen);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
add_library(zobovTool loadZobov.cpp particleInfo.cpp contour_pixels.cpp)
|
||||
add_library(zobovTool contour_pixels.cpp)
|
||||
|
||||
set_target_properties(zobovTool PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
|
||||
target_link_libraries(zobovTool ${COSMOTOOL_LIBRARY} ${GSL_LIBRARIES} ${NETCDF_LIBRARIES} ${HDF5_CXX_LIBRARIES} ${HDF5_HL_LIBRARIES} ${HDF5_LIBRARIES} ${DL_LIBRARY})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue