mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-05 07:41:11 +00:00
Implemented (yet another) new boundary handling scheme, whereby we scan radially along survey edge while flagging nearest galaxies. The prepObservation routine was significantly cleaned up to accommodate this, but it was ultimately implemented in python (surveyTools.py) for ease of prototyping, with the intent to move it back into C later.
Some general housekeeping, making sure some new parameters are passed around correctly, and removing the storage of some unused files. This update is considered HIGHLY UNSTABLE. It will almost certainly break somewhere for simulations. Still under active development.
This commit is contained in:
parent
62dd66be79
commit
3dce2593d9
9 changed files with 348 additions and 454 deletions
|
@ -120,12 +120,12 @@ void openFiles(string outputDir, string sampleName,
|
|||
int mockIndex, int numKept,
|
||||
FILE** fpZobov, FILE** fpCenters,
|
||||
FILE** fpCentersNoCut,
|
||||
FILE** fpBarycenter, FILE** fpDistances, FILE** fpShapes,
|
||||
FILE** fpBarycenter, FILE** fpShapes,
|
||||
FILE** fpSkyPositions);
|
||||
|
||||
void closeFiles(FILE* fpZobov, FILE* fpCenters,
|
||||
FILE* fpCentersNoCut,
|
||||
FILE* fpBarycenter, FILE* fpDistances, FILE* fpShapes,
|
||||
FILE* fpBarycenter, FILE* fpShapes,
|
||||
FILE* fpSkyPositions);
|
||||
|
||||
void outputVoids(string outputDir, string sampleName, string prefix,
|
||||
|
@ -374,7 +374,7 @@ int main(int argc, char **argv) {
|
|||
fclose(fp);
|
||||
|
||||
// now the particles-zone
|
||||
printf(" Loading particle-zone membership info...\n");
|
||||
printf(" Loading zone-particle membership info...\n");
|
||||
fp = fopen(args.zone2Part_arg, "r");
|
||||
fread(&dummy, 1, 4, fp);
|
||||
fread(&numZonesTot, 1, 4, fp);
|
||||
|
@ -470,7 +470,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
// load voids *again* using Guilhem's code so we can get tree information
|
||||
clock3 = clock();
|
||||
printf(" Re-loading voids and building tree..\n");
|
||||
printf(" Re-loading voids and building tree...\n");
|
||||
ZobovRep zobovCat;
|
||||
if (!loadZobov(args.voidDesc_arg, args.zone2Part_arg, args.void2Zone_arg,
|
||||
0, zobovCat)) {
|
||||
|
@ -691,12 +691,12 @@ int main(int argc, char **argv) {
|
|||
sqrt(pow(voids[iVoid].macrocenter[0] - boxLen[0]/2.,2) +
|
||||
pow(voids[iVoid].macrocenter[1] - boxLen[1]/2.,2) +
|
||||
pow(voids[iVoid].macrocenter[2] - boxLen[2]/2.,2));
|
||||
voids[iVoid].redshiftInMpc = voids[iVoid].redshiftInMpc;
|
||||
//voids[iVoid].redshiftInMpc = voids[iVoid].redshiftInMpc;
|
||||
|
||||
|
||||
if (args.useComoving_flag) {
|
||||
redshift = gsl_interp_eval(interp, dL, redshifts,
|
||||
voids[iVoid].redshiftInMpc, acc);
|
||||
voids[iVoid].redshiftInMpc, acc);
|
||||
nearestEdge = fabs((redshift-args.zMax_arg)*LIGHT_SPEED/100.);
|
||||
voids[iVoid].redshift = redshift;
|
||||
} else {
|
||||
|
@ -1002,7 +1002,7 @@ void openFiles(string outputDir, string sampleName,
|
|||
string prefix, string dataPortion,
|
||||
int mockIndex, int numKept,
|
||||
FILE** fpZobov, FILE** fpCenters,
|
||||
FILE** fpBarycenter, FILE** fpDistances, FILE** fpShapes,
|
||||
FILE** fpBarycenter, FILE** fpShapes,
|
||||
FILE** fpSkyPositions) {
|
||||
|
||||
*fpZobov = fopen((outputDir+"/"+prefix+"voidDesc_"+dataPortion+"_"+sampleName).c_str(), "w");
|
||||
|
@ -1014,8 +1014,6 @@ void openFiles(string outputDir, string sampleName,
|
|||
*fpCenters = fopen((outputDir+"/"+prefix+"centers_"+dataPortion+"_"+sampleName).c_str(), "w");
|
||||
fprintf(*fpCenters, "# center x,y,z (Mpc/h), volume (normalized), radius (Mpc/h), redshift, volume (Mpc/h^3), void ID, density contrast, num part, parent ID, tree level, number of children, central density\n");
|
||||
|
||||
*fpDistances = fopen((outputDir+"/"+prefix+"boundaryDistances_"+dataPortion+"_"+sampleName).c_str(), "w");
|
||||
|
||||
*fpSkyPositions = fopen((outputDir+"/"+prefix+"sky_positions_"+dataPortion+"_"+sampleName).c_str(), "w");
|
||||
fprintf(*fpSkyPositions, "# RA, dec, redshift, radius (Mpc/h), void ID\n");
|
||||
|
||||
|
@ -1027,13 +1025,13 @@ void openFiles(string outputDir, string sampleName,
|
|||
|
||||
// ----------------------------------------------------------------------------
|
||||
void closeFiles(FILE* fpZobov, FILE* fpCenters,
|
||||
FILE* fpBarycenter, FILE* fpDistances, FILE* fpShapes,
|
||||
FILE* fpBarycenter, FILE* fpShapes,
|
||||
FILE* fpSkyPositions) {
|
||||
|
||||
fclose(fpZobov);
|
||||
fclose(fpCenters);
|
||||
fclose(fpBarycenter);
|
||||
fclose(fpDistances);
|
||||
//fclose(fpDistances);
|
||||
fclose(fpShapes);
|
||||
fclose(fpSkyPositions);
|
||||
|
||||
|
@ -1049,13 +1047,13 @@ void outputVoids(string outputDir, string sampleName, string prefix,
|
|||
int iVoid;
|
||||
VOID outVoid;
|
||||
FILE *fp, *fpZobov, *fpCenters, *fpCentersNoCut, *fpBarycenter,
|
||||
*fpDistances, *fpShapes, *fpSkyPositions;
|
||||
*fpShapes, *fpSkyPositions;
|
||||
|
||||
|
||||
openFiles(outputDir, sampleName, prefix, dataPortion,
|
||||
mockIndex, voids.size(),
|
||||
&fpZobov, &fpCenters, &fpBarycenter,
|
||||
&fpDistances, &fpShapes, &fpSkyPositions);
|
||||
&fpShapes, &fpSkyPositions);
|
||||
|
||||
|
||||
for (iVoid = 0; iVoid < voids.size(); iVoid++) {
|
||||
|
@ -1104,6 +1102,7 @@ void outputVoids(string outputDir, string sampleName, string prefix,
|
|||
outVoid.macrocenter[1],
|
||||
outVoid.macrocenter[2]);
|
||||
|
||||
/*
|
||||
fprintf(fpDistances, "%d %e %e %e %e %e\n",
|
||||
outVoid.voidID,
|
||||
outVoid.nearestMock,
|
||||
|
@ -1111,6 +1110,7 @@ void outputVoids(string outputDir, string sampleName, string prefix,
|
|||
outVoid.rescaledCoreDens,
|
||||
outVoid.nearestMockFromCore,
|
||||
outVoid.nearestGalFromCore);
|
||||
*/
|
||||
|
||||
fprintf(fpCenters, "%.2f %.2f %.2f %.2f %.2f %.5f %.2f %d %f %d %d %d %d %.2f\n",
|
||||
outCenter[0],
|
||||
|
@ -1164,6 +1164,6 @@ void outputVoids(string outputDir, string sampleName, string prefix,
|
|||
} // end iVoid
|
||||
|
||||
closeFiles(fpZobov, fpCenters, fpBarycenter,
|
||||
fpDistances, fpShapes, fpSkyPositions);
|
||||
fpShapes, fpSkyPositions);
|
||||
|
||||
} // end outputVoids
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue