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

fixed some normalisation problems

This commit is contained in:
Oliver Hahn 2023-02-15 13:33:56 -08:00
parent c010a5eecc
commit a987c8eec1
2 changed files with 7 additions and 6 deletions

View file

@ -183,10 +183,11 @@ public:
transfer_function_ = select_transfer_function_plugin(cf, cosmo_param_);
transfer_function_->intialise();
if( !transfer_function_->tf_isnormalised_ ){
cosmo_param_.set("pnorm", this->compute_pnorm_from_sigma8() );
cosmo_param_.set("pnorm", this->compute_pnorm_from_sigma8()*Dplus_start_*Dplus_start_ );
}else{
cosmo_param_.set("pnorm", 1.0/Dplus_target_/Dplus_target_);
auto sigma8 = this->compute_sigma8();
// WARNING: we do explicit back-scaling here, which is notably different from monofonIC
cosmo_param_.set("pnorm", Dplus_start_*Dplus_start_/Dplus_target_/Dplus_target_);
auto sigma8 = this->compute_sigma8()*Dplus_start_/Dplus_target_;
music::ilog << "Measured sigma_8 for given PS normalisation is " << sigma8 << std::endl;
}
cosmo_param_.set("sqrtpnorm", std::sqrt(cosmo_param_["pnorm"]));

View file

@ -485,9 +485,9 @@ int main(int argc, const char *argv[])
double cosmo_dplus = the_cosmo_calc->get_growth_factor(astart) / the_cosmo_calc->get_growth_factor(1.0);
double cosmo_vfact = the_cosmo_calc->get_vfact(astart);
if (!the_cosmo_calc.get()->transfer_function_.get()->tf_has_total0()){
the_cosmo_calc->cosmo_param_["pnorm"] *= cosmo_dplus * cosmo_dplus;
}
// if (!the_cosmo_calc.get()->transfer_function_.get()->tf_has_total0()){
// the_cosmo_calc->cosmo_param_["pnorm"] *= cosmo_dplus * cosmo_dplus;
// }
double cosmo_pnorm = the_cosmo_calc->cosmo_param_["pnorm"];
//... directly use the normalisation via a parameter rather than the calculated one
cosmo_pnorm = cf.get_value_safe<double>("setup", "force_pnorm", cosmo_pnorm);