brinckmann / montepython_public

Public repository for the Monte Python Code
MIT License
93 stars 80 forks source link

Problems in get_cl - No lensed Cl computed #183

Closed miug14 closed 3 years ago

miug14 commented 3 years ago

Hello, I am running Monte Python v 3.3.0 and CLASS v 2.9.4 with Python 3 (although I have tried using Python 2 and other class versions and the error persists). I run just LCDM with no changes to class. If I use just the baseTTTEEE2018 param file, I keep getting the following error right after the chains initialise:

"File "montepython/MontePython.py", line 40, in sys.exit(run()) File "/home/miug14/Simulations/montepython_public/montepython/run.py", line 45, in run sampler.run(cosmo, data, command_line) File "/home/miug14/Simulations/montepython_public/montepython/sampler.py", line 46, in run mcmc.chain(cosmo, data, command_line) File "/home/miug14/Simulations/montepython_public/montepython/mcmc.py", line 787, in chain newloglike = sampler.compute_lkl(cosmo, data) File "/home/miug14/Simulations/montepython_public/montepython/sampler.py", line 792, in compute_lkl value = likelihood.loglkl(cosmo, data) File "/home/miug14/Simulations/montepython_public/montepython/likelihood_class.py", line 953, in loglkl cl = self.get_cl(cosmo) File "/home/miug14/Simulations/montepython_public/montepython/likelihood_class.py", line 192, in get_cl cl = cosmo.lensed_cl(int(l_max)) File "classy.pyx", line 567, in classy.Class.lensed_cl (/home/miug14/Simulations/class/python/../python/classy.c:9149) classy.CosmoSevereError:

Error in Class: No lensed Cl computed"

Do you have any idea where the problem might be coming from? It seems that if I try several times, the chains eventually run without a problem but the fact that I get this error so often makes me suspicious that there might be some bug. I have been trying to understand where this comes from for some months now but I just don't understand what the problem might be... Thank you!

brinckmann commented 3 years ago

Hi,

This is surprising. Something might have changed on the CLASS end, I'll look into it. Can you try to add data.cosmo_arguments['lensing'] = 'yes' to your param file?

Best, Thejs

miug14 commented 3 years ago

Hi, Thank you for your prompt reply! Yes, I have tried doing so and the error persists. I have also tried adding data.cosmo_arguments['output'] = 'tCl,pCl,lCl,mPk' with no success... It seems like the error comes up around line 567 of classy.pyx, where indeed we have "if not spectra: raise CosmoSevereError("No lensed Cl computed") lmaxR = self.le.l_lensed_max" But I am not sure what could be causing the error... I have also tried running on a cluster and on my laptop separately and every time the error comes up... Thank you again!

brinckmann commented 3 years ago

Hi,

It looks like you might need to raise a ticket on the CLASS github page (of course look through open and closed issues first) as this seems to be a problem on that end. I suspect some default settings have changed in a recent version and that's what is causing a problem, but I'm not quite sure what's going on and I don't have time to investigate right now. Please get back to me if you figure out the problem, otherwise I can try to see if I can replicate your problem (and then hopefully fix it!)

Best, Thejs

miug14 commented 3 years ago

Right, I will do so, thank you!