src/mock_sample_functions.c
double lumi_distance (double z1)
{
  double z, dz, dm, z_integral;
  double hubble_cons_cgs;
  double dl;

  hubble_cons_cgs = H0_unit * 1e5 / (1e6 * 3.0857e18);

  z_integral = 0.0;
  dz=1.0e-7;

  for(z=0.0; z <= z1; z+=dz){
    z_integral += 1.0 / sqrt((1+z)*(1+z)*(1+Omega_m*z)-z*(2+z)*Omega_lambda) * dz;
  }

  dm = 2.9979e10 / hubble_cons_cgs * z_integral;

  dl = (1+z1) * dm;

  return dl;
}
/// Below are functions needed for routine lum2flux (convert luminosity to flux), written by Taka
Below are functions needed for routine lum2flux (convert luminosity to flux), written by Taka
Below are functions needed for routine lum2flux ( convert luminosity to flux ) written by Taka
double lumi_distance (double z1)
{
  double z, dz, dm, z_integral;
  double hubble_cons_cgs;
  double dl;
  hubble_cons_cgs = H0_unit * 1e5 / (1e6 * 3.0857e18);
  z_integral = 0.0;
  dz=1.0e-7;
  for(z=0.0; z <= z1; z+=dz){
    z_integral += 1.0 / sqrt((1+z)*(1+z)*(1+Omega_m*z)-z*(2+z)*Omega_lambda) * dz;
  }
  dm = 2.9979e10 / hubble_cons_cgs * z_integral;
  dl = (1+z1) * dm;
  return dl;
}
double lumi_distance ( double z1 ) { double z , dz , dm , z_integral ; double hubble_cons_cgs ; double dl ; hubble_cons_cgs = H0_unit * 1e5 / ( 1e6 * 3.0857e18 ) ; z_integral = 0.0 ; dz = 1.0e-7 ; for ( z = 0.0 ; z <= z1 ; z += dz ) { z_integral += 1.0 / sqrt ( ( 1 + z ) * ( 1 + z ) * ( 1 + Omega_m * z ) - z * ( 2 + z ) * Omega_lambda ) * dz ; } dm = 2.9979e10 / hubble_cons_cgs * z_integral ; dl = ( 1 + z1 ) * dm ; return dl ; }
Below are functions needed for routine lum2flux (convert luminosity to flux), written by Taka
Below are functions needed for routine lum2flux ( convert luminosity to flux ) written by Taka