Skip to content

Commit

Permalink
added test for freq method in TestUISeriesWavelet; docstring fixes fo…
Browse files Browse the repository at this point in the history
…r summary_plot
  • Loading branch information
CommonClimate committed May 24, 2024
1 parent 3e942c3 commit f53d48e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyleoclim/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@ def summary_plot(self, psd, scalogram, figsize=[8, 10], title=None,
import pyleoclim as pyleo
series = pyleo.utils.load_dataset('SOI')
psd = series.spectral(freq_method = 'welch')
psd = series.spectral(freq = 'welch')
scalogram = series.wavelet(freq_method = 'welch')
fig, ax = series.summary_plot(psd = psd,scalogram = scalogram)
Expand All @@ -1819,10 +1819,10 @@ def summary_plot(self, psd, scalogram, figsize=[8, 10], title=None,
import pyleoclim as pyleo
series = pyleo.utils.load_dataset('SOI')
psd = series.spectral(freq_method = 'welch')
psd = series.spectral(freq = 'welch').signif_test(number=20)
scalogram = series.wavelet(freq_method = 'welch')
fig, ax = series.summary_plot(psd = psd,scalogram = scalogram, period_lim = [5,0], ts_plot_kwargs = {'color':'red','linewidth':.5}, psd_plot_kwargs = {'color':'red','linewidth':.5})
fig, ax = series.summary_plot(psd = psd,scalogram = scalogram, period_lim = [5,0], ts_plot_kwargs = {'color':'Purple','linewidth':.5}, psd_plot_kwargs = {'color':'Purple','linewidth':1.5})
'''

Expand Down Expand Up @@ -3142,7 +3142,10 @@ def wavelet(self, method='cwt', settings=None, freq_method='log', freq_kwargs=No
# Process options
settings = {} if settings is None else settings.copy()
freq_kwargs = {} if freq_kwargs is None else freq_kwargs.copy()

freq = specutils.make_freq_vector(self.time, method=freq_method, **freq_kwargs)


args = {}
args['wwz'] = {'freq': freq}
args['cwt'] = {'freq': freq}
Expand Down
7 changes: 7 additions & 0 deletions pyleoclim/tests/test_core_Series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,13 @@ def test_wave_t3(self,mother):
'''
ts = gen_ts(model='colored_noise',nt=200)
_ = ts.wavelet(method='cwt',settings={'mother':mother})

@pytest.mark.parametrize('freq_meth', ['log', 'scale', 'nfft', 'welch'])
def test_wave_t4(self,freq_meth):
''' Test Series.wavelet() with different mother wavelets
'''
ts = gen_ts(model='colored_noise',nt=200)
_ = ts.wavelet(method='cwt',freq_method=freq_meth)

class TestUISeriesSsa():
''' Test the SSA functionalities
Expand Down

0 comments on commit f53d48e

Please sign in to comment.