Skip to content

Commit

Permalink
Merge pull request #2 from cosmodesi/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
otavioalonso authored Jun 22, 2023
2 parents c4ed4ad + 8a08bf9 commit bbb9865
Show file tree
Hide file tree
Showing 3 changed files with 832 additions and 102 deletions.
17 changes: 17 additions & 0 deletions thecov/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,20 @@ def kmid(self):
'''

return np.arange(self.kmin + self.dk/2, self.kmax + self.dk/2, self.dk)

@property
def kavg(self):
'''
Returns the average k of the k-bins. Assumes spherical approximation to
integrate k-modes, which fails for small k.
Returns
-------
numpy.ndarray
The average k of the k-bins.
'''
return 3/4*(self.kedges[1:]**4 - self.kedges[:-1]**4)/ \
(self.kedges[1:]**3 - self.kedges[:-1]**3)

@property
def kedges(self):
Expand Down Expand Up @@ -583,3 +597,6 @@ def nmodes(self, nmodes):

self._nmodes = nmodes
return nmodes

class MultipoleFourierCovariance(MultipoleCovariance, FourierBinned):
pass
Loading

0 comments on commit bbb9865

Please sign in to comment.