mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
void overlap now gets barycenters from center_ file rather than barycenter_ file
This commit is contained in:
parent
4cd7408a8a
commit
2e832dd415
3 changed files with 22 additions and 16 deletions
|
@ -88,7 +88,7 @@ typedef struct catalog {
|
||||||
|
|
||||||
void loadCatalog(const char *partFile, const char *volFile,
|
void loadCatalog(const char *partFile, const char *volFile,
|
||||||
const char *voidFile, const char *zoneFile,
|
const char *voidFile, const char *zoneFile,
|
||||||
const char *infoFile, const char *barycenterFile,
|
const char *infoFile, const char *centerFile,
|
||||||
const char *zonePartFile, CATALOG& catalog);
|
const char *zonePartFile, CATALOG& catalog);
|
||||||
|
|
||||||
float getDist(CATALOG& catalog1, CATALOG& catalog2, int& iVoid1, int& iVoid2,
|
float getDist(CATALOG& catalog1, CATALOG& catalog2, int& iVoid1, int& iVoid2,
|
||||||
|
@ -110,7 +110,7 @@ int main(int argc, char **argv) {
|
||||||
float closestMatchDist;
|
float closestMatchDist;
|
||||||
float commonVolRatio;
|
float commonVolRatio;
|
||||||
MATCHPROPS newMatch;
|
MATCHPROPS newMatch;
|
||||||
int MAX_MATCHES = 20;
|
int MAX_MATCHES = 10;
|
||||||
|
|
||||||
CATALOG catalog1, catalog2;
|
CATALOG catalog1, catalog2;
|
||||||
|
|
||||||
|
@ -136,11 +136,11 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
loadCatalog(args.partFile1_arg, args.volFile1_arg, args.voidFile1_arg,
|
loadCatalog(args.partFile1_arg, args.volFile1_arg, args.voidFile1_arg,
|
||||||
args.zoneFile1_arg, args.infoFile1_arg, args.barycenterFile1_arg,
|
args.zoneFile1_arg, args.infoFile1_arg, args.centerFile1_arg,
|
||||||
args.zonePartFile1_arg, catalog1);
|
args.zonePartFile1_arg, catalog1);
|
||||||
|
|
||||||
loadCatalog(args.partFile2_arg, args.volFile2_arg, args.voidFile2_arg,
|
loadCatalog(args.partFile2_arg, args.volFile2_arg, args.voidFile2_arg,
|
||||||
args.zoneFile2_arg, args.infoFile2_arg, args.barycenterFile2_arg,
|
args.zoneFile2_arg, args.infoFile2_arg, args.centerFile2_arg,
|
||||||
args.zonePartFile2_arg, catalog2);
|
args.zonePartFile2_arg, catalog2);
|
||||||
|
|
||||||
// check for periodic box
|
// check for periodic box
|
||||||
|
@ -164,7 +164,6 @@ int main(int argc, char **argv) {
|
||||||
rdist = getDist(catalog1, catalog2, iVoid1, iVoid2,
|
rdist = getDist(catalog1, catalog2, iVoid1, iVoid2,
|
||||||
periodicX, periodicY, periodicZ);
|
periodicX, periodicY, periodicZ);
|
||||||
|
|
||||||
|
|
||||||
newMatch.matchID = iVoid2;
|
newMatch.matchID = iVoid2;
|
||||||
newMatch.commonVol = 0;
|
newMatch.commonVol = 0;
|
||||||
newMatch.dist = rdist;
|
newMatch.dist = rdist;
|
||||||
|
@ -319,7 +318,7 @@ int main(int argc, char **argv) {
|
||||||
//catalog1.voids[iVoid1].numPart;
|
//catalog1.voids[iVoid1].numPart;
|
||||||
catalog1.voids[iVoid1].vol;
|
catalog1.voids[iVoid1].vol;
|
||||||
|
|
||||||
fprintf(fp, "%.3f ", catalog1.voids[iVoid1].matches[iMatch].dist);
|
fprintf(fp, "%.3f %.2f ", catalog1.voids[iVoid1].matches[iMatch].dist, commonVolRatio);
|
||||||
//fprintf(fp, "%.2f ", commonVolRatio);
|
//fprintf(fp, "%.2f ", commonVolRatio);
|
||||||
} else {
|
} else {
|
||||||
fprintf(fp, "0.00 ");
|
fprintf(fp, "0.00 ");
|
||||||
|
@ -339,7 +338,7 @@ int main(int argc, char **argv) {
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
void loadCatalog(const char *partFile, const char *volFile,
|
void loadCatalog(const char *partFile, const char *volFile,
|
||||||
const char *voidFile, const char *zoneFile,
|
const char *voidFile, const char *zoneFile,
|
||||||
const char *infoFile, const char *barycenterFile,
|
const char *infoFile, const char *centerFile,
|
||||||
const char *zonePartFile, CATALOG& catalog) {
|
const char *zonePartFile, CATALOG& catalog) {
|
||||||
|
|
||||||
int i, p, numPartTot, numZonesTot, dummy, iVoid, iZ, numVolTot;
|
int i, p, numPartTot, numZonesTot, dummy, iVoid, iZ, numVolTot;
|
||||||
|
@ -465,15 +464,22 @@ void loadCatalog(const char *partFile, const char *volFile,
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
|
catalog.numVoids = i - 1;
|
||||||
|
catalog.voids.resize(catalog.numVoids);
|
||||||
printf(" Read %d voids.\n", catalog.numVoids);
|
printf(" Read %d voids.\n", catalog.numVoids);
|
||||||
|
|
||||||
printf(" Loading barycenters\n");
|
printf(" Loading barycenters\n");
|
||||||
fp = fopen(barycenterFile, "r");
|
fp = fopen(centerFile, "r");
|
||||||
float tempBary[3];
|
float tempBary[3];
|
||||||
|
float tempFloat;
|
||||||
|
int tempInt;
|
||||||
iVoid = 0;
|
iVoid = 0;
|
||||||
while (fgets(line, sizeof(line), fp) != NULL) {
|
while (fgets(line, sizeof(line), fp) != NULL) {
|
||||||
sscanf(line, "%d %f %f %f\n", &voidID, &tempBary[0], &tempBary[1],
|
sscanf(line, "%f %f %f %f %f %f %f %d %f %d %d %d\n",
|
||||||
&tempBary[2]);
|
&tempBary[0], &tempBary[1], &tempBary[2],
|
||||||
|
&tempFloat, &tempFloat, &tempFloat, &tempFloat, &tempInt,
|
||||||
|
&tempFloat, &tempInt, &tempInt);
|
||||||
|
|
||||||
tempBary[0] = (tempBary[0] - ranges[0][0])/catalog.boxLen[0];
|
tempBary[0] = (tempBary[0] - ranges[0][0])/catalog.boxLen[0];
|
||||||
tempBary[1] = (tempBary[1] - ranges[1][0])/catalog.boxLen[1];
|
tempBary[1] = (tempBary[1] - ranges[1][0])/catalog.boxLen[1];
|
||||||
tempBary[2] = (tempBary[2] - ranges[2][0])/catalog.boxLen[2];
|
tempBary[2] = (tempBary[2] - ranges[2][0])/catalog.boxLen[2];
|
||||||
|
|
|
@ -10,7 +10,7 @@ option "voidFile1" - "Void info file for catalog 1" string yes
|
||||||
option "infoFile1" - "Extra info file for catalog 1" string yes
|
option "infoFile1" - "Extra info file for catalog 1" string yes
|
||||||
option "zoneFile1" - "Zone file for catalog 1" string yes
|
option "zoneFile1" - "Zone file for catalog 1" string yes
|
||||||
option "zonePartFile1" - "Zone-particle file for catalog 1" string yes
|
option "zonePartFile1" - "Zone-particle file for catalog 1" string yes
|
||||||
option "barycenterFile1" - "Barycenter file for catalog 1" string yes
|
option "centerFile1" - "Barycenter file for catalog 1" string yes
|
||||||
|
|
||||||
# void data for file 2
|
# void data for file 2
|
||||||
option "partFile2" - "Particle file for catalog 2" string yes
|
option "partFile2" - "Particle file for catalog 2" string yes
|
||||||
|
@ -19,7 +19,7 @@ option "voidFile2" - "Void info file for catalog 2" string yes
|
||||||
option "infoFile2" - "Extra info file for catalog 2" string yes
|
option "infoFile2" - "Extra info file for catalog 2" string yes
|
||||||
option "zoneFile2" - "Zone file for catalog 2" string yes
|
option "zoneFile2" - "Zone file for catalog 2" string yes
|
||||||
option "zonePartFile2" - "Zone-particle file for catalog 2" string yes
|
option "zonePartFile2" - "Zone-particle file for catalog 2" string yes
|
||||||
option "barycenterFile2" - "Barycenter file for catalog 2" string yes
|
option "centerFile2" - "Barycenter file for catalog 2" string yes
|
||||||
|
|
||||||
# options
|
# options
|
||||||
option "outfile" - "Output file" string yes
|
option "outfile" - "Output file" string yes
|
||||||
|
|
|
@ -394,8 +394,8 @@ def launchVoidOverlap(sample1, sample2, sample1Dir, sample2Dir,
|
||||||
thisDataPortion+"_"+str(sampleName1)+".out"
|
thisDataPortion+"_"+str(sampleName1)+".out"
|
||||||
cmd += " --infoFile1=" + sample1Dir+"/zobov_slice_" + \
|
cmd += " --infoFile1=" + sample1Dir+"/zobov_slice_" + \
|
||||||
str(sampleName1)+".par"
|
str(sampleName1)+".par"
|
||||||
cmd += " --barycenterFile1=" + sample1Dir + \
|
cmd += " --centerFile1=" + sample1Dir + \
|
||||||
"/barycenters_"+thisDataPortion+"_"+str(sampleName1)+".out"
|
"/centers_"+thisDataPortion+"_"+str(sampleName1)+".out"
|
||||||
cmd += " --zoneFile1=" + sample1Dir+"/voidZone_" + \
|
cmd += " --zoneFile1=" + sample1Dir+"/voidZone_" + \
|
||||||
str(sampleName1)+".dat"
|
str(sampleName1)+".dat"
|
||||||
cmd += " --zonePartFile1=" + sample1Dir+"/voidPart_" + \
|
cmd += " --zonePartFile1=" + sample1Dir+"/voidPart_" + \
|
||||||
|
@ -409,8 +409,8 @@ def launchVoidOverlap(sample1, sample2, sample1Dir, sample2Dir,
|
||||||
thisDataPortion+"_"+str(sampleName2)+".out"
|
thisDataPortion+"_"+str(sampleName2)+".out"
|
||||||
cmd += " --infoFile2=" + sample2Dir+"/zobov_slice_" + \
|
cmd += " --infoFile2=" + sample2Dir+"/zobov_slice_" + \
|
||||||
str(sampleName2)+".par"
|
str(sampleName2)+".par"
|
||||||
cmd += " --barycenterFile2=" + sample2Dir + \
|
cmd += " --centerFile2=" + sample2Dir + \
|
||||||
"/barycenters_"+thisDataPortion+"_"+str(sampleName2)+".out"
|
"/centers_"+thisDataPortion+"_"+str(sampleName2)+".out"
|
||||||
cmd += " --zoneFile2=" + sample2Dir+"/voidZone_" + \
|
cmd += " --zoneFile2=" + sample2Dir+"/voidZone_" + \
|
||||||
str(sampleName2)+".dat"
|
str(sampleName2)+".dat"
|
||||||
cmd += " --zonePartFile2=" + sample2Dir+"/voidPart_" + \
|
cmd += " --zonePartFile2=" + sample2Dir+"/voidPart_" + \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue