Skip to content

Commit

Permalink
ENH address CR installment 2 (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr committed Oct 25, 2018
1 parent d5223a7 commit 0ccdd23
Show file tree
Hide file tree
Showing 17 changed files with 738 additions and 1,024 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ examples/ccl_sample_pkemu
examples/ccl_sample_power
examples/ccl_sample_run
examples/ccl_sample_angpow
examples/*.pdf

# Ignore Python pyc, autogenerated swig files, and build dirs
*.pyc
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ project(ccl VERSION 0.2.1)
# Defines list of CCL tests src files
# ! Add new tests to this list
set(TEST_SRC tests/ccl_test.c tests/ccl_test_utils.c tests/ccl_test_params.c tests/ccl_test_params_mnu.c
tests/ccl_test_cosmology.c
tests/ccl_test_cosmology.c
tests/ccl_test_distances_class_allz.c tests/ccl_test_distances_cosmomad_hiz.c tests/ccl_test_distances_cosmomad_lowz.c
tests/ccl_test_distances_astropy_mnu_lowz.c tests/ccl_test_distances_astropy_mnu_hiz.c
tests/ccl_test_growth_lowz.c tests/ccl_test_growth_hiz.c tests/ccl_test_growth_allz.c
Expand Down
30 changes: 3 additions & 27 deletions include/ccl_background.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ typedef enum ccl_species_x_label {
ccl_species_ur_label=5,
ccl_species_nu_label=6,
} ccl_species_x_label;

/**
* Normalized expansion rate at scale factor a.
* Returns H(a)/H0 in a given cosmology.
Expand All @@ -26,9 +26,6 @@ typedef enum ccl_species_x_label {
*/
double ccl_h_over_h0(ccl_cosmology * cosmo, double a, int * status);

// Normalized expansion rate at scale factors as given in list a[0..na-1]
void ccl_h_over_h0s(ccl_cosmology * cosmo, int na, double a[], double output[], int * status);

/**
* Normalized expansion rate at scale factors as given in list a[0..na-1]
* Returns H(a)/H0 for an array of scale factors a of length na.
Expand All @@ -52,9 +49,6 @@ void ccl_h_over_h0s(ccl_cosmology * cosmo, int na, double a[], double output[],
*/
double ccl_comoving_radial_distance(ccl_cosmology * cosmo, double a, int* status);

// Comoving radial distances in Mpc to scale factors as given in list a[0..na-1]
void ccl_comoving_radial_distances(ccl_cosmology * cosmo, int na, double a[], double output[], int* status);

/**
* Comoving radial distances in Mpc to scale factors as given in list a[0..na-1]
* @param cosmo Cosmological parameters
Expand Down Expand Up @@ -94,9 +88,6 @@ double ccl_sinn(ccl_cosmology *cosmo,double chi, int *status);
*/
double ccl_comoving_angular_distance(ccl_cosmology * cosmo, double a, int* status);

// Comoving angular distances in Mpc to scale factors as given in list a[0..na-1]
void ccl_comoving_angular_distances(ccl_cosmology * cosmo, int na, double a[], double output[], int* status);

/**
* Comoving angular distances in Mpc to scale factors as given in array a[0..na-1]
* NOTE this quantity is otherwise known as the transverse comoving distance, and is NOT angular diameter
Expand All @@ -122,9 +113,6 @@ void ccl_comoving_angular_distances(ccl_cosmology * cosmo, int na, double a[], d
*/
double ccl_luminosity_distance(ccl_cosmology * cosmo, double a, int * status);

// Comoving luminosity distances in Mpc to scale factors as given in list a[0..na-1]
void ccl_luminosity_distances(ccl_cosmology * cosmo, int na, double a[], double output[], int * status);

/**
* Comoving luminosity distances in Mpc to scale factors as given in array a[0..na-1]
* @param cosmo Cosmological parameters
Expand Down Expand Up @@ -172,9 +160,6 @@ void ccl_distance_moduli(ccl_cosmology * cosmo, int na, double a[], double outpu
*/
double ccl_growth_factor(ccl_cosmology * cosmo, double a, int * status);

// Growth factors at a list of scale factor given in a[0..na-1] normalized to 1 at z=0
void ccl_growth_factors(ccl_cosmology * cosmo, int na, double a[], double output[], int * status);

/**
* Growth factors at an array of scale factor given in a[0..na-1], where g(z=0) is normalized to 1
* @param cosmo Cosmological parameters
Expand All @@ -198,9 +183,6 @@ void ccl_growth_factors(ccl_cosmology * cosmo, int na, double a[], double output
*/
double ccl_growth_factor_unnorm(ccl_cosmology * cosmo, double a, int * status);

// Growth factors at a list of scale factor given in a[0..na-1] normalized to a in matter domination
void ccl_growth_factors_unnorm(ccl_cosmology * cosmo, int na, double a[], double output[], int * status);

/**
* Growth factors at a list of scale factor given in a[0..na-1], where g(a) is normalized to a in matter domination
* @param cosmo Cosmological parameters
Expand All @@ -224,9 +206,6 @@ void ccl_growth_factors_unnorm(ccl_cosmology * cosmo, int na, double a[], double
*/
double ccl_growth_rate(ccl_cosmology * cosmo, double a, int* status);

// Logarithmic rates of d ln g/d lna a at alist of scale factor a [0..na-1]
void ccl_growth_rates(ccl_cosmology * cosmo, int na, double a[], double output[], int * status);

/**
* Logarithmic rates of d ln(g)/d ln(a) at an array of scale factors a[0..na-1]
* @param cosmo Cosmological parameters
Expand All @@ -250,9 +229,6 @@ void ccl_growth_rates(ccl_cosmology * cosmo, int na, double a[], double output[]
*/
double ccl_scale_factor_of_chi(ccl_cosmology * cosmo, double chi, int * status);

// Scale factors for a given list of comoving distances
void ccl_scale_factor_of_chis(ccl_cosmology * cosmo, int nchi, double chi[], double output[], int* status);

/**
* Scale factors for a given array of comoving distances chi[0..nchi-1]
* @param cosmo Cosmological parameters
Expand All @@ -272,9 +248,9 @@ void ccl_scale_factor_of_chis(ccl_cosmology * cosmo, int nchi, double chi[], dou
* @param a scale factor, normalized to 1 for today
* @param label species type. Available: 'critical'(0), 'matter'(1), 'dark_energy'(2), 'radiation'(3), 'curvature'(4), 'massless neutrinos'(5), 'massive neutrinos'(6).
* @param int is_comoving. 0 for physical densities, and nonzero for comoving densities (via a^3 factor).
* @param status Status flag. 0 if there are no errors, nonzero otherwise.
* @param status Status flag. 0 if there are no errors, nonzero otherwise.
* For specific cases see documentation for ccl_error.
* @return rho_x, physical density at scale factor a.
* @return rho_x, physical density at scale factor a.
*/
double ccl_rho_x(ccl_cosmology * cosmo, double a, ccl_species_x_label label, int is_comoving, int* status);

Expand Down
Loading

0 comments on commit 0ccdd23

Please sign in to comment.