Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions pyleoclim/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2431,7 +2431,8 @@ def annualize(self, months=list(range(1, 13)), min_res=0.25, frac_req_months=2/3

Examples
--------
1) Annual average
1) Calendar average

.. jupyter-execute::

soi = pyleo.utils.load_dataset('SOI')
Expand All @@ -2444,32 +2445,35 @@ def annualize(self, months=list(range(1, 13)), min_res=0.25, frac_req_months=2/3
fig, ax = soi.plot(title='Jan-Dec averaging')
soi_a.plot(marker='o',ax=ax)

2) JJA average : straightforward
2) JJA average (straightforward)

.. jupyter-execute::

soi_jja = soi.annualize(months=[6, 7 , 8])
fig, ax = soi.plot(title='JJA averaging')
soi_jja.plot(marker='o',ax=ax, label='JJA average')

3) DJF average : straddles a year; handles it gracefully

.. jupyter-execute::

soi_djf = soi.annualize(months=[12, 1 , 2])
fig, ax = soi.plot(title='DJF averaging')
soi_djf.plot(marker='o',ax=ax, label='DJF average')

4) Varying the fraction of required months

.. jupyter-execute::

AprMar = [4,5,6,7,8,9,10,11,12,1,2,3]
soi_am_default = soi.annualize(months=AprMar)
soi_am_stringent = soi.annualize(months=AprMar,frac_req_months=0.9)
soi_am_stringent = soi.annualize(months=AprMar,frac_req_months=1.0)

fig, ax = soi.plot(title='Apr-Mar averaging')
fig, ax = soi.plot(title='Apr-Mar averaging', xlim = [2000, 2026])
soi_am_default.plot(marker='o',ax=ax, label='Apr-Mar, $f=2/3$')
soi_am_stringent.plot(marker='o',ax=ax, label='Apr-Mar, $f=0.9$')
soi_am_stringent.plot(marker='o',ax=ax, label='Apr-Mar, $f=1.0$')

We see that insisting on a very high fraction of available months will result in dropped years
The last year is incomplete, so insisting on complete coverage results in dropping it

Notes
-----
Expand Down Expand Up @@ -3458,11 +3462,11 @@ def wavelet(self, method='cwt', settings=None, freq=None, freq_kwargs=None, verb
Examples
--------

Wavelet analysis on the evenly-spaced SOI record. The CWT method will be applied by default.
Wavelet analysis on the evenly-spaced NINO3 record. The CWT method will be applied by default.

.. jupyter-execute::

ts = pyleo.utils.load_dataset('SOI')
ts = pyleo.utils.load_dataset('NINO3')
scal1 = ts.wavelet()
scal_signif = scal1.signif_test(number=20) # for research-grade work, use number=200 or larger
fig, ax = scal_signif.plot()
Expand Down
11 changes: 7 additions & 4 deletions pyleoclim/data/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
SOI:
filename: 'soi_data'
filename: 'soi.long'
file_extension: 'csv'
pandas_kwargs:
skiprows: 0
header: 1
header: 0
parse_dates: [0]
index_col: 0
skipfooter: 1
pyleo_kwargs:
time_name: 'time'
time_unit: 'year C.E.'
value_name: 'SOI'
value_unit: 'mb'
label: 'Southern Oscillation Index'
archiveType: 'Instrumental'
time_column: 1
value_column: 2
time_column: 0
value_column: ' SOI from CRU missing value -99.99 https://psl.noaa.gov/data/timeseries/month/'

NINO3:
filename: 'wtc_test_data_nino_even'
Expand Down
Loading
Loading