mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
Merge branch 'master' of ssh://bitbucket.org/cosmicvoids/void_identification
This commit is contained in:
commit
361ab5b617
10 changed files with 192 additions and 123 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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue