2013-03-03 00:42:56 +01:00
|
|
|
/*+
|
2014-05-22 09:38:59 +02:00
|
|
|
This is CosmoTool (./src/cosmopower.hpp) -- Copyright (C) Guilhem Lavaux (2007-2014)
|
2013-03-03 00:42:56 +01:00
|
|
|
|
|
|
|
guilhem.lavaux@gmail.com
|
|
|
|
|
|
|
|
This software is a computer program whose purpose is to provide a toolbox for cosmological
|
|
|
|
data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...)
|
|
|
|
|
|
|
|
This software is governed by the CeCILL license under French law and
|
2019-07-11 14:27:22 +02:00
|
|
|
abiding by the rules of distribution of free software. You can use,
|
2013-03-03 00:42:56 +01:00
|
|
|
modify and/ or redistribute the software under the terms of the CeCILL
|
|
|
|
license as circulated by CEA, CNRS and INRIA at the following URL
|
2019-07-11 14:27:22 +02:00
|
|
|
"http://www.cecill.info".
|
2013-03-03 00:42:56 +01:00
|
|
|
|
|
|
|
As a counterpart to the access to the source code and rights to copy,
|
|
|
|
modify and redistribute granted by the license, users are provided only
|
|
|
|
with a limited warranty and the software's author, the holder of the
|
|
|
|
economic rights, and the successive licensors have only limited
|
2019-07-11 14:27:22 +02:00
|
|
|
liability.
|
2013-03-03 00:42:56 +01:00
|
|
|
|
|
|
|
In this respect, the user's attention is drawn to the risks associated
|
|
|
|
with loading, using, modifying and/or developing or reproducing the
|
|
|
|
software by the user in light of its specific status of free software,
|
|
|
|
that may mean that it is complicated to manipulate, and that also
|
|
|
|
therefore means that it is reserved for developers and experienced
|
|
|
|
professionals having in-depth computer knowledge. Users are therefore
|
|
|
|
encouraged to load and test the software's suitability as regards their
|
2019-07-11 14:27:22 +02:00
|
|
|
requirements in conditions enabling the security of their systems and/or
|
|
|
|
data to be ensured and, more generally, to use and operate it in the
|
|
|
|
same conditions as regards security.
|
2013-03-03 00:42:56 +01:00
|
|
|
|
|
|
|
The fact that you are presently reading this means that you have had
|
|
|
|
knowledge of the CeCILL license and that you accept its terms.
|
|
|
|
+*/
|
2013-03-06 04:39:33 +01:00
|
|
|
|
2012-12-13 16:39:27 +01:00
|
|
|
#ifndef _COSMOPOWER_HPP
|
|
|
|
#define _COSMOPOWER_HPP
|
|
|
|
|
|
|
|
namespace CosmoTool {
|
|
|
|
|
2015-04-28 22:08:39 +02:00
|
|
|
struct TF_Transfer;
|
2019-07-11 14:27:22 +02:00
|
|
|
|
2012-12-13 16:39:27 +01:00
|
|
|
class CosmoPower
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// PRIMARY VARIABLES
|
|
|
|
double n;
|
|
|
|
double K0;
|
|
|
|
double V_LG_CMB;
|
|
|
|
|
|
|
|
double CMB_VECTOR[3];
|
|
|
|
|
|
|
|
double h;
|
|
|
|
double SIGMA8;
|
|
|
|
double OMEGA_B;
|
|
|
|
double OMEGA_C;
|
2013-02-19 17:15:46 +01:00
|
|
|
double omega_B;
|
|
|
|
double omega_C;
|
2012-12-13 16:39:27 +01:00
|
|
|
double Theta_27;
|
2019-07-11 14:27:22 +02:00
|
|
|
|
|
|
|
// DERIVED VARIABLES
|
2012-12-13 16:39:27 +01:00
|
|
|
double OMEGA_0;
|
|
|
|
double Omega;
|
|
|
|
double beta;
|
|
|
|
double OmegaEff;
|
|
|
|
double Gamma0;
|
|
|
|
double normPower;
|
2019-07-11 14:27:22 +02:00
|
|
|
|
2015-02-20 16:43:35 +01:00
|
|
|
struct EHuParams {
|
|
|
|
double k_silk;
|
|
|
|
double s;
|
|
|
|
double k_eq;
|
|
|
|
double alpha_b, beta_b;
|
|
|
|
double alpha_c, beta_c;
|
|
|
|
double beta_node;
|
|
|
|
};
|
2019-07-11 14:27:22 +02:00
|
|
|
|
2015-02-20 16:43:35 +01:00
|
|
|
EHuParams ehu;
|
2015-04-28 22:08:39 +02:00
|
|
|
TF_Transfer *ehu_params;
|
2015-02-20 16:43:35 +01:00
|
|
|
|
|
|
|
enum CosmoFunction {
|
|
|
|
POWER_EFSTATHIOU,
|
|
|
|
HU_WIGGLES,
|
2019-07-11 14:27:22 +02:00
|
|
|
PRIMORDIAL_PS,
|
|
|
|
MATTER_TK,
|
2015-02-20 16:43:35 +01:00
|
|
|
HU_BARYON,
|
|
|
|
OLD_POWERSPECTRUM,
|
|
|
|
POWER_BARDEEN,
|
|
|
|
POWER_SUGIYAMA,
|
|
|
|
POWER_BDM,
|
2015-04-28 18:23:19 +02:00
|
|
|
POWER_TEST,
|
2022-12-01 17:03:02 +01:00
|
|
|
HU_WIGGLES_ORIGINAL,
|
2022-12-01 18:52:18 +01:00
|
|
|
SAMPLE_WIGGLES,
|
|
|
|
NOWIGGLE_TK
|
2015-02-20 16:43:35 +01:00
|
|
|
};
|
2012-12-13 16:39:27 +01:00
|
|
|
|
|
|
|
CosmoPower();
|
2015-04-28 22:15:40 +02:00
|
|
|
~CosmoPower();
|
2012-12-13 16:39:27 +01:00
|
|
|
|
2012-12-13 23:27:46 +01:00
|
|
|
void setFunction(CosmoFunction f);
|
2012-12-13 16:39:27 +01:00
|
|
|
|
|
|
|
void updateCosmology();
|
2013-02-19 17:15:46 +01:00
|
|
|
void updatePhysicalCosmology();
|
2015-02-26 10:36:52 +01:00
|
|
|
void normalize(double k_min = -1, double k_max = -1);
|
2013-02-19 17:15:46 +01:00
|
|
|
void setNormalization(double A_K);
|
2015-02-20 16:43:35 +01:00
|
|
|
void updateHuWigglesConsts();
|
2015-04-28 18:23:19 +02:00
|
|
|
void updateHuWigglesOriginal();
|
2019-07-11 14:27:22 +02:00
|
|
|
|
2012-12-13 16:39:27 +01:00
|
|
|
double eval_theta_theta(double k);
|
|
|
|
double power(double k);
|
|
|
|
|
|
|
|
double integrandNormalize(double k);
|
|
|
|
private:
|
|
|
|
double (CosmoPower::*eval)(double);
|
|
|
|
|
|
|
|
double powerEfstathiou(double k);
|
|
|
|
double powerHuWiggles(double k);
|
2019-07-11 14:27:22 +02:00
|
|
|
double primordialPowerSpectrum(double k);
|
|
|
|
double matterTransferFunctionHu(double k);
|
2012-12-13 16:39:27 +01:00
|
|
|
double powerHuBaryons(double k);
|
|
|
|
double powerOld(double k);
|
|
|
|
double powerBardeen(double k);
|
|
|
|
double powerSugiyama(double k);
|
|
|
|
double powerBDM(double k);
|
|
|
|
double powerTest(double k);
|
2015-04-28 18:23:19 +02:00
|
|
|
double powerHuWigglesOriginal(double k);
|
2022-12-01 17:03:02 +01:00
|
|
|
double sample_BAO(double k);
|
2022-12-01 18:52:18 +01:00
|
|
|
double noWiggleTk(double k);
|
2012-12-13 16:39:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|