Skip to content

Commit

Permalink
change frange default start value from 25 to 1 in psd.rescale
Browse files Browse the repository at this point in the history
  • Loading branch information
twmacro committed Oct 6, 2021
1 parent bc65244 commit f6cb58b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pyyeti/psd.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def rescale(P, F, n_oct=3, freq=None, extendends=True, frange=None):
frange : 1d array_like or None; optional
This option can be used to limit the frequency range of the
output frequencies. If None, this option is ignored for cases
where `freq` is used, but is set internally to ``(25.0,
where `freq` is used, but is set internally to ``(1.0,
np.inf))`` for cases where `n_oct` is used. Only the first and
last elements of `frange` are used. Note that the output
frequencies will be trimmed further if needed by the first and
Expand Down Expand Up @@ -623,7 +623,7 @@ def _get_fl_fu(fcenter):

if freq is None:
if frange is None:
frange = (25.0, np.inf)
frange = (1.0, np.inf)
frange = _set_frange(frange, 1.0, F[-1])
Wctr, FL, FU = get_freq_oct(n_oct, exact=True, frange=frange)
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_psd.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_rescale():
p6, f6, msv6, ms6 = psd.rescale(p, f, n_oct=6)
p6_2, f6_2, msv6_2, ms6_2 = psd.rescale(p, f, freq=f6)
p12, f12, msv12, ms12 = psd.rescale(p6, f6, n_oct=12)
i = int(25 / 2 ** (1 / 6))
i = int(1.0 / 2 ** (1 / 6))
msv1 = np.sum(p[i:] * (f[1] - f[0]))
assert abs(msv1 / msv3 - 1) < 0.12
assert abs(msv1 / msv6 - 1) < 0.06
Expand Down

0 comments on commit f6cb58b

Please sign in to comment.