more bug fixes for the minimum halo mass cuts...sigh

This commit is contained in:
P.M. Sutter 2012-11-18 22:47:49 -06:00
parent 9d97522472
commit 80c2b7f603
9 changed files with 41 additions and 41 deletions

17
README
View file

@ -1,13 +1,10 @@
After compiling, go to the pipeline directory.
Edit the parameters at the top of prepareGadgetCatalog.py: decide
where to put outputs, how many redshifts to do, how many slices,
subdivisions, subsamples, etc. etc.
Create a dataset parameter file. Look at datasets/multidark.py for
an example. Describe the simulation, where to put outputs, how many
redshift slices, subvolumes, etc. etc.
Note that eventually prepareGadgetCatalog will be replaced by the more
general and flexible prepareCatalogs.
prepareGadgetCatalogs will produce a pipeline script for each
prepareCatalogs will produce a pipeline script for each
subsampling you choose. If you have multiple redshift particle files,
and choose multiple slices and/or subdivisions, they will be packaged
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
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
discussion, since further analysis relies on the current formats.
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 :)
We can talk about ways to incorporate your analysis into the pipline
and to have your tools under this umbrella.
Good luck!

View file

@ -295,10 +295,10 @@ void generateSurfaceMask(generateFromCatalog_info& args ,
int nPart = 100;
// TEST
//for (int iDir = 0; iDir < 0; iDir++) {
//for (int iFace = 0; iFace < 0; iFace++) {
for (int iDir = 0; iDir < 3; iDir++) {
for (int iFace = 0; iFace < 2; iFace++) {
for (int iDir = 0; iDir < 0; iDir++) {
for (int iFace = 0; iFace < 0; iFace++) {
//for (int iDir = 0; iDir < 3; iDir++) {
//for (int iFace = 0; iFace < 2; iFace++) {
int iy = (iDir + 1) % 3;
int iz = (iDir + 2) % 3;
@ -334,7 +334,7 @@ void generateSurfaceMask(generateFromCatalog_info& args ,
// TEST - insert mock galaxies along spheres of survey redshift boundaries
fp = fopen("mock_sphere.txt", "w");
for (int p = 0; p < full_mask_list.size(); p++) {
for (int p = 0; p < full_mask_list.size(); p++) {
vec3 v = mask.pix2vec(full_mask_list[p]);
Position p;

View file

@ -179,14 +179,18 @@ SimuData *doLoadMultidark(const char *multidarkname)
outd->Pos[k] = new float[outd->NumPart];
outd->Vel[2] = new float[outd->NumPart];
outd->Id = new int[outd->NumPart];
outd->uniqueID = new float[outd->NumPart];
cout << "loading multidark particles" << endl;
actualNumPart = 0;
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[2][i], &outd->Vel[2][i]);
outd->uniqueID[i] = 1.0;
//outd->uniqueID[i] = 1.0 * outd->Id[i];
if (outd->Id[i] == -99 &&
outd->Pos[0][i] == -99 && outd->Pos[1][i] == -99 &&
outd->Pos[2][i] == -99 && outd->Vel[2][i] == -99) {
@ -368,7 +372,7 @@ void generateOutput(SimuData *data, int axis,
f.beginCheckpoint();
for (uint32_t i = 0; i < data->NumPart; i++)
{
f.writeReal32(data->Id[i]);
f.writeReal32(data->Pos[x0][i]);
}
f.endCheckpoint();
@ -376,7 +380,7 @@ void generateOutput(SimuData *data, int axis,
f.beginCheckpoint();
for (uint32_t i = 0; i < data->NumPart; i++)
{
f.writeReal32(data->Id[i]);
f.writeReal32(data->Pos[x1][i]);
}
f.endCheckpoint();
@ -384,7 +388,7 @@ void generateOutput(SimuData *data, int axis,
f.beginCheckpoint();
for (uint32_t i = 0; i < data->NumPart; i++)
{
f.writeReal32(data->Id[i]);
f.writeReal32(data->Pos[x2][i]);
}
f.endCheckpoint();
@ -392,11 +396,11 @@ void generateOutput(SimuData *data, int axis,
f.beginCheckpoint();
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();
}
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;
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;
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] < 1);
}
boxed->uniqueID[k] = simu->uniqueID[i];
particle_id[k] = i;
expansion_fac[k] = efac[i];
k++;

View file

@ -451,28 +451,29 @@ int main(int argc, char **argv) {
//voids[iVoid].accepted = 0;
}
if (voids[iVoid].centralDen > args_info.maxCentralDen_arg) {
voids[iVoid].accepted = -1;
}
// toss out voids that are obviously wrong
if (voids[iVoid].densCon > 1.e3) {
voids[iVoid].accepted = 0;
voids[iVoid].accepted = -4;
}
if (strcmp(args_info.dataPortion_arg, "edge") == 0 &&
tolerance*voids[iVoid].maxRadius < voids[iVoid].nearestMock) {
voids[iVoid].accepted = 0;
voids[iVoid].accepted = -3;
}
if (strcmp(args_info.dataPortion_arg, "central") == 0 &&
tolerance*voids[iVoid].maxRadius > voids[iVoid].nearestMock) {
voids[iVoid].accepted = 0;
voids[iVoid].accepted = -3;
}
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;
@ -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");
for (iVoid = 0; iVoid < numVoids; iVoid++) {
if (voids[iVoid].accepted == 0) continue;
if (voids[iVoid].accepted < -1) continue;
double outCenter[3];
outCenter[0] = voids[iVoid].barycenter[0];

View file

@ -27,7 +27,7 @@ namespace CosmoTool
float *uniqueID;
int *type;
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()
{
for (int j = 0; j < 3; j++)

View file

@ -78,8 +78,8 @@ for sample in dataSampleList:
fp.write("Additional subsampling fraction: %g\n" % sample.subsample)
fp.write("Simulation box length (Mpc/h): %g\n" % sample.boxLen)
fp.write("Simulation Omega_M: %g\n" % sample.omegaM)
fp.write("Number of simulation subvolumes: %g\n", sample.numSubvolumes)
fp.write("My subvolume index: %g\n", sample.mySubvolume)
fp.write("Number of simulation subvolumes: %s\n" % sample.numSubvolumes)
fp.write("My subvolume index: %s\n" % sample.mySubvolume)
fp.close()
# ---------------------------------------------------------------------------

View file

@ -364,7 +364,7 @@ if args.halos or args.all:
numPart += 1
inFile.close()
sampleName = "md.halos_z"+redshift
sampleName = "md.halos_min"+str(minHaloMass)+"_z"+redshift
outFile = open(catalogDir+"/"+sampleName+".dat", 'w')
outFile.write("%f\n" %(lbox))
@ -385,6 +385,7 @@ if args.halos or args.all:
# write to output file
outFile.write("%d %e %e %e %e\n" %(iHalo,x,y,z,vz))
outFile.write("-99 -99 -99 -99 -99\n")
inFile.close()
outFile.close()

View file

@ -5,7 +5,7 @@ workDir = "/home/psutter2/workspace/Voids/"
figDir = "./figs"
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/",
"random/ran_ss0.0004/sample_ran_ss0.0004_z0.56_d00/",
"random/ran_ss0.1/sample_ran_ss0.1_z0.56_d00/",

View file

@ -55,7 +55,7 @@ def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
sample.zBoundary[0], sample.zBoundary[1], sample.fakeDensity,
useLCDMFlag)
parmFile = os.getcwd()+"/generate.par"
parmFile = os.getcwd()+"/generate_"+sample.fullName+".par"
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.subsample)
parmFile = os.getcwd()+"/generate.par"
parmFile = os.getcwd()+"/generate_"+sample.fullName+".par"
file(parmFile, mode="w").write(conf)
@ -405,7 +405,7 @@ def launchStack(sample, stack, binPath, thisDataPortion=None, logDir=None,
zobovDir+"/boundaryDistances_"+thisDataPortion+"_"+sampleName+".out",
rescaleFlag)
parmFile = os.getcwd()+"/stack.par"
parmFile = os.getcwd()+"/stack_"+sample.fullName+".par"
fp = file(parmFile, mode="w")
fp.write(conf)