In [3]:
from classy import Class
from cosmoslik_plugins.models import cosmology

In [4]:
cmb = Class()
paramsold = cosmology.cosmology()     
paramsold


Out[4]:
{'As': 2.4e-09,
 'H0': 70,
 'massive_neutrinos': 3.046,
 'massless_neutrinos': 0.0,
 'nrun': 0,
 'ns': 0.96,
 'ombh2': 0.0225,
 'omch2': 0.12,
 'omk': 0,
 'omnuh2': 0,
 'tau': 0.09,
 'w': -1}

In [5]:
params = {
          'A_s' : 2.4e-9, 
          'H0'  : 72,
          'N_ur' : 3.046,
          'omega_b' : 0.0225,
          'omega_cdm' : 0.12,
          'tau_reio' : 0.09,
          'n_s' : 0.96
          }
          
cmb.set(**params)


Out[5]:
True

In [6]:
cmb.set(output = 'tCl, lCl')
cmb.set({'lensing':'yes', 'l_max_scalars':4000})


Out[6]:
True

In [7]:
cmb.struct_cleanup()

In [8]:
cmb.compute(lvl = ['background'] )


Out[8]:
0.0018634897487547451

In [12]:
cmb.Hubble(5)


Out[12]:
0.0018634897487547451

In [25]:
oldHubble = cmb.Hubble
def Hubble(z):
    return 70
cmb.Hubble = Hubble


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-25-cdd43a89e11d> in <module>()
      2 def Hubble(z):
      3     return 70
----> 4 cmb.Hubble = Hubble

AttributeError: 'classy.Class' object attribute 'Hubble' is read-only

In [29]:
oldHubble(1231)


Out[29]:
6.354582447789237

In [30]:



---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-30-ad77561e39ef> in <module>()
----> 1 cmbnew = cmb.copy()

AttributeError: 'classy.Class' object has no attribute 'copy'

In [ ]: