Skip to content

Commit 2581e7e

Browse files
committed
add doctest
1 parent d75879e commit 2581e7e

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

dascore/proc/correlate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def correlate(
135135
... frequency=range(10, 20),
136136
... duration=5,
137137
... channel_count=10,
138-
... ).taper(time=0.5).set_units(distance='m')
138+
... ).taper(time=0.05).set_units(distance='m')
139139
>>>
140140
>>> # Example 1
141141
>>> # Calculate cc for all channels as receivers and

dascore/proc/taper.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ def taper(
7777
{taper_type}.
7878
**kwargs
7979
Used to specify the dimension along which to taper and the percentage
80-
of total length of the dimension or absolute units. If a single value
81-
is passed, the taper will be applied to both ends. A length two tuple
82-
can specify different values for each end, or no taper on one end.
80+
of total length of the dimension (if a decimal or percente, see examples),
81+
or absolute units. If a single value is passed, the taper will be applied
82+
to both ends. A length two tuple can specify different values for each
83+
end, or no taper on one end.
8384
8485
Returns
8586
-------
@@ -100,9 +101,13 @@ def taper(
100101
>>> # Apply a triangular taper to 10% of the start of the distance dimension.
101102
>>> patch_taper2 = patch.taper(distance=(0.10, None), window_type='triang')
102103
>>>
104+
>>> # Apply taper to first 20 percent and last 12 percent of time dimension.
105+
>>> from dascore.units import percent
106+
>>> patch_taper3 = patch.taper(time=(20 * percent, 12 * percent))
107+
>>>
103108
>>> # Apply taper on first and last 15 m along distance axis.
104109
>>> from dascore.units import m
105-
>>> patch_taper3 = patch.taper(distance=15 * m)
110+
>>> patch_taper4 = patch.taper(distance=15 * m)
106111
"""
107112
func = _get_window_function(window_type)
108113
# get taper values in samples.

0 commit comments

Comments
 (0)