More refactoring
This commit is contained in:
+3
-3
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user