More refactoring

This commit is contained in:
Noe Brucy
2022-11-03 16:50:05 +01:00
parent 0d117132d3
commit e56c09cd59
9 changed files with 10 additions and 8 deletions
+3 -3
View File
@@ -29,7 +29,7 @@ def get_pspec(pp, field:str, dim:int=3):
Returns
-------
tupple (np.array, np.array)
wave number and correponding powers
wave number and corresponding powers
"""
h5file = tables.File(pp.pspec_filename)
path = f"/out_{pp.num:05}/d{dim}/{field}"
@@ -48,7 +48,7 @@ span_resolution = {
}
def get_slope(pp, field:str, resol:int, plotdebug:bool=False):
def get_pspec_slope(pp, field:str, resol:int, plotdebug:bool=False):
"""Get the slope of the Power specturm using linear regression in the selected range
Parameters
@@ -64,8 +64,8 @@ def get_slope(pp, field:str, resol:int, plotdebug:bool=False):
tuple (float, float)
Slope, square value of the correlation coefficient
"""
# Trustworthy span od the power spectrum in log10(k) as a function of the resolution
# Trustworthy span od the power spectrum in log10(k) as a function of the resolution
logkmin, logkmax = span_resolution[resol]
k, power = get_pspec(pp, field)
logk, logpower = np.log10(k), np.log10(power)