From 091cf5d1dcf52063dbc641f9471c89564c19a2a1 Mon Sep 17 00:00:00 2001 From: "Paul M. Sutter" Date: Thu, 9 Jan 2025 18:21:26 +0800 Subject: [PATCH] First steps in purging the tracking of mock particles: no longer present in jovoz2 --- c_source/jozov2/jozov2.cpp | 15 +++------------ c_source/jozov2/jozov2.hpp | 3 +-- c_source/jozov2/jozov2_io.cpp | 5 ++--- c_source/zobov/voz.h | 4 ++-- python_source/backend/launchers.py | 3 ++- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/c_source/jozov2/jozov2.cpp b/c_source/jozov2/jozov2.cpp index f4cb142..ea14344 100644 --- a/c_source/jozov2/jozov2.cpp +++ b/c_source/jozov2/jozov2.cpp @@ -51,9 +51,7 @@ int main(int argc,char **argv) double *sorter; int *iord; - int mockIndex; - - if (argc != 8) { + if (argc != 7) { printf("Wrong number of arguments.\n"); printf("arg1: adjacency file\n"); printf("arg2: volume file\n"); @@ -61,7 +59,6 @@ int main(int argc,char **argv) printf("arg4: output file containing zones in each void\n"); printf("arg5: output text file\n"); printf("arg6: Density threshold (0 for no threshold)\n"); - printf("arg7: Beginning index of mock galaxies\n\n"); exit(0); } adjfile = argv[1]; @@ -73,10 +70,6 @@ int main(int argc,char **argv) printf("Bad density threshold.\n"); exit(0); } - if (sscanf(argv[7],"%d",&mockIndex) == 0) { - printf("Bad mock galaxy index.\n"); - exit(0); - } printf("TOLERANCE: %f\n", voltol); if (voltol <= 0.) { printf("Proceeding without a density threshold.\n"); @@ -91,13 +84,11 @@ int main(int argc,char **argv) { return 1; } - if (mockIndex < 0) - mockIndex = np; /* Check that we got all the pairs */ for (int i = 0; i < np; i++) { - if (p[i].ncnt != p[i].nadj && i < mockIndex) { + if (p[i].ncnt != p[i].nadj) { cout << format("We didn't get all of %d's adj's; %d != %d.") % i % p[i].ncnt % p[i].nadj @@ -109,7 +100,7 @@ int main(int argc,char **argv) /* Volumes */ try { - readVolumeFile(volfile, p, np, mockIndex); + readVolumeFile(volfile, p, np); } catch (const FileError& e) { diff --git a/c_source/jozov2/jozov2.hpp b/c_source/jozov2/jozov2.hpp index 5def611..5475c4b 100644 --- a/c_source/jozov2/jozov2.hpp +++ b/c_source/jozov2/jozov2.hpp @@ -34,8 +34,7 @@ class FileError: virtual std::exception void readAdjacencyFile(const std::string& adjfile, PARTICLE*& p, pid_t& np) throw(FileError); -void readVolumeFile(const std::string& volfile, PARTICLE *p, pid_t np, - pid_t mockIndex) +void readVolumeFile(const std::string& volfile, PARTICLE *p, pid_t np) throw(FileError); void buildInitialZones(PARTICLE *p, pid_t np, pid_t* jumped, diff --git a/c_source/jozov2/jozov2_io.cpp b/c_source/jozov2/jozov2_io.cpp index cc6abf7..72c5db2 100644 --- a/c_source/jozov2/jozov2_io.cpp +++ b/c_source/jozov2/jozov2_io.cpp @@ -103,8 +103,7 @@ void readAdjacencyFile(const string& adjfile, PARTICLE*& p, pid_t& np) } } -void readVolumeFile(const std::string& volfile, PARTICLE *p, pid_t np, - pid_t mockIndex) +void readVolumeFile(const std::string& volfile, PARTICLE *p, pid_t np) throw(FileError) { ifstream vol(volfile.c_str()); @@ -125,7 +124,7 @@ void readVolumeFile(const std::string& volfile, PARTICLE *p, pid_t np, for (pid_t i = 0; i < np; i++) { vol.read((char*)&p[i].dens, sizeof(float)); - if (((p[i].dens < 1e-30) || (p[i].dens > 1e30)) && (i < mockIndex)) { + if ((p[i].dens < 1e-30) || (p[i].dens > 1e30)) { cout << format("Whacked-out volume found, of particle %d: %f") % i % p[i].dens << endl; p[i].dens = 1.; } diff --git a/c_source/zobov/voz.h b/c_source/zobov/voz.h index fb56279..f71e1fb 100644 --- a/c_source/zobov/voz.h +++ b/c_source/zobov/voz.h @@ -1,7 +1,7 @@ #define MAXVERVER 100000 -#define NGUARD 84 /*Actually, the number of SPACES between guard points -##define NGUARD 42 /*Actually, the number of SPACES between guard points +#define NGUARD 42 /*Actually, the number of SPACES between guard points in each dim */ +//#define NGUARD 84 /*Actually, the number of SPACES between guard points typedef int pid_t; diff --git a/python_source/backend/launchers.py b/python_source/backend/launchers.py index 84c8606..44e5be2 100644 --- a/python_source/backend/launchers.py +++ b/python_source/backend/launchers.py @@ -500,7 +500,8 @@ def launchZobov(sample, binPath, outputDir=None, logDir=None, continueRun=None, outputDir+"/voidPart_"+sampleName+".dat", \ outputDir+"/voidZone_"+sampleName+".dat", \ outputDir+"/voidDesc_"+sampleName+".out", \ - str(maxDen), str(maskIndex)] + str(maxDen) + ] log = open(logFile, 'a') subprocess.call(cmd, stdout=log, stderr=log) log.close()