mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
added observation flag in info file; stack voids now shifts particles based on redshift of subsample
This commit is contained in:
parent
d4febc6942
commit
a7cdb80704
3 changed files with 12 additions and 0 deletions
|
@ -10,6 +10,7 @@ bool loadParticleInfo(ParticleInfo& info,
|
|||
const std::string& extra_info)
|
||||
{
|
||||
int numpart;
|
||||
int isObservation;
|
||||
|
||||
NcFile f_info(extra_info.c_str());
|
||||
|
||||
|
@ -23,6 +24,7 @@ bool loadParticleInfo(ParticleInfo& info,
|
|||
info.ranges[2][0] = f_info.get_att("range_z_min")->as_double(0);
|
||||
info.ranges[2][1] = f_info.get_att("range_z_max")->as_double(0);
|
||||
info.mask_index = f_info.get_att("mask_index")->as_int(0); //PMS
|
||||
isObservation = f_info.get_att("is_observation")->as_int(0); //PMS
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
info.length[i] = info.ranges[i][1] - info.ranges[i][0];
|
||||
|
@ -59,6 +61,14 @@ bool loadParticleInfo(ParticleInfo& info,
|
|||
for (int i = 0; i < numpart; i++)
|
||||
info.particles[i].z = mul*f.readReal32();
|
||||
f.endCheckpoint();
|
||||
|
||||
if (!isObservation) {
|
||||
for (int i = 0; i < numpart; i++) {
|
||||
info.particles[i].x += info.ranges[0][0];
|
||||
info.particles[i].y += info.ranges[1][0];
|
||||
info.particles[i].z += info.ranges[2][0];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const NoSuchFileException& e)
|
||||
{
|
||||
|
|
|
@ -466,6 +466,7 @@ void saveForZobov(ParticleData& pdata, const string& fname, const string& paramn
|
|||
fp.add_att("range_z_min", -Lmax/100.);
|
||||
fp.add_att("range_z_max", Lmax/100.);
|
||||
fp.add_att("mask_index", pdata.mask_index); // PMS
|
||||
fp.add_att("is_observation", 1); // PMS
|
||||
|
||||
int nOutputPart = pdata.mask_index;
|
||||
//int nOutputPart = pdata.pos.size();
|
||||
|
|
|
@ -338,6 +338,7 @@ void saveBox(SimuData *&boxed, const std::string& outbox)
|
|||
f.add_att("range_z_min", ranges[4]);
|
||||
f.add_att("range_z_max", ranges[5]);
|
||||
f.add_att("mask_index", -1);
|
||||
f.add_att("is_observation", 0);
|
||||
|
||||
NcDim *NumPart_dim = f.add_dim("numpart_dim", boxed->NumPart);
|
||||
NcDim *NumSnap_dim = f.add_dim("numsnap_dim", num_snapshots);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue