From eb6dbfd31792598ca1446fc388bb1c2b99aefe20 Mon Sep 17 00:00:00 2001 From: Oliver Hahn Date: Mon, 29 Aug 2011 18:38:38 -0700 Subject: [PATCH] Code now writes out input power spectra "input_powerspec_{cdm,baryon,total}" rather than the "transfer_k.dat" file which was confusing as it did NOT contain the k-space transfer function. --- transfer_function.hh | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/transfer_function.hh b/transfer_function.hh index 5a147bb..55493e0 100644 --- a/transfer_function.hh +++ b/transfer_function.hh @@ -267,20 +267,40 @@ protected: //... perform anti-ringing correction from Hamilton (2000) k0r0 = krgood( mu, q, dlnr, k0r0 ); - - std::ofstream ofsk("transfer_k.txt"); + + std::string ofname; + switch( type_ ) + { + case cdm: + ofname = "input_powerspec_cdm.txt"; break; + case baryon: + ofname = "input_powerspec_baryon.txt"; break; + case total: + ofname = "input_powerspec_total.txt"; break; + case vcdm: + ofname = "input_powerspec_vcdm.txt"; break; + case vbaryon: + ofname = "input_powerspec_vbaryon.txt"; break; + default: + throw std::runtime_error("Unknown transfer function type in TransferFunction_real::transform"); + } + + + std::ofstream ofsk(ofname.c_str()); double sum_in = 0.0; for( unsigned i=0; icompute( k, type_ ); - - RE(in[i]) = sqrtpnorm*T*pow(k,0.5*nspec_)*pow(k,1.5-q); + double del = sqrtpnorm*T*pow(k,0.5*nspec_); + + RE(in[i]) = del*pow(k,1.5-q); IM(in[i]) = 0.0; sum_in += RE(in[i]); - ofsk << std::setw(16) << k <