First steps in purging the tracking of mock particles: no longer present in jovoz2

This commit is contained in:
Paul M. Sutter 2025-01-09 18:21:26 +08:00
parent a1d0b675c7
commit 091cf5d1dc
5 changed files with 10 additions and 20 deletions

View file

@ -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)
{

View file

@ -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,

View file

@ -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.;
}

View file

@ -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;

View file

@ -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()