more consistent handling of redshift bounaries in pruneVoids

This commit is contained in:
P.M. Sutter 2012-11-19 07:51:01 -06:00
parent 80c2b7f603
commit 06c8ddc26e
3 changed files with 24 additions and 9 deletions

View file

@ -334,7 +334,8 @@ void generateSurfaceMask(generateFromCatalog_info& args ,
// TEST - insert mock galaxies along spheres of survey redshift boundaries // TEST - insert mock galaxies along spheres of survey redshift boundaries
fp = fopen("mock_sphere.txt", "w"); fp = fopen("mock_sphere.txt", "w");
for (int p = 0; p < full_mask_list.size(); p++) { for (int p = 0; p < 0; p++) {
//for (int p = 0; p < full_mask_list.size(); p++) {
vec3 v = mask.pix2vec(full_mask_list[p]); vec3 v = mask.pix2vec(full_mask_list[p]);
Position p; Position p;

View file

@ -40,6 +40,7 @@ typedef struct voidStruct {
float vol, coreDens, zoneVol, densCon, voidProb, radius; float vol, coreDens, zoneVol, densCon, voidProb, radius;
int voidID, numPart, numZones, coreParticle, zoneNumPart; int voidID, numPart, numZones, coreParticle, zoneNumPart;
float maxRadius, nearestMock, centralDen, redshift, redshiftInMpc; float maxRadius, nearestMock, centralDen, redshift, redshiftInMpc;
float nearestEdge;
float center[3], barycenter[3]; float center[3], barycenter[3];
int accepted; int accepted;
} VOID; } VOID;
@ -349,6 +350,7 @@ int main(int argc, char **argv) {
voids[iVoid].centralDen = centralDen / (4./3. * M_PI * pow(centralRad, 3./2.)); voids[iVoid].centralDen = centralDen / (4./3. * M_PI * pow(centralRad, 3./2.));
// compute maximum extent // compute maximum extent
/*
if (args_info.isObservation_flag) { if (args_info.isObservation_flag) {
maxDist = 0.; maxDist = 0.;
for (p = 0; p < voids[iVoid].numPart; p++) { for (p = 0; p < voids[iVoid].numPart; p++) {
@ -364,6 +366,7 @@ int main(int argc, char **argv) {
} }
voids[iVoid].maxRadius = sqrt(maxDist)/2.; voids[iVoid].maxRadius = sqrt(maxDist)/2.;
} else { } else {
*/
maxDist = 0.; maxDist = 0.;
for (p = 0; p < voids[iVoid].numPart; p++) { for (p = 0; p < voids[iVoid].numPart; p++) {
@ -379,7 +382,7 @@ int main(int argc, char **argv) {
if (dist2 > maxDist) maxDist = dist2; if (dist2 > maxDist) maxDist = dist2;
} }
voids[iVoid].maxRadius = sqrt(maxDist); voids[iVoid].maxRadius = sqrt(maxDist);
} // }
if (args_info.isObservation_flag) { if (args_info.isObservation_flag) {
// compute distance from center to nearest mock // compute distance from center to nearest mock
@ -405,8 +408,9 @@ int main(int argc, char **argv) {
pow(voids[iVoid].barycenter[2] - boxLen[2]/2.,2)); pow(voids[iVoid].barycenter[2] - boxLen[2]/2.,2));
voids[iVoid].redshiftInMpc = voids[iVoid].redshiftInMpc; voids[iVoid].redshiftInMpc = voids[iVoid].redshiftInMpc;
redshift = voids[iVoid].redshiftInMpc; redshift = voids[iVoid].redshiftInMpc;
nearestEdge = fmin(fabs(redshift-args_info.zMin_arg*LIGHT_SPEED/100.), nearestEdge = fabs(redshift-args_info.zMax_arg*LIGHT_SPEED/100.);
fabs(redshift-args_info.zMax_arg*LIGHT_SPEED/100.)); //nearestEdge = fmin(fabs(redshift-args_info.zMin_arg*LIGHT_SPEED/100.),
// fabs(redshift-args_info.zMax_arg*LIGHT_SPEED/100.));
voids[iVoid].redshift = voids[iVoid].redshiftInMpc/LIGHT_SPEED*100.; voids[iVoid].redshift = voids[iVoid].redshiftInMpc/LIGHT_SPEED*100.;
} else { } else {
@ -436,9 +440,10 @@ int main(int argc, char **argv) {
} }
} }
if (nearestEdge < voids[iVoid].nearestMock) { voids[iVoid].nearestEdge = nearestEdge;
voids[iVoid].nearestMock = nearestEdge; //if (nearestEdge < voids[iVoid].nearestMock) {
} // voids[iVoid].nearestMock = nearestEdge;
//}
} // iVoid } // iVoid
printf(" Picking winners and losers...\n"); printf(" Picking winners and losers...\n");
@ -474,6 +479,15 @@ int main(int argc, char **argv) {
voids[iVoid].accepted = -2; voids[iVoid].accepted = -2;
} }
// *alwas* clean out near edges since there are no mocks there
if (tolerance*voids[iVoid].maxRadius > voids[iVoid].nearestEdge) {
voids[iVoid].accepted = -3;
}
// assume the lower z-boundary is "soft" in observations
if (voids[iVoid].redshift < args_info.zMin_arg) {
voids[iVoid].accepted = -3;
}
} }
numKept = 0; numKept = 0;

View file

@ -271,8 +271,8 @@ def launchPrune(sample, binPath, thisDataPortion=None,
cmd += " --dataPortion=" + thisDataPortion cmd += " --dataPortion=" + thisDataPortion
cmd += " --mockIndex=" + str(mockIndex) cmd += " --mockIndex=" + str(mockIndex)
cmd += " --maxCentralDen=" + str(maxDen) cmd += " --maxCentralDen=" + str(maxDen)
cmd += " --zMin=" + str(sample.zBoundary[0]) cmd += " --zMin=" + str(sample.zRange[0])
cmd += " --zMax=" + str(sample.zBoundary[1]) cmd += " --zMax=" + str(sample.zRange[1])
cmd += " --rMin=" + str(sample.minVoidRadius) cmd += " --rMin=" + str(sample.minVoidRadius)
cmd += " --numVoids=" + str(numVoids) cmd += " --numVoids=" + str(numVoids)
cmd += observationLine cmd += observationLine