added observation flag in info file; stack voids now shifts particles based on redshift of subsample

This commit is contained in:
P.M. Sutter 2012-12-23 16:38:54 -06:00
parent d4febc6942
commit a7cdb80704
3 changed files with 12 additions and 0 deletions

View file

@ -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)
{