mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-06 08:11:12 +00:00
removed mock particle tracking, since that is no longer used
This commit is contained in:
parent
fc2d7157f4
commit
d9efa15474
8 changed files with 71 additions and 173 deletions
|
@ -61,8 +61,6 @@ int main(int argc,char **argv) {
|
|||
double *sorter, e1,maxdenscontrast;
|
||||
int *iord;
|
||||
|
||||
int mockIndex;
|
||||
|
||||
e1 = exp(1.)-1.;
|
||||
|
||||
if (argc != 8) {
|
||||
|
@ -73,7 +71,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];
|
||||
|
@ -85,10 +82,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");
|
||||
|
@ -101,8 +94,6 @@ int main(int argc,char **argv) {
|
|||
exit(0);
|
||||
}
|
||||
fread(&np,1, sizeof(int),adj);
|
||||
if (mockIndex < 0)
|
||||
mockIndex = np;
|
||||
|
||||
printf("adj: %d particles\n", np);
|
||||
FF;
|
||||
|
@ -158,7 +149,7 @@ int main(int argc,char **argv) {
|
|||
for (i=0;i<np;i++) {
|
||||
/* fread(&nin,1,sizeof(int),adj); /* actually nadj */
|
||||
// PMS
|
||||
if (p[i].ncnt != p[i].nadj && i < mockIndex) {
|
||||
if (p[i].ncnt != p[i].nadj && i < np) {
|
||||
/*if (p[i].ncnt != p[i].nadj) {*/
|
||||
// END PMS
|
||||
p[i].nadj = p[i].ncnt;
|
||||
|
@ -183,10 +174,7 @@ int main(int argc,char **argv) {
|
|||
FF;
|
||||
for (i=0;i<np;i++) {
|
||||
fread(&p[i].dens,1,sizeof(float),vol);
|
||||
// PMS
|
||||
if ((p[i].dens < 1e-30) || (p[i].dens > 1e30) && i < mockIndex) {
|
||||
//if ((p[i].dens < 1e-30) || (p[i].dens > 1e30)) {
|
||||
// END PMS
|
||||
if ((p[i].dens < 1e-30) || (p[i].dens > 1e30)) {
|
||||
printf("Whacked-out volume found, of particle %d: %f\n",i,p[i].dens);
|
||||
p[i].dens = 1.;
|
||||
}
|
||||
|
|
|
@ -28,19 +28,17 @@ int main(int argc, char *argv[]) {
|
|||
int numGuards;
|
||||
int b[3];
|
||||
int numThreads;
|
||||
int mockIndex;
|
||||
|
||||
if (argc != 10) {
|
||||
if (argc != 9) {
|
||||
printf("Wrong number of arguments.\n");
|
||||
printf("arg1: position file\n");
|
||||
printf("arg2: buffer size (default 0.1)\n");
|
||||
printf("arg3: box size\n");
|
||||
printf("arg6: number of divisions (default 2)\n");
|
||||
printf("arg7: suffix describing this run\n");
|
||||
printf("arg8: number of parallel threads\n");
|
||||
printf("arg9: location of voboz executables\n");
|
||||
printf("arg10: output directory\n");
|
||||
printf("arg11: index of mock galaxies\n\n");
|
||||
printf("arg4: number of divisions (default 2)\n");
|
||||
printf("arg5: suffix describing this run\n");
|
||||
printf("arg6: number of parallel threads\n");
|
||||
printf("arg7: location of voboz executables\n");
|
||||
printf("arg8: output directory\n");
|
||||
exit(0);
|
||||
}
|
||||
posfile = argv[1];
|
||||
|
@ -72,11 +70,6 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
vobozPath = argv[7];
|
||||
outDir = argv[8];
|
||||
if (sscanf(argv[9],"%d",&mockIndex) != 1) {
|
||||
printf("That's no mock galaxy index; try again.\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
/* Read the position file */
|
||||
np = posread(posfile,&rfloat,1./boxsize);
|
||||
|
@ -187,7 +180,7 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
}
|
||||
fprintf(scr,"wait\n");
|
||||
fprintf(scr,"%s/voztie %d %s %s %d\n", vobozPath, numdiv,suffix, outDir, mockIndex);
|
||||
fprintf(scr,"%s/voztie %d %s %s %d\n", vobozPath, numdiv,suffix, outDir);
|
||||
fclose(scr);
|
||||
|
||||
sprintf(systemstr,"chmod u+x %s",scrfile);
|
||||
|
|
|
@ -34,10 +34,6 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
int numRemoved = 0;
|
||||
|
||||
// PMS
|
||||
int mockIndex;
|
||||
// END PMS
|
||||
|
||||
if (argc != 5) {
|
||||
printf("Wrong number of arguments.\n");
|
||||
printf("arg1: number of divisions (default 2)\n");
|
||||
|
@ -57,10 +53,6 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
suffix = argv[2];
|
||||
outDir = argv[3];
|
||||
if (sscanf(argv[4],"%d",&mockIndex) != 1) {
|
||||
printf("That's no mock galaxy index; try again.\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
np = -1; nvpmax = -1; nvpsum = 0;
|
||||
|
||||
|
@ -92,10 +84,6 @@ int main(int argc, char *argv[]) {
|
|||
printf("We have %d particles to tie together.\n",np); fflush(stdout);
|
||||
printf("The maximum number of particles in a file is %d.\n",nvpmax);
|
||||
|
||||
// PMS
|
||||
if (mockIndex == -1) mockIndex = np;
|
||||
// END PMS
|
||||
|
||||
cnt_adj = (int *)malloc(np*sizeof(int));
|
||||
if (cnt_adj == NULL)
|
||||
printf("Could not allocate cnt_adj.\n");
|
||||
|
@ -137,7 +125,7 @@ int main(int argc, char *argv[]) {
|
|||
for (p=0;p<nvp;p++) {
|
||||
fread(&volstemp,1,sizeof(float),part);
|
||||
if (vols[orig[p]] > -1.)
|
||||
if (fabs(vols[orig[p]]-volstemp)/volstemp > 1.5e-3 && orig[p] < mockIndex) {
|
||||
if (fabs(vols[orig[p]]-volstemp)/volstemp > 1.5e-3) {
|
||||
printf("Inconsistent volumes for p. %d: (%10g,%10g)!\n",
|
||||
orig[p],vols[orig[p]],volstemp);
|
||||
//exit(0);
|
||||
|
@ -183,16 +171,10 @@ int main(int argc, char *argv[]) {
|
|||
// PMS : remove mock galaxies and anything adjacent to a mock galaxy
|
||||
printf("\nRemoving mock galaxies...\n");
|
||||
|
||||
// completely unlink mock particles
|
||||
for (i = mockIndex; i < np; i++) {
|
||||
vols[i] = 1.e-29;
|
||||
adjs[i].nadj = 0;
|
||||
}
|
||||
|
||||
// unlink particles adjacent to mock galaxies
|
||||
for (i = 0; i < mockIndex; i++) {
|
||||
for (i = 0; i < np; i++) {
|
||||
for (j = 0; j < adjs[i].nadj; j++) {
|
||||
if (adjs[i].adj[j] > mockIndex) {
|
||||
if (adjs[i].adj[j] > np) {
|
||||
//printf("KILLING %d\n", i);
|
||||
vols[i] = 1.e-29;
|
||||
adjs[i].nadj = 0;
|
||||
|
@ -203,7 +185,7 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
|
||||
// update all other adjacencies
|
||||
for (i = 0; i < mockIndex; i++) {
|
||||
for (i = 0; i < np; i++) {
|
||||
|
||||
int numAdjSaved = 0;
|
||||
for (j = 0; j < adjs[i].nadj; j++) {
|
||||
|
@ -217,10 +199,6 @@ int main(int argc, char *argv[]) {
|
|||
adjs[i].nadj = numAdjSaved;
|
||||
}
|
||||
|
||||
printf("Removed %d mock galaxies and %d adjacent galaxies.\n", np-mockIndex,
|
||||
numRemoved);
|
||||
printf("There are %d galaxies remaining.\n", mockIndex-numRemoved);
|
||||
|
||||
// END PMS
|
||||
*/
|
||||
|
||||
|
@ -254,19 +232,19 @@ int main(int argc, char *argv[]) {
|
|||
printf("Unable to open %s\n",adjfile);
|
||||
exit(0);
|
||||
}
|
||||
fwrite(&mockIndex,1, sizeof(int),adj);
|
||||
fwrite(&np,1, sizeof(int),adj);
|
||||
/* Adjacencies: first the numbers of adjacencies,
|
||||
and the number we're actually going to write per particle */
|
||||
|
||||
// Recount the number of adjacencies after merge
|
||||
for(i=0;i<mockIndex;i++)
|
||||
for(i=0;i<np;i++)
|
||||
cnt_adj[i] = adjs[i].nadj;
|
||||
|
||||
for (i=0;i<mockIndex;i++)
|
||||
for (i=0;i<np;i++)
|
||||
fwrite(&cnt_adj[i],1,sizeof(int),adj);
|
||||
|
||||
/* Now the lists of adjacencies (without double counting) */
|
||||
for (i=0;i<mockIndex;i++) {
|
||||
for (i=0;i<np;i++) {
|
||||
nout = 0;
|
||||
for (j=0;j<adjs[i].nadj; j++)
|
||||
if (adjs[i].adj[j] > i)
|
||||
|
@ -287,12 +265,8 @@ int main(int argc, char *argv[]) {
|
|||
printf("Unable to open %s\n",volfile);
|
||||
exit(0);
|
||||
}
|
||||
// PMS
|
||||
fwrite(&mockIndex,1, sizeof(int),vol);
|
||||
fwrite(vols,sizeof(float),mockIndex,vol);
|
||||
//fwrite(&np,1, sizeof(int),vol);
|
||||
//fwrite(vols,sizeof(float),np,vol);
|
||||
// END PMS
|
||||
fwrite(&np,1, sizeof(int),vol);
|
||||
fwrite(vols,sizeof(float),np,vol);
|
||||
|
||||
fclose(vol);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue