mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-05 07:41:11 +00:00
Added a test for void tree. Fixed gadget support in generateMock
This commit is contained in:
parent
8515e712da
commit
59e57921b1
2 changed files with 21 additions and 8 deletions
|
@ -84,7 +84,7 @@ SimuData *doLoadGadget(const char *gadgetname, int velAxis, bool goRedshift)
|
||||||
outd = new SimuData;
|
outd = new SimuData;
|
||||||
|
|
||||||
outd->NumPart = d->TotalNumPart;
|
outd->NumPart = d->TotalNumPart;
|
||||||
outd->BoxSize = d->BoxSize;
|
outd->BoxSize = d->BoxSize/1000;
|
||||||
outd->TotalNumPart = outd->NumPart;
|
outd->TotalNumPart = outd->NumPart;
|
||||||
outd->Hubble = d->Hubble;
|
outd->Hubble = d->Hubble;
|
||||||
outd->Omega_Lambda = d->Omega_Lambda;
|
outd->Omega_Lambda = d->Omega_Lambda;
|
||||||
|
@ -108,7 +108,7 @@ SimuData *doLoadGadget(const char *gadgetname, int velAxis, bool goRedshift)
|
||||||
{
|
{
|
||||||
assert(d->Id[i] >= 1);
|
assert(d->Id[i] >= 1);
|
||||||
assert(d->Id[i] <= outd->TotalNumPart);
|
assert(d->Id[i] <= outd->TotalNumPart);
|
||||||
outd->Pos[k][d->Id[i]-1] = d->Pos[k][i];
|
outd->Pos[k][d->Id[i]-1] = d->Pos[k][i]/1000;
|
||||||
outd->Vel[2][d->Id[i]-1] = d->Vel[velAxis][i];
|
outd->Vel[2][d->Id[i]-1] = d->Vel[velAxis][i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,14 +210,25 @@ void metricTransform(SimuData *data, int axis, bool reshift, bool pecvel, double
|
||||||
float z_old = z;
|
float z_old = z;
|
||||||
|
|
||||||
double reduced_red = (z + baseComovingDistance)*100./LIGHT_SPEED;
|
double reduced_red = (z + baseComovingDistance)*100./LIGHT_SPEED;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
// Distorted redshift
|
// Distorted redshift
|
||||||
|
if (reduced_red == 0)
|
||||||
|
z = 0;
|
||||||
|
else
|
||||||
z = (z_vs_D.compute(reduced_red)-z_base)*LIGHT_SPEED/100.;
|
z = (z_vs_D.compute(reduced_red)-z_base)*LIGHT_SPEED/100.;
|
||||||
expfact[i] = z / z_old;
|
expfact[i] = z / z_old;
|
||||||
// Add peculiar velocity
|
// Add peculiar velocity
|
||||||
if (pecvel)
|
if (pecvel)
|
||||||
z += v/100;
|
z += v/100;
|
||||||
}
|
}
|
||||||
|
catch(const InvalidRangeException& e) {
|
||||||
|
cout << "Trying to interpolate out of the tabulated range." << endl;
|
||||||
|
cout << "The offending value is z=" << reduced_red << endl;
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void generateOutput(SimuData *data, int axis,
|
void generateOutput(SimuData *data, int axis,
|
||||||
|
|
|
@ -224,6 +224,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VoidNode *getRoot() { return rootNode; }
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void walkNode(VoidNode *node, T& traverse)
|
void walkNode(VoidNode *node, T& traverse)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue