mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
Added a check that the subsampling value is the adequate one.
This commit is contained in:
parent
bef3deee25
commit
5cbf68e072
1 changed files with 10 additions and 2 deletions
|
@ -385,7 +385,7 @@ void buildBox(SimuData *simu, long num_targets, long loaded,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void saveBox(SimuData *&boxed, const std::string& outbox)
|
void saveBox(SimuData *&boxed, const std::string& outbox, generateMock_info& args_info)
|
||||||
{
|
{
|
||||||
double *ranges = boxed->as<double>("ranges");
|
double *ranges = boxed->as<double>("ranges");
|
||||||
NcFile f(outbox.c_str(), NcFile::Replace, 0, 0, NcFile::Netcdf4);
|
NcFile f(outbox.c_str(), NcFile::Replace, 0, 0, NcFile::Netcdf4);
|
||||||
|
@ -408,6 +408,7 @@ void saveBox(SimuData *&boxed, const std::string& outbox)
|
||||||
f.add_att("range_z_max", ranges[5]);
|
f.add_att("range_z_max", ranges[5]);
|
||||||
f.add_att("mask_index", -1);
|
f.add_att("mask_index", -1);
|
||||||
f.add_att("is_observation", 0);
|
f.add_att("is_observation", 0);
|
||||||
|
f.add_att("data_subsampling", args_info.subsample_arg);
|
||||||
|
|
||||||
NcDim *NumPart_dim = f.add_dim("numpart_dim", boxed->NumPart);
|
NcDim *NumPart_dim = f.add_dim("numpart_dim", boxed->NumPart);
|
||||||
NcDim *NumSnap_dim = f.add_dim("numsnap_dim", num_snapshots);
|
NcDim *NumSnap_dim = f.add_dim("numsnap_dim", num_snapshots);
|
||||||
|
@ -451,6 +452,13 @@ void makeBoxFromParameter(SimuData *simu, SimuData* &boxed, generateMock_info& a
|
||||||
boxed->time = simu->time;
|
boxed->time = simu->time;
|
||||||
boxed->BoxSize = simu->BoxSize;
|
boxed->BoxSize = simu->BoxSize;
|
||||||
|
|
||||||
|
NcAtt *d_sub = f.get_att("data_subsampling");
|
||||||
|
if (d_sub == 0 || d_sub->as_double(0) != args_info.subsample_arg)
|
||||||
|
{
|
||||||
|
cerr << "Parameter file was not generated with the same simulation subsampling argument. Particles will be different. Stop here." << endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
NcVar *v_id = f.get_var("particle_ids");
|
NcVar *v_id = f.get_var("particle_ids");
|
||||||
NcVar *v_snap = f.get_var("snapshot_split");
|
NcVar *v_snap = f.get_var("snapshot_split");
|
||||||
long *edges1;
|
long *edges1;
|
||||||
|
@ -715,7 +723,7 @@ int main(int argc, char **argv)
|
||||||
delete[] efac;
|
delete[] efac;
|
||||||
}
|
}
|
||||||
|
|
||||||
saveBox(simuOut, args_info.outputParameter_arg);
|
saveBox(simuOut, args_info.outputParameter_arg, args_info);
|
||||||
generateOutput(simuOut, args_info.axis_arg,
|
generateOutput(simuOut, args_info.axis_arg,
|
||||||
args_info.output_arg);
|
args_info.output_arg);
|
||||||
delete preselector;
|
delete preselector;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue