1
0
Fork 0
mirror of https://github.com/cosmo-sims/monofonIC.git synced 2024-09-19 17:03:45 +02:00

added enforced normalisation of read white noise

This commit is contained in:
Oliver Hahn 2020-02-27 22:56:40 +01:00
parent ed9f30235c
commit f2ba17cfcd
2 changed files with 18 additions and 5 deletions

View file

@ -4,9 +4,9 @@ GridRes = 128
# length of the box in Mpc/h
BoxLength = 250
# starting redshift
zstart = 129.0
zstart = 49.0
# order of the LPT to be used (1,2 or 3)
LPTorder = 1
LPTorder = 3
# also do baryon ICs?
DoBaryons = no
# do mode fixing à la Angulo&Pontzen
@ -15,11 +15,11 @@ DoFixing = no
ParticleLoad = sc
# Add a possible constraint field here:
ConstraintFieldFile = initial_conditions.h5
ConstraintFieldName = ic
ConstraintFieldName = ic_white_noise
[cosmology]
transfer = CLASS
ztarget = 0.0
ztarget = 2.5
# transfer = eisenstein
# transfer = file_CAMB
# transfer_file = wmap5_transfer_out_z0.dat

View file

@ -384,7 +384,20 @@ void Grid_FFT<data_t,bdistributed>::Read_from_HDF5(const std::string Filename, c
}
sum1 /= Data.size();
sum2 /= Data.size();
csoca::ilog << "Constraint field has <W>=" << sum1 << ", <W^2>-<W>^2=" << std::sqrt(sum2-sum1*sum1) << std::endl;
auto stdw = std::sqrt(sum2-sum1*sum1);
csoca::ilog << "Constraint field has <W>=" << sum1 << ", <W^2>-<W>^2=" << stdw << std::endl;
#pragma omp parallel for reduction(+:sum1,sum2)
for (size_t i = 0; i < size(0); ++i)
{
for (size_t j = 0; j < size(1); ++j)
{
for (size_t k = 0; k < size(2); ++k)
{
this->relem(i,j,k) /= stdw;
}
}
}
}
template <typename data_t,bool bdistributed>