|
Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
|
#include <stdio.h>#include <stdlib.h>#include <math.h>#include <gsl/gsl_integration.h>#include <gsl/gsl_spline.h>#include <gsl/gsl_errno.h>#include "ccl.h"#include "ccl_params.h"#include "ccl_redshifts.h"
Go to the source code of this file.
Classes | |
| struct | pz_params |
| struct | norm_params |
Functions | |
| pz_info * | ccl_create_photoz_info (void *params, double(*pz_func)(double, double, void *, int *)) |
| static double | ccl_photoz (double z_ph, void *params) |
| double | gaussian_pz (double z_ph, double z_s, void *params, int *status) |
| pz_info * | ccl_create_gaussian_photoz_info (double sigma_z0) |
| void | ccl_free_photoz_info (pz_info *my_photoz_info) |
| dNdz_info * | ccl_create_dNdz_info (void *params, double(*dNdz_func)(double, void *, int *)) |
| double | dNdz_smail (double z, void *params, int *status) |
| dNdz_info * | ccl_create_Smail_dNdz_info (double alpha, double beta, double z0) |
| static double | ccl_dNdz (double z, dNdz_info *params, int *status) |
| void | ccl_free_dNdz_info (dNdz_info *my_dNdz_info) |
| static double | ccl_norm_integrand (double z, void *params) |
| void | ccl_dNdz_tomog (double z, double bin_zmin, double bin_zmax, pz_info *photo_info, dNdz_info *dN_info, double *tomoout, int *status) |
This function creates a structure amalgamating the information on an analytic true dNdz, plus some parameters.
| params | parameters for the analytic dNdz form |
| dNdz_func | dNdz function |
Definition at line 94 of file ccl_redshifts.c.
References halomod_bm::params, and dNdz_info::your_dN_params.
Referenced by main().
This function creates a structure containing the photo-z model for the built-in Gaussian photo-z pdf.
| sigma_z0 | The photo-z uncertainty at z=0. The photo-z uncertainty is assumed to scale like (1 + z). |
Definition at line 67 of file ccl_redshifts.c.
References gaussian_pz(), pz_info::your_pz_func, and pz_info::your_pz_params.
Referenced by main().
This function creates a structure amalgamating the information on the photo-z model, P(z) plus some parameters.
| params | parameters for the P(z) function |
| pz_func | P(z) function |
Definition at line 21 of file ccl_redshifts.c.
References halomod_bm::params, and pz_info::your_pz_params.
Referenced by main().
This function creates a structure containing the true dNdz for the built-in Smail-type analytic form: dNdz ~ z^alpha exp(- (z/z0)^beta)
| alpha | |
| z0 | |
| beta |
Definition at line 120 of file ccl_redshifts.c.
References smail_params::alpha, beta, smail_params::beta, dNdz_smail(), dNdz_info::your_dN_func, dNdz_info::your_dN_params, and smail_params::z0.
Referenced by main().
Definition at line 142 of file ccl_redshifts.c.
References pz_params::status, dNdz_info::your_dN_func, dNdz_info::your_dN_params, and z.
Referenced by ccl_dNdz_tomog(), and ccl_norm_integrand().
| void ccl_dNdz_tomog | ( | double | z, |
| double | bin_zmin, | ||
| double | bin_zmax, | ||
| pz_info * | photo_info, | ||
| dNdz_info * | dN_info, | ||
| double * | tomoout, | ||
| int * | status | ||
| ) |
Return dNdz in a particular tomographic bin, convolved with a photo-z model (defined by the user), and normalized.
| z | redshift |
| dNdz_type | the choice of dN/dz from Chang+ |
| bin_zmin | the minimum redshift of the tomorgraphic bin |
| bin_zmax | the maximum redshift of the tomographic bin |
| photo_info | the P(z) info struct |
| tomoout | the output dN/dz |
| status | Status flag. 0 if there are no errors, nonzero otherwise. |
Definition at line 222 of file ccl_redshifts.c.
References norm_params::bin_zmax_, norm_params::bin_zmin_, ccl_cosmology_read_config(), ccl_dNdz(), CCL_ERROR_INTEG, CCL_ERROR_MISSING_CONFIG_FILE, ccl_gsl, ccl_norm_integrand(), ccl_photoz(), ccl_raise_exception(), ccl_raise_gsl_warning(), ccl_splines, norm_params::dN_information, ccl_gsl_params::INTEGRATION_DNDZ_EPSREL, ccl_gsl_params::N_ITERATION, pz_params::pz_information, norm_params::pz_information, pz_params::status, norm_params::status, z, Z_MAX_SOURCES, Z_MIN_SOURCES, and pz_params::z_true.
Referenced by main().
| void ccl_free_dNdz_info | ( | dNdz_info * | dN_info | ) |
Free memory holding the structure containing dNdz information.
| dN_info | that holds user-defined dNdz and parameters |
Definition at line 152 of file ccl_redshifts.c.
Referenced by main().
| void ccl_free_photoz_info | ( | pz_info * | my_photoz_info | ) |
Free memory holding the structure containing user-input photoz information.
| my_photoz_info | that holds user-defined P(z) and parameters |
Definition at line 84 of file ccl_redshifts.c.
Referenced by main().
Definition at line 173 of file ccl_redshifts.c.
References norm_params::bin_zmax_, norm_params::bin_zmin_, ccl_cosmology_read_config(), ccl_dNdz(), CCL_ERROR_MISSING_CONFIG_FILE, ccl_gsl, ccl_photoz(), ccl_raise_exception(), ccl_raise_gsl_warning(), ccl_splines, norm_params::dN_information, ccl_gsl_params::INTEGRATION_DNDZ_EPSREL, ccl_gsl_params::N_ITERATION, p, pz_params::pz_information, pz_params::status, norm_params::status, z, and pz_params::z_true.
Referenced by ccl_dNdz_tomog().
Definition at line 44 of file ccl_redshifts.c.
References p, pz_params::pz_information, pz_params::status, pz_info::your_pz_func, pz_info::your_pz_params, and pz_params::z_true.
Referenced by ccl_dNdz_tomog(), and ccl_norm_integrand().
Definition at line 107 of file ccl_redshifts.c.
Referenced by ccl_create_Smail_dNdz_info().