igmhub / baofit

Fits cosmological data to measure baryon acoustic oscillations.
9 stars 5 forks source link

hardcoded cosmology parameters in local::AbsCorrelationModel::_applyVelocityShift #21

Closed londumas closed 7 years ago

londumas commented 8 years ago

Hi,

the cosmology parameters are hardcoded in local::AbsCorrelationModel::applyVelocityShift on the line 146 : double dpi = (dv/100.)(1+z)/std::sqrt(0.73+0.27_zp1_zp1_zp1);

Cheers,

dkirkby commented 8 years ago

This is just a constant rescaling of dv to obtain dpi, so using a different cosmology would just be an additional rescaling by H0(z) / H(z) where H0(z)^2 = 0.73 + 0.27 (1 + z)^2 is the canonical Hubble function and H(z) is the new one. The internal likelihood parameter is really dpi, so this additional rescaling would not change the shape of the likelihood and so can be applied after the fit without changing anything in the code.

Alternatively, you could specify the background cosmology to use in your config file (this is already supported since it is required when fitting data binned in separation angles) and modify AbsCorrelationModel to use this to calculate the rescaling coefficient.

Finally, you could make dpi the external fit parameter, instead of dv, so there is no confusion and the user is free to interpret dpi as an equivalent dv in whatever cosmology they like.

mblomqvist commented 7 years ago

The input parameter for the matter density is now being propagated to AbsCorrelationModel for applying the velocity shift, i.e. the matter density value is no longer hardcoded in the function. The default value is set to Omega_M = 0.27 for backwards compatibility. Issue closed.