21cmfast/21CMMC

[BUG] NoiseFile+obs prior type-o

Closed this issue · 3 comments

Hello,

In likelihood.py line 375, the InterpolatedUnivariateSpline should have n['ks'] as an argument (instead of n['k'] which disagrees with the noise format check earlier).

It runs without error with this fix.

Sorry to be reporting things so frequently at the moment!
Cheers,
Tom

Thanks @binnietom! Can you submit a PR for this?

Reporting things frequently is great!

Hi Steven, I will when I'm confident I've got a working set but Ive written a lot of print statements that are mainly for my learning processes! For now I'll just keep posting updates on here if that's ok (I suspect its easier for you to change a line in the master than for me to reorganise a git branch?).

Speaking of this I've found a type-o in each of the observational priors. They all need to be multiplied by -0.5 (this has been done for the other likelihoods, its just missed for these ones as it was done globally in the old Likelihood21cmFast.py code). I've implemented this as follows:

LikelihoodPlanck line 634
return ((self.tau_mean - model["tau"]) / self.tau_sigma) ** 2 --->
return -0.5*((self.tau_mean - model["tau"]) / self.tau_sigma) ** 2

LikelihoodNeutralFraction (Mcgreer) line 811
return lnprob ---> return -0.5*lnprob

For LikelihoodGreig line 889
return -2.0 * np.log(qso_prob) ---> return np.log(qso_prob)

I have fixed these in the referenced PR. However, most of the documentation agrees with n['k'] -- so I instead changed the noise format check.