classy-szfast 0.0.25.post7__py3-none-any.whl → 0.0.25.post9__py3-none-any.whl
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.
- classy_szfast/classy_szfast.py +48 -1
- {classy_szfast-0.0.25.post7.dist-info → classy_szfast-0.0.25.post9.dist-info}/METADATA +3 -4
- {classy_szfast-0.0.25.post7.dist-info → classy_szfast-0.0.25.post9.dist-info}/RECORD +5 -5
- {classy_szfast-0.0.25.post7.dist-info → classy_szfast-0.0.25.post9.dist-info}/WHEEL +1 -1
- {classy_szfast-0.0.25.post7.dist-info → classy_szfast-0.0.25.post9.dist-info}/top_level.txt +0 -0
classy_szfast/classy_szfast.py
CHANGED
@@ -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.
|
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
|
@@ -11,7 +11,6 @@ Requires-Dist: numpy>=1.19.0
|
|
11
11
|
Requires-Dist: Cython>=0.29.21
|
12
12
|
Requires-Dist: tensorflow
|
13
13
|
Requires-Dist: mcfit
|
14
|
-
Requires-Dist:
|
15
|
-
Requires-Dist:
|
14
|
+
Requires-Dist: get_cosmopower_emus
|
15
|
+
Requires-Dist: class_sz_data
|
16
16
|
Requires-Dist: cosmopower-jax
|
17
|
-
|
@@ -1,6 +1,6 @@
|
|
1
1
|
classy_szfast/__init__.py,sha256=E2thrL0Z9oXFfdzwcsu-xbOytudLFTlRlPqVFGlPPPg,279
|
2
2
|
classy_szfast/classy_sz.py,sha256=QmbwrSXInQLMvCDqsr7KPmtaU0KOiOt1Rb-cTKuulZw,22240
|
3
|
-
classy_szfast/classy_szfast.py,sha256=
|
3
|
+
classy_szfast/classy_szfast.py,sha256=ccKynjQks6nrPXa-eLREmCoIz_cl6e6dVJxdcdqavAE,42821
|
4
4
|
classy_szfast/config.py,sha256=v6DGcBHmfn5JtuO48dKyXCh-Dmn0uwOF_izvVOJFnqw,279
|
5
5
|
classy_szfast/cosmopower.py,sha256=ooYK2BDOZSo3XtGHfPtjXHxr5UW-yVngLPkb5gpvTx8,2351
|
6
6
|
classy_szfast/cosmopower_jax.py,sha256=NqU_Sw5x0qw16DNHrN4ipCZP8HVdQvUiCq_Y04h8zoo,5468
|
@@ -14,7 +14,7 @@ classy_szfast/custom_bias/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
14
14
|
classy_szfast/custom_bias/custom_bias.py,sha256=aR2t5RTIwv7P0m2bsEU0Eq6BTkj4pG10AebH6QpG4qM,486
|
15
15
|
classy_szfast/custom_profiles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
classy_szfast/custom_profiles/custom_profiles.py,sha256=4LZwb2XoqwCyWNmW2s24Z7AJdmgVdaRG7yYaBYe-d9Q,1188
|
17
|
-
classy_szfast-0.0.25.
|
18
|
-
classy_szfast-0.0.25.
|
19
|
-
classy_szfast-0.0.25.
|
20
|
-
classy_szfast-0.0.25.
|
17
|
+
classy_szfast-0.0.25.post9.dist-info/METADATA,sha256=0AGVPnbd_om95RjxosZD_k_q6ORgzvv5rvrlaR1BGpw,547
|
18
|
+
classy_szfast-0.0.25.post9.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
19
|
+
classy_szfast-0.0.25.post9.dist-info/top_level.txt,sha256=hRgqpilUck4lx2KkaWI2y9aCDKqF6pFfGHfNaoPFxv0,14
|
20
|
+
classy_szfast-0.0.25.post9.dist-info/RECORD,,
|
File without changes
|