mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
more bug fixes for the minimum halo mass cuts...sigh
This commit is contained in:
parent
9d97522472
commit
80c2b7f603
9 changed files with 41 additions and 41 deletions
17
README
17
README
|
@ -1,13 +1,10 @@
|
||||||
After compiling, go to the pipeline directory.
|
After compiling, go to the pipeline directory.
|
||||||
|
|
||||||
Edit the parameters at the top of prepareGadgetCatalog.py: decide
|
Create a dataset parameter file. Look at datasets/multidark.py for
|
||||||
where to put outputs, how many redshifts to do, how many slices,
|
an example. Describe the simulation, where to put outputs, how many
|
||||||
subdivisions, subsamples, etc. etc.
|
redshift slices, subvolumes, etc. etc.
|
||||||
|
|
||||||
Note that eventually prepareGadgetCatalog will be replaced by the more
|
prepareCatalogs will produce a pipeline script for each
|
||||||
general and flexible prepareCatalogs.
|
|
||||||
|
|
||||||
prepareGadgetCatalogs will produce a pipeline script for each
|
|
||||||
subsampling you choose. If you have multiple redshift particle files,
|
subsampling you choose. If you have multiple redshift particle files,
|
||||||
and choose multiple slices and/or subdivisions, they will be packaged
|
and choose multiple slices and/or subdivisions, they will be packaged
|
||||||
in the same pipeline script.
|
in the same pipeline script.
|
||||||
|
@ -22,16 +19,10 @@ Check the logfiles for any error messages.
|
||||||
See the README of the public void catalog for the format of the
|
See the README of the public void catalog for the format of the
|
||||||
outputs.
|
outputs.
|
||||||
|
|
||||||
I'm also working on incorporating plotting into the pipeline script,
|
|
||||||
so that you can immediately get some basic info about the voids.
|
|
||||||
|
|
||||||
Please do not change the outputs of pruneVoids etc. without
|
Please do not change the outputs of pruneVoids etc. without
|
||||||
discussion, since further analysis relies on the current formats.
|
discussion, since further analysis relies on the current formats.
|
||||||
|
|
||||||
If you're wondering why these scripts are rather complex, it's because
|
If you're wondering why these scripts are rather complex, it's because
|
||||||
it can also support A-P analysis, which is much more complicated :)
|
it can also support A-P analysis, which is much more complicated :)
|
||||||
|
|
||||||
We can talk about ways to incorporate your analysis into the pipline
|
|
||||||
and to have your tools under this umbrella.
|
|
||||||
|
|
||||||
Good luck!
|
Good luck!
|
||||||
|
|
|
@ -295,10 +295,10 @@ void generateSurfaceMask(generateFromCatalog_info& args ,
|
||||||
|
|
||||||
int nPart = 100;
|
int nPart = 100;
|
||||||
// TEST
|
// TEST
|
||||||
//for (int iDir = 0; iDir < 0; iDir++) {
|
for (int iDir = 0; iDir < 0; iDir++) {
|
||||||
//for (int iFace = 0; iFace < 0; iFace++) {
|
for (int iFace = 0; iFace < 0; iFace++) {
|
||||||
for (int iDir = 0; iDir < 3; iDir++) {
|
//for (int iDir = 0; iDir < 3; iDir++) {
|
||||||
for (int iFace = 0; iFace < 2; iFace++) {
|
//for (int iFace = 0; iFace < 2; iFace++) {
|
||||||
|
|
||||||
int iy = (iDir + 1) % 3;
|
int iy = (iDir + 1) % 3;
|
||||||
int iz = (iDir + 2) % 3;
|
int iz = (iDir + 2) % 3;
|
||||||
|
|
|
@ -179,14 +179,18 @@ SimuData *doLoadMultidark(const char *multidarkname)
|
||||||
outd->Pos[k] = new float[outd->NumPart];
|
outd->Pos[k] = new float[outd->NumPart];
|
||||||
outd->Vel[2] = new float[outd->NumPart];
|
outd->Vel[2] = new float[outd->NumPart];
|
||||||
outd->Id = new int[outd->NumPart];
|
outd->Id = new int[outd->NumPart];
|
||||||
|
outd->uniqueID = new float[outd->NumPart];
|
||||||
|
|
||||||
cout << "loading multidark particles" << endl;
|
cout << "loading multidark particles" << endl;
|
||||||
actualNumPart = 0;
|
actualNumPart = 0;
|
||||||
for (int i = 0; i < outd->NumPart; i++) {
|
for (int i = 0; i < outd->NumPart; i++) {
|
||||||
fscanf(fp, "%d %d %f %f %f\n", &outd->Id[i],
|
fscanf(fp, "%d %f %f %f %f\n", &outd->Id[i],
|
||||||
&outd->Pos[0][i], &outd->Pos[1][i],
|
&outd->Pos[0][i], &outd->Pos[1][i],
|
||||||
&outd->Pos[2][i], &outd->Vel[2][i]);
|
&outd->Pos[2][i], &outd->Vel[2][i]);
|
||||||
|
|
||||||
|
outd->uniqueID[i] = 1.0;
|
||||||
|
//outd->uniqueID[i] = 1.0 * outd->Id[i];
|
||||||
|
|
||||||
if (outd->Id[i] == -99 &&
|
if (outd->Id[i] == -99 &&
|
||||||
outd->Pos[0][i] == -99 && outd->Pos[1][i] == -99 &&
|
outd->Pos[0][i] == -99 && outd->Pos[1][i] == -99 &&
|
||||||
outd->Pos[2][i] == -99 && outd->Vel[2][i] == -99) {
|
outd->Pos[2][i] == -99 && outd->Vel[2][i] == -99) {
|
||||||
|
@ -368,7 +372,7 @@ void generateOutput(SimuData *data, int axis,
|
||||||
f.beginCheckpoint();
|
f.beginCheckpoint();
|
||||||
for (uint32_t i = 0; i < data->NumPart; i++)
|
for (uint32_t i = 0; i < data->NumPart; i++)
|
||||||
{
|
{
|
||||||
f.writeReal32(data->Id[i]);
|
f.writeReal32(data->Pos[x0][i]);
|
||||||
}
|
}
|
||||||
f.endCheckpoint();
|
f.endCheckpoint();
|
||||||
|
|
||||||
|
@ -376,7 +380,7 @@ void generateOutput(SimuData *data, int axis,
|
||||||
f.beginCheckpoint();
|
f.beginCheckpoint();
|
||||||
for (uint32_t i = 0; i < data->NumPart; i++)
|
for (uint32_t i = 0; i < data->NumPart; i++)
|
||||||
{
|
{
|
||||||
f.writeReal32(data->Id[i]);
|
f.writeReal32(data->Pos[x1][i]);
|
||||||
}
|
}
|
||||||
f.endCheckpoint();
|
f.endCheckpoint();
|
||||||
|
|
||||||
|
@ -384,7 +388,7 @@ void generateOutput(SimuData *data, int axis,
|
||||||
f.beginCheckpoint();
|
f.beginCheckpoint();
|
||||||
for (uint32_t i = 0; i < data->NumPart; i++)
|
for (uint32_t i = 0; i < data->NumPart; i++)
|
||||||
{
|
{
|
||||||
f.writeReal32(data->Id[i]);
|
f.writeReal32(data->Pos[x2][i]);
|
||||||
}
|
}
|
||||||
f.endCheckpoint();
|
f.endCheckpoint();
|
||||||
|
|
||||||
|
@ -392,11 +396,11 @@ void generateOutput(SimuData *data, int axis,
|
||||||
f.beginCheckpoint();
|
f.beginCheckpoint();
|
||||||
for (uint32_t i = 0; i < data->NumPart; i++)
|
for (uint32_t i = 0; i < data->NumPart; i++)
|
||||||
{
|
{
|
||||||
f.writeReal32(data->Id[i]);
|
//printf("HELLO %d %d\n", i, data->Id[i]);
|
||||||
|
//f.writeReal32(data->Id[i]);
|
||||||
|
f.writeReal32(data->uniqueID[i]);
|
||||||
}
|
}
|
||||||
f.endCheckpoint();
|
f.endCheckpoint();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void makeBox(SimuData *simu, double *efac, SimuData *&boxed, generateMock_info& args_info)
|
void makeBox(SimuData *simu, double *efac, SimuData *&boxed, generateMock_info& args_info)
|
||||||
|
@ -456,6 +460,7 @@ void makeBox(SimuData *simu, double *efac, SimuData *&boxed, generateMock_info&
|
||||||
boxed->Vel[j] = 0;
|
boxed->Vel[j] = 0;
|
||||||
mul[j] = 1.0/(ranges[j][1] - ranges[j][0]);
|
mul[j] = 1.0/(ranges[j][1] - ranges[j][0]);
|
||||||
}
|
}
|
||||||
|
boxed->uniqueID = new float[goodParticles];
|
||||||
|
|
||||||
cout << "Rescaling factors = " << mul[0] << " " << mul[1] << " " << mul[2] << endl;
|
cout << "Rescaling factors = " << mul[0] << " " << mul[1] << " " << mul[2] << endl;
|
||||||
boxed->NumPart = goodParticles;
|
boxed->NumPart = goodParticles;
|
||||||
|
@ -476,6 +481,8 @@ void makeBox(SimuData *simu, double *efac, SimuData *&boxed, generateMock_info&
|
||||||
assert(boxed->Pos[j][k] > 0);
|
assert(boxed->Pos[j][k] > 0);
|
||||||
assert(boxed->Pos[j][k] < 1);
|
assert(boxed->Pos[j][k] < 1);
|
||||||
}
|
}
|
||||||
|
boxed->uniqueID[k] = simu->uniqueID[i];
|
||||||
|
|
||||||
particle_id[k] = i;
|
particle_id[k] = i;
|
||||||
expansion_fac[k] = efac[i];
|
expansion_fac[k] = efac[i];
|
||||||
k++;
|
k++;
|
||||||
|
|
|
@ -451,28 +451,29 @@ int main(int argc, char **argv) {
|
||||||
//voids[iVoid].accepted = 0;
|
//voids[iVoid].accepted = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (voids[iVoid].centralDen > args_info.maxCentralDen_arg) {
|
||||||
|
voids[iVoid].accepted = -1;
|
||||||
|
}
|
||||||
|
|
||||||
// toss out voids that are obviously wrong
|
// toss out voids that are obviously wrong
|
||||||
if (voids[iVoid].densCon > 1.e3) {
|
if (voids[iVoid].densCon > 1.e3) {
|
||||||
voids[iVoid].accepted = 0;
|
voids[iVoid].accepted = -4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(args_info.dataPortion_arg, "edge") == 0 &&
|
if (strcmp(args_info.dataPortion_arg, "edge") == 0 &&
|
||||||
tolerance*voids[iVoid].maxRadius < voids[iVoid].nearestMock) {
|
tolerance*voids[iVoid].maxRadius < voids[iVoid].nearestMock) {
|
||||||
voids[iVoid].accepted = 0;
|
voids[iVoid].accepted = -3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(args_info.dataPortion_arg, "central") == 0 &&
|
if (strcmp(args_info.dataPortion_arg, "central") == 0 &&
|
||||||
tolerance*voids[iVoid].maxRadius > voids[iVoid].nearestMock) {
|
tolerance*voids[iVoid].maxRadius > voids[iVoid].nearestMock) {
|
||||||
voids[iVoid].accepted = 0;
|
voids[iVoid].accepted = -3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (voids[iVoid].radius < args_info.rMin_arg) {
|
if (voids[iVoid].radius < args_info.rMin_arg) {
|
||||||
voids[iVoid].accepted = 0;
|
voids[iVoid].accepted = -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (voids[iVoid].centralDen > args_info.maxCentralDen_arg) {
|
|
||||||
voids[iVoid].accepted = -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
numKept = 0;
|
numKept = 0;
|
||||||
|
@ -559,7 +560,7 @@ int main(int argc, char **argv) {
|
||||||
fprintf(fpInfo, "# center x,y,z (km/s), volume (normalized), radius (Mpc/h), redshift, volume (Mpc/h^3), void ID\n");
|
fprintf(fpInfo, "# center x,y,z (km/s), volume (normalized), radius (Mpc/h), redshift, volume (Mpc/h^3), void ID\n");
|
||||||
for (iVoid = 0; iVoid < numVoids; iVoid++) {
|
for (iVoid = 0; iVoid < numVoids; iVoid++) {
|
||||||
|
|
||||||
if (voids[iVoid].accepted == 0) continue;
|
if (voids[iVoid].accepted < -1) continue;
|
||||||
|
|
||||||
double outCenter[3];
|
double outCenter[3];
|
||||||
outCenter[0] = voids[iVoid].barycenter[0];
|
outCenter[0] = voids[iVoid].barycenter[0];
|
||||||
|
|
2
external/cosmotool/src/loadSimu.hpp
vendored
2
external/cosmotool/src/loadSimu.hpp
vendored
|
@ -27,7 +27,7 @@ namespace CosmoTool
|
||||||
float *uniqueID;
|
float *uniqueID;
|
||||||
int *type;
|
int *type;
|
||||||
public:
|
public:
|
||||||
SimuData() : Id(0),NumPart(0),type(0), uniqueID(0) { Pos[0]=Pos[1]=Pos[2]=0; Vel[0]=Vel[1]=Vel[2]=0; uniqueID=0}
|
SimuData() : Id(0),NumPart(0),type(0), uniqueID(0) { Pos[0]=Pos[1]=Pos[2]=0; Vel[0]=Vel[1]=Vel[2]=0; uniqueID=0;}
|
||||||
~SimuData()
|
~SimuData()
|
||||||
{
|
{
|
||||||
for (int j = 0; j < 3; j++)
|
for (int j = 0; j < 3; j++)
|
||||||
|
|
|
@ -78,8 +78,8 @@ for sample in dataSampleList:
|
||||||
fp.write("Additional subsampling fraction: %g\n" % sample.subsample)
|
fp.write("Additional subsampling fraction: %g\n" % sample.subsample)
|
||||||
fp.write("Simulation box length (Mpc/h): %g\n" % sample.boxLen)
|
fp.write("Simulation box length (Mpc/h): %g\n" % sample.boxLen)
|
||||||
fp.write("Simulation Omega_M: %g\n" % sample.omegaM)
|
fp.write("Simulation Omega_M: %g\n" % sample.omegaM)
|
||||||
fp.write("Number of simulation subvolumes: %g\n", sample.numSubvolumes)
|
fp.write("Number of simulation subvolumes: %s\n" % sample.numSubvolumes)
|
||||||
fp.write("My subvolume index: %g\n", sample.mySubvolume)
|
fp.write("My subvolume index: %s\n" % sample.mySubvolume)
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
|
@ -364,7 +364,7 @@ if args.halos or args.all:
|
||||||
numPart += 1
|
numPart += 1
|
||||||
inFile.close()
|
inFile.close()
|
||||||
|
|
||||||
sampleName = "md.halos_z"+redshift
|
sampleName = "md.halos_min"+str(minHaloMass)+"_z"+redshift
|
||||||
outFile = open(catalogDir+"/"+sampleName+".dat", 'w')
|
outFile = open(catalogDir+"/"+sampleName+".dat", 'w')
|
||||||
|
|
||||||
outFile.write("%f\n" %(lbox))
|
outFile.write("%f\n" %(lbox))
|
||||||
|
@ -385,6 +385,7 @@ if args.halos or args.all:
|
||||||
# write to output file
|
# write to output file
|
||||||
outFile.write("%d %e %e %e %e\n" %(iHalo,x,y,z,vz))
|
outFile.write("%d %e %e %e %e\n" %(iHalo,x,y,z,vz))
|
||||||
|
|
||||||
|
outFile.write("-99 -99 -99 -99 -99\n")
|
||||||
inFile.close()
|
inFile.close()
|
||||||
outFile.close()
|
outFile.close()
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ workDir = "/home/psutter2/workspace/Voids/"
|
||||||
figDir = "./figs"
|
figDir = "./figs"
|
||||||
|
|
||||||
sampleDirList = [ "multidark/md_ss0.1_pv/sample_md_ss0.1_pv_z0.56_d00/",
|
sampleDirList = [ "multidark/md_ss0.1_pv/sample_md_ss0.1_pv_z0.56_d00/",
|
||||||
"multidark/md_ss01.0_pv/sample_md_ss1.0_pv_z0.56_d00/",
|
#"multidark/md_ss01.0_pv/sample_md_ss1.0_pv_z0.56_d00/",
|
||||||
"multidark/md_halos_min1.23e13_pv/sample_md_halos_min1.23e13_pv_z0.56_d00/",
|
"multidark/md_halos_min1.23e13_pv/sample_md_halos_min1.23e13_pv_z0.56_d00/",
|
||||||
"random/ran_ss0.0004/sample_ran_ss0.0004_z0.56_d00/",
|
"random/ran_ss0.0004/sample_ran_ss0.0004_z0.56_d00/",
|
||||||
"random/ran_ss0.1/sample_ran_ss0.1_z0.56_d00/",
|
"random/ran_ss0.1/sample_ran_ss0.1_z0.56_d00/",
|
||||||
|
|
|
@ -55,7 +55,7 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
||||||
sample.zBoundary[0], sample.zBoundary[1], sample.fakeDensity,
|
sample.zBoundary[0], sample.zBoundary[1], sample.fakeDensity,
|
||||||
useLCDMFlag)
|
useLCDMFlag)
|
||||||
|
|
||||||
parmFile = os.getcwd()+"/generate.par"
|
parmFile = os.getcwd()+"/generate_"+sample.fullName+".par"
|
||||||
|
|
||||||
file(parmFile, mode="w").write(conf)
|
file(parmFile, mode="w").write(conf)
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
||||||
sample.zBoundaryMpc[0], sample.zBoundaryMpc[1],
|
sample.zBoundaryMpc[0], sample.zBoundaryMpc[1],
|
||||||
sample.subsample)
|
sample.subsample)
|
||||||
|
|
||||||
parmFile = os.getcwd()+"/generate.par"
|
parmFile = os.getcwd()+"/generate_"+sample.fullName+".par"
|
||||||
|
|
||||||
file(parmFile, mode="w").write(conf)
|
file(parmFile, mode="w").write(conf)
|
||||||
|
|
||||||
|
@ -405,7 +405,7 @@ def launchStack(sample, stack, binPath, thisDataPortion=None, logDir=None,
|
||||||
zobovDir+"/boundaryDistances_"+thisDataPortion+"_"+sampleName+".out",
|
zobovDir+"/boundaryDistances_"+thisDataPortion+"_"+sampleName+".out",
|
||||||
rescaleFlag)
|
rescaleFlag)
|
||||||
|
|
||||||
parmFile = os.getcwd()+"/stack.par"
|
parmFile = os.getcwd()+"/stack_"+sample.fullName+".par"
|
||||||
|
|
||||||
fp = file(parmFile, mode="w")
|
fp = file(parmFile, mode="w")
|
||||||
fp.write(conf)
|
fp.write(conf)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue