Some fixups
This commit is contained in:
parent
1bd685e9c5
commit
71691956cc
6 changed files with 24 additions and 10 deletions
|
@ -171,6 +171,7 @@ void CosmoTool_compute_bispectrum(
|
|||
size_t *Ntriangles,
|
||||
double* B, double delta_k, size_t Nk )
|
||||
{
|
||||
#if 0
|
||||
// First remap to multi_array for easy access
|
||||
size_t kNz = Nz/2+1;
|
||||
#ifdef _OPENMP
|
||||
|
@ -246,6 +247,7 @@ void CosmoTool_compute_bispectrum(
|
|||
#else
|
||||
#warning Serial version not implemented
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -255,6 +257,7 @@ void CosmoTool_compute_powerspectrum(
|
|||
size_t *Ncounts,
|
||||
double* P, double delta_k, size_t Nk )
|
||||
{
|
||||
#if 0
|
||||
// First remap to multi_array for easy access
|
||||
size_t kNz = Nz/2+1;
|
||||
boost::multi_array_ref<std::complex<double>, 3> a_delta(reinterpret_cast<std::complex<double>*>(delta_hat), boost::extents[Nx][Ny][kNz]);
|
||||
|
@ -275,4 +278,5 @@ void CosmoTool_compute_powerspectrum(
|
|||
a_Nc[q1] ++;
|
||||
a_P[q1] += std::norm(v1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -65,18 +65,30 @@ cdef class CosmologyPower:
|
|||
cdef CosmoPower power
|
||||
|
||||
def __init__(self,**cosmo):
|
||||
"""Constructor
|
||||
|
||||
Keyword arguments:
|
||||
* omega_B_0
|
||||
* omega_M_0
|
||||
* h
|
||||
* ns
|
||||
* T27
|
||||
"""
|
||||
self.power = CosmoPower()
|
||||
self.power.OMEGA_B = cosmo['omega_B_0']
|
||||
self.power.OMEGA_C = cosmo['omega_M_0']-cosmo['omega_B_0']
|
||||
self.power.h = cosmo['h']
|
||||
if 'ns' in cosmo:
|
||||
self.power.n = cosmo['ns']
|
||||
if 'T27' in cosmo:
|
||||
self.power.THETA_27 = cosmo['T27']
|
||||
|
||||
assert self.power.OMEGA_C > 0
|
||||
|
||||
self.power.updateCosmology()
|
||||
|
||||
def setNormalization(self,A):
|
||||
"""Set manual normalization for A_S"""
|
||||
self.power.setNormalization(A)
|
||||
|
||||
def normalize(self,s8,k_min=-1,k_max=-1):
|
||||
|
|
|
@ -509,19 +509,17 @@ cdef void INTERNAL_project_cic_with_mass_periodic(DTYPE_t[:,:,:] g,
|
|||
cdef int b1[3]
|
||||
|
||||
for i in range(x.shape[0]):
|
||||
|
||||
for j in range(3):
|
||||
a[j] = (x[i,j]+shifter)*delta_Box
|
||||
b[j] = int(floor(a[j]))
|
||||
b1[j] = b[j]+1
|
||||
while b1[j] < 0:
|
||||
b1[j] += Ngrid
|
||||
while b1[j] >= Ngrid:
|
||||
b1[j] -= Ngrid
|
||||
b1[j] = (b[j]+1) % Ngrid
|
||||
|
||||
a[j] -= b[j]
|
||||
c[j] = 1-a[j]
|
||||
|
||||
b[j] %= Ngrid
|
||||
|
||||
|
||||
m0 = mass[i]
|
||||
g[b[0],b[1],b[2]] += c[0]*c[1]*c[2]*m0
|
||||
g[b1[0],b[1],b[2]] += a[0]*c[1]*c[2]*m0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue