classy-szfast 0.0.25.post7__tar.gz → 0.0.25.post9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/PKG-INFO +1 -1
  2. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/classy_szfast.py +48 -1
  3. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast.egg-info/PKG-INFO +1 -1
  4. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/pyproject.toml +1 -1
  5. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/README.md +0 -0
  6. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/__init__.py +0 -0
  7. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/classy_sz.py +0 -0
  8. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/config.py +0 -0
  9. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/cosmopower.py +0 -0
  10. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/cosmopower_jax.py +0 -0
  11. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/cosmosis_classy_szfast_interface.py +0 -0
  12. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/custom_bias/__init__.py +0 -0
  13. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/custom_bias/custom_bias.py +0 -0
  14. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/custom_profiles/__init__.py +0 -0
  15. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/custom_profiles/custom_profiles.py +0 -0
  16. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/emulators_meta_data.py +0 -0
  17. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/pks_and_sigmas.py +0 -0
  18. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/restore_nn.py +0 -0
  19. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/suppress_warnings.py +0 -0
  20. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast/utils.py +0 -0
  21. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast.egg-info/SOURCES.txt +0 -0
  22. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast.egg-info/dependency_links.txt +0 -0
  23. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast.egg-info/requires.txt +0 -0
  24. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/classy_szfast.egg-info/top_level.txt +0 -0
  25. {classy_szfast-0.0.25.post7 → classy_szfast-0.0.25.post9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: classy_szfast
3
- Version: 0.0.25.post7
3
+ Version: 0.0.25.post9
4
4
  Summary: The accelerator of the class_sz code from https://github.com/CLASS-SZ
5
5
  Maintainer-email: Boris Bolliet <bb667@cam.ac.uk>
6
6
  License: MIT
@@ -294,6 +294,16 @@ class Class_szfast(object):
294
294
  H = self.hz_interp(z)
295
295
  rho_crit = (3./(8.*self.pi*Const._G_*Const._M_sun_))*pow(Const._Mpc_over_m_,1)*self.pow(Const._c_,2)*self.pow(H,2)/self.pow(params_values['h'],2)
296
296
  return rho_crit
297
+
298
+ def get_volume_dVdzdOmega_at_z(self,z,params_values_dict=None):
299
+ params_values = self.get_all_relevant_params(params_values_dict)
300
+ self.calculate_hubble(**params_values_dict)
301
+ Ez = self.hz_interp(z)/self.hz_interp(0.)
302
+ self.calculate_chi(**params_values_dict)
303
+ dA = self.chi_interp(z)/(1.+z)
304
+ rz = dA*(1.+z)*params_values['h']
305
+ dVdzdOmega = 2.99792458e8/1.0e5*rz*rz/Ez
306
+ return dVdzdOmega
297
307
 
298
308
  def get_r_delta_of_m_delta_at_z(self,delta,m_delta,z,params_values_dict=None):
299
309
  if params_values_dict:
@@ -575,13 +585,17 @@ class Class_szfast(object):
575
585
  var = P.copy()
576
586
 
577
587
  dvar = P.copy()
588
+ # dvar_grads = P.copy()
578
589
 
579
590
  for iz,zp in enumerate(self.cszfast_pk_grid_z):
580
591
 
581
592
  R, var[:,iz] = TophatVar(k, lowring=True)(P[:,iz], extrap=True)
582
593
 
583
- dvar[:,iz] = self.gradient(var[:,iz], R)
594
+ # dvar[:,iz] = self.gradient(var[:,iz], R) ## old form
595
+ _, dvar[:,iz] = TophatVar(k, lowring=True, deriv=1)(P[:,iz]*k, extrap=True) # new form
584
596
 
597
+ # dvar = dvar/(2.*np.sqrt(var))
598
+ # print(dvar_grads/dvar)
585
599
  # print(k)
586
600
  # print(R)
587
601
  # print(k*R)
@@ -598,6 +612,39 @@ class Class_szfast(object):
598
612
  self.cszfast_pk_grid_dsigma2_flat = dvar.flatten()
599
613
 
600
614
  return 0
615
+
616
+ def calculate_vrms2(self,**params_values_dict):
617
+ # k = self.cszfast_pk_grid_k
618
+ k = np.geomspace(1e-5,1e1,1000)
619
+
620
+
621
+ # z = self.cszfast_pk_grid_z
622
+ z = np.linspace(0,3,800)
623
+
624
+ # P = self.cszfast_pk_grid_pk
625
+ P = np.asarray([self.get_pkl_at_k_and_z(k,zpx) for zpx in z])
626
+
627
+ a = 1/(1+z)
628
+ H = self.get_hubble(z)
629
+ z0 = 0.
630
+
631
+ k0 = 1e-2
632
+ pks = self.get_pkl_at_k_and_z(k0,z)
633
+ pks0 = self.get_pkl_at_k_and_z(k0,z0)
634
+ D = np.sqrt(pks/pks0)
635
+
636
+ f = -np.gradient(np.log(D), np.log(1 + z))
637
+
638
+ W = f*a*H
639
+ x = np.log(k)
640
+ I = 1/3*W[:,None]**2*P*k/2/np.pi**2
641
+
642
+
643
+ vrms2 = scipy.integrate.simpson(I,x=x,axis=1)
644
+
645
+
646
+ self.cszfast_3c2vrms2 = np.interp(self.cszfast_pk_grid_z,z,np.log(vrms2*3.*Const._c_**2*1e-6))
647
+ return 0
601
648
 
602
649
 
603
650
  def calculate_sigma8_and_der(self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: classy_szfast
3
- Version: 0.0.25.post7
3
+ Version: 0.0.25.post9
4
4
  Summary: The accelerator of the class_sz code from https://github.com/CLASS-SZ
5
5
  Maintainer-email: Boris Bolliet <bb667@cam.ac.uk>
6
6
  License: MIT
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
- version = "0.0.25.post7"
6
+ version = "0.0.25.post9"
7
7
  license = { text = "MIT" }
8
8
  name = "classy_szfast"
9
9
  maintainers = [{name = "Boris Bolliet",email="bb667@cam.ac.uk"}]