Skip to content

Commit

Permalink
housekeeping (#86)
Browse files Browse the repository at this point in the history
- prepping to make WindowedTimeSeries have an FFT method
  • Loading branch information
kkappler committed Aug 24, 2024
1 parent 4548f0f commit b9dce85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion aurora/pipelines/time_series_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ def run_ts_to_stft(decimation_obj, run_xrds_orig):
raise ValueError

windowed_obj = WindowedTimeSeries.detrend(data=windowed_obj, detrend_type="linear")
tapered_obj = windowed_obj * windowing_scheme.taper
tapered_obj = WindowedTimeSeries.apply_taper(
data=windowed_obj, taper=windowing_scheme.taper
)
stft_obj = windowing_scheme.apply_fft(
tapered_obj, detrend_type=decimation_obj.extra_pre_fft_detrend_type
)
Expand Down
4 changes: 3 additions & 1 deletion aurora/time_series/windowed_time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def __init__(self):

@can_use_xr_dataarray
@staticmethod
def apply_taper(data=None, taper=None): # , in_place=True):
def apply_taper(
data: Union[xr.DataArray, xr.Dataset], taper: np.ndarray
): # , in_place=True):
"""
Point by point multiplication of taper against time series.
Expand Down
3 changes: 0 additions & 3 deletions aurora/time_series/windowing_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,6 @@ def downsample_time_axis(self, time_axis: np.ndarray) -> np.ndarray:
def apply_taper(self, data):
"""
modifies the data in place by applying a taper to each window
TODO: consider adding an option to return a copy of the data without
the taper applied
"""
data = WindowedTimeSeries.apply_taper(data=data, taper=self.taper)
return data
Expand Down

0 comments on commit b9dce85

Please sign in to comment.